212 Commits

Author SHA1 Message Date
Sébastien Helleu
81a447dbb0 tests: add command /testapi.xx in test script, display elapsed time in scripting API tests 2017-10-10 19:43:47 +02:00
Sébastien Helleu
358297ba8f tests: fix instruction "return" in Perl/Guile/PHP output 2017-10-10 19:42:35 +02:00
Sébastien Helleu
ee6f28ef18 tests: remove unused variable 2017-10-10 19:41:34 +02:00
Sébastien Helleu
9ac3097679 tests: fix sort of Unparse classes on line number 2017-10-10 08:23:34 +02:00
Sébastien Helleu
8a32249507 javascript: fix detection of libv8 with autotools on Ubuntu Trusty 2017-10-07 21:43:18 +02:00
Sébastien Helleu
ee19cfbf49 tests: fix scripting API tests when they are run from autotools build directory 2017-10-07 18:45:16 +02:00
Sébastien Helleu
003f5de16b tests: fix compilation of tests with autotools 2017-10-07 18:45:02 +02:00
Sébastien Helleu
ca2c11dea7 tests: remove useless __init__ methods 2017-10-07 18:22:33 +02:00
Sébastien Helleu
703534034d tests: fix comments 2017-10-07 17:05:42 +02:00
Sébastien Helleu
e8af853624 tests: add scripting API tests (issue #104)
Automatic tests of scripting API are made with Python scripts:

- unparse.py: convert Python code to other languages
- testapigen.py: generate scripts in all languages to test the API
- testapi.py scripting API tests
2017-10-07 16:51:25 +02:00
Sébastien Helleu
137d5863e2 tests: run command "/debug libs" in tests instead of Travis CI command 2017-10-01 08:00:39 +02:00
Sébastien Helleu
e317a6856c tests: add PHP plugin in tests 2017-09-03 21:49:48 +02:00
Sébastien Helleu
c65137667b tests: improve tests on dynamic strings 2017-08-20 11:26:23 +02:00
Sébastien Helleu
16661b0cbe tests: display an error if the required locale en_US.UTF-8 is not installed 2017-07-23 15:12:40 +02:00
Sébastien Helleu
8efbf61e66 tests: fix load of plugins in tests after a build with autotools 2017-07-05 21:33:19 +02:00
Linus Heckemann
d6c1d02eca core: search WEECHAT_EXTRA_LIBDIR for plugins (closes #971, issue #979)
In addition to searching the statically configured WEECHAT_LIBDIR
(weechat's installation directory) for plugins, search the path
given in the environment variable WEECHAT_EXTRA_LIBDIR. This makes
departing from the FHS standard while keeping the plugins packaged
separately easier. This change was made specifically with the Nix
package manager in mind, but can easily be used by others.
2017-07-05 19:52:48 +02:00
Sébastien Helleu
5e48b50da8 tests: fix double load of plugins when "make install" is executed before tests 2017-07-05 19:41:11 +02:00
Sébastien Helleu
a59ce8331a tests: load plugins from build directory instead of installed libdir
This allows to run tests without running "make install".
2017-07-04 22:14:44 +02:00
Sébastien Helleu
b879df09b5 tests: check that fset plugin is loaded 2017-06-25 16:35:28 +02:00
Simmo Saan
0a4be02dc3 core: add hashtable_add_from_infolist to API 2017-06-17 20:03:40 +03:00
Simmo Saan
1329dfb57a core: add wildcard matching operators to eval (closes #608) 2017-04-29 17:04:44 +02:00
Sébastien Helleu
5b78cb2a7b tests: fix compilation warning on FreeBSD 2017-04-26 22:28:03 +02:00
Sébastien Helleu
112bebcddf core: add a way to count the suffix length in max chars displayed in cut of string ("cut:" and "cutscr:") (closes #963)
The format to use is one of:

- ${cut:+max,suffix,string}
- ${cutscr:+max,suffix,string}

With the "+" before max, WeeChat ensures there are at most "max" chars in
output, including the length of suffix string.
2017-04-24 22:37:49 +02:00
Sébastien Helleu
94355e2e38 core: ensure length is not negative in function string_strndup 2017-04-22 15:15:54 +02:00
Sébastien Helleu
6ab7af705e tests: fix tests on dynamic strings 2017-04-01 12:16:12 +02:00
Sébastien Helleu
bb00b6b8fb core: add ${re:#} to get the index of last group captured in evaluation of expressions 2017-03-30 22:13:14 +02:00
Sébastien Helleu
467f482ea6 core: make "callback_cmp" optional in call to function arraylist_new()
If no callback is given, a default callback is used, which just compares
pointers.
2017-03-30 20:35:16 +02:00
Sébastien Helleu
eb2d0ac58a tests: add tests on combining characters in cut/cutscr (evaluation of expression) 2017-03-28 22:09:11 +02:00
Sébastien Helleu
3045021430 core: fix cut of chars in "cutscr" of evaluated strings
This fixes two problems:
- stop before max char displayed with wide chars
- preserve combining chars in the output

Before the fix (wrong):

>> ${cutscr:3,+,こんにちは世界}
== [こん+]
>> ${cutscr:1,+,a${\u0308}}
== [a+]

After the fix (OK):

>> ${cutscr:3,+,こんにちは世界}
== [こ+]
>> ${cutscr:1,+,a${\u0308}}
== [ä]
2017-03-28 20:45:31 +02:00
Sébastien Helleu
f99c866f35 core: add cut of string with max chars displayed in evaluation of expressions
The syntax is: ${cutscr:max,suffix,string}.
The string is cut after max chars displayed on screen. If the string is cut,
the optional suffix is added after.
2017-03-27 21:14:51 +02:00
Sébastien Helleu
9a8ec36cbd core: add cut of string in evaluation of expressions
The syntax is: ${cut:max,suffix,string}.
The string is cut after max chars. If the string is cut, the optional suffix is
added after.
2017-03-25 14:19:48 +01:00
Sébastien Helleu
edfeb60e32 buflist: new plugin "buflist" (bar with list of buffers) 2017-03-25 14:18:19 +01:00
Sébastien Helleu
83117f8d2a core: add ternary operator (condition) in evaluation of expressions 2017-03-25 14:18:19 +01:00
Sébastien Helleu
07d16903f3 api: add dynamic string functions (string_dyn_*)
New functions:
- string_dyn_alloc
- string_dyn_copy
- string_dyn_concat
- string_dyn_free
2017-03-25 14:18:19 +01:00
Sébastien Helleu
1361602ea5 tests: fix compilation of tests on FreeBSD 11
Some includes were missing in .h files, and the tests must be linked
with intl and execinfo on FreeBSD.
2017-01-13 20:57:59 +01:00
Sébastien Helleu
705d86e684 core: update copyright dates 2017-01-01 11:32:04 +01:00
Andrew Potter
54ee5e0576
tests: add wattr_get/set to fake 2016-10-02 09:51:28 -07:00
Sébastien Helleu
54841f6294 api: fix return of function string_match() when there are multiple masks in the string (issue #812)
Some tests are added as well to test the multiple masks in the string.
2016-10-02 08:58:19 +02:00
Sébastien Helleu
e218db3582 tests: add test on the "extra" option on function eval_expression() 2016-08-18 22:11:50 +02:00
Sébastien Helleu
eb86def400 core: rename function string_iconv_fprintf to string_fprintf 2016-07-09 18:28:03 +02:00
Sébastien Helleu
22c0966387 tests: add tests on function string_split_command() 2016-05-14 09:14:08 +02:00
Wojciech Kwolek
a44bcaf080 core: fix the hardcoded separator in string_split_command 2016-05-08 12:14:17 +02:00
Sébastien Helleu
cf6aca1619 core: add pointer in some callbacks (closes #406)
This pointer is the first argument received by callbacks, and the
existing argument "data" is now automatically freed by WeeChat when the
object containing the callback is removed.

With this new pointer, the linked list of callbacks in scripts has been
removed. This will improve speed of scripts (using a lot of hooks),
reduce memory used by scripts and reduce time to unload scripts.

Following functions are affected in the C API:

* exec_on_files
* config_new
* config_new_section
* config_new_option
* hook_command
* hook_command_run
* hook_timer
* hook_fd
* hook_process
* hook_process_hashtable
* hook_connect
* hook_print
* hook_signal
* hook_hsignal
* hook_config
* hook_completion
* hook_modifier
* hook_info
* hook_info_hashtable
* hook_infolist
* hook_hdata
* hook_focus
* unhook_all_plugin
* buffer_new
* bar_item_new
* upgrade_new
* upgrade_read
2016-03-21 18:11:21 +01:00
Sébastien Helleu
50817054f9 tests: add tests on string_split() with keep_eol set to 2 2016-01-23 10:35:07 +01:00
Sébastien Helleu
3330724574 core: update copyright dates 2016-01-01 11:09:53 +01:00
Sébastien Helleu
57b6e320d3 core: fix execution of empty command name
The strings "/" and "/ " are not considered as valid commands any more.
2015-12-31 19:07:14 +01:00
Sébastien Helleu
a60075fb39 tests: temporary disable check of javascript plugin
The compilation with autotools fails to detect v8 lib (used by
javascript plugin) on Ubuntu Trusty, so the tests are failing because
javascript plugins is not loaded.

This check will be enabled again when autotools compilation will be
fixed.
2015-12-25 12:02:34 +01:00
Sébastien Helleu
0cda820807 tests: fix compilation with autotools 2015-12-24 23:07:47 +01:00
Sébastien Helleu
415dea5c74 tests: fix locale used to execute tests 2015-12-24 22:48:10 +01:00
Sébastien Helleu
6ff8de5740 tests: check if all plugins are loaded 2015-12-24 22:21:33 +01:00