Commit Graph

272 Commits (master)

Author SHA1 Message Date
Sébastien Helleu b8c6a5a2e1 tests: add tests on command/completion hooks scripting API functions 2017-10-28 13:12:00 +02:00
Sébastien Helleu 09f3edc2e6 tests: add tests on prefix and color scripting API functions 2017-10-27 01:12:35 +02:00
Sébastien Helleu 0fd1913ae8 tests: add tests on key_bind and key_unbind scripting API functions 2017-10-24 23:33:52 +02:00
Sébastien Helleu 1e6db7b489 tests: fix AST binop in Perl and Lua 2017-10-24 23:32:24 +02:00
Sébastien Helleu 4cff2322a0 tests: fix Tcl assignment 2017-10-24 23:31:51 +02:00
Sébastien Helleu 2b06b53a29 tests: add quotes in Lua tables 2017-10-24 23:30:32 +02:00
Sébastien Helleu a97d734d8b tests: fix Ruby strings 2017-10-24 23:29:38 +02:00
Sébastien Helleu 1cace5588a tests: escape "@" in Perl strings 2017-10-24 23:04:53 +02:00
Sébastien Helleu 1d56e17b2f core: allow floating point and hexadecimal numbers in comparison of evaluated values 2017-10-17 20:43:40 +02:00
Sébastien Helleu ff443c76b5 tests: add missing docstring 2017-10-10 20:17:15 +02:00
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
Mikaela Suomalainen 9f049afb18 core: use Ubuntu Trusty for tests (Travis CI)
The Debian package libcpputest-dev becomes useless as it's available in
the repositories now.
2015-12-20 07:57:36 +01:00
Sébastien Helleu 41cb1bf635 api: fix handle of invalid escape in function string_convert_escaped_chars()
And a new test is now checking that "\" returns "".
2015-08-24 11:05:31 +02:00
Sébastien Helleu 951d1f91a4 api: add function string_hex_dump() 2015-08-22 09:30:08 +02:00
Sébastien Helleu 46a9d17ac3 api: add argument "length" in function utf8_is_valid() 2015-08-18 07:36:48 +02:00
Sébastien Helleu 4ecd8a505f api: fix type of value returned by functions utf8_prev_char, utf8_next_char and utf8_add_offset 2015-07-04 08:39:55 +02:00
Sébastien Helleu 9bf40517d3 api: add support of evaluated sub-strings and current date/time in function string_eval_expression() and command /eval 2015-06-30 20:25:35 +02:00
Sébastien Helleu 2bd2d74a07 api: add function string_eval_path_home() 2015-06-24 07:54:42 +02:00
Sébastien Helleu 9e0fa27525 tests: add package libcpputest-dev for ubuntu/precise (Travis CI) 2015-06-14 14:32:22 +02:00
Sébastien Helleu 3262599413 core: make cpputest optional in cmake compilation
With this fix, WeeChat can be built without tests (if cpputest is not found),
without having to explicitely disable tests ("-DENABLE_TESTS=OFF").
2015-05-17 14:58:10 +02:00
Sébastien Helleu d322389e04 core: add support of full color option name in command /eval and API function string_eval_expression() 2015-04-26 10:29:30 +02:00
Sébastien Helleu b2a68af077 core: add options weechat.look.word_chars_{highlight|input} (closes #55, task #9459) 2015-04-11 18:53:44 +02:00
Sébastien Helleu 8b056d7d24 tests: check that function string_strndup returns NULL if the given string is NULL 2015-03-22 11:14:12 +01:00
Sébastien Helleu cace7471f0 tests: remove compiler warnings about unused parameters 2015-03-06 19:24:24 +01:00
Sébastien Helleu 3eb6cd3cd9 tests: remove unused variables 2015-03-03 07:43:23 +01:00
Sébastien Helleu f6941c20eb tests: remove unused variable 2015-03-02 21:15:23 +01:00
Sébastien Helleu 07c7ecb679 tests: add tests on weelist functions 2015-02-13 08:00:09 +01:00
Sébastien Helleu a020c28ea6 core: update copyright dates 2015-01-01 09:23:23 +01:00
Sébastien Helleu 0cd2aff765 core: use https for WeeChat URLs 2014-12-13 09:16:09 +01:00
Sébastien Helleu 7818e08964 tests: fix compilation of tests with clang (closes #275) 2014-12-10 21:15:40 +01:00
Sébastien Helleu b460055f78 tests: add tests of regex replace with empty regex or regex_replace 2014-11-23 08:32:52 +01:00
Sébastien Helleu e253a2509a tests: add hashtable tests with multiple items giving same hashed key 2014-11-18 20:12:25 +01:00
Sébastien Helleu 0d1abd3899 tests: add tests of functions string_shared_get and string_shared_free 2014-11-03 20:52:02 +01:00
Sébastien Helleu 633a32ccd3 api: add regex replace feature in function string_eval_expression 2014-10-22 21:19:54 +02:00
Sébastien Helleu 5f98f20c94 tests: fix memory leak in hashtable tests 2014-10-16 20:46:31 +02:00
Sébastien Helleu f62f759c3d core: add hide of chars in string in evaluation of expressions
The syntax is: ${hide:char,string}.
All chars in string are replaced with char (which can be one or more chars).
2014-10-16 20:46:06 +02:00
Sébastien Helleu 45a0bfe1b3 tests: add test of function string_split_shell with an empty string 2014-10-12 18:09:57 +02:00
Sébastien Helleu 9249738582 tests: add extra check of argv pointer in test of string_split functions 2014-10-12 18:09:04 +02:00
Sébastien Helleu 8b23106145 tests: initialize argc to -1 instead of 1 before some tests 2014-10-12 18:07:53 +02:00
Sébastien Helleu 5014231818 tests: add some tests on function eval_expression 2014-10-12 17:58:13 +02:00
Sébastien Helleu 2867996d1f core: fix search/insert of elements in sorted arraylist with duplicates
The pointer and index returned is now the first element found with the value
(with the lower index if there are many elements with same value).
And the index for insert is the last element with same value + 1
(the higher index + 1).
2014-10-11 15:47:09 +02:00
Sébastien Helleu f53baf628e Merge branch 'arraylist' 2014-10-05 08:35:17 +02:00
Sébastien Helleu 4c49113036 tests: add tests of hashtable functions 2014-09-03 07:38:46 +02:00
Sébastien Helleu dda1a66fd7 tests: add tests of arraylist functions 2014-09-01 11:51:04 +02:00
Sébastien Helleu 7b546bea2e api: use microseconds instead of milliseconds in functions util_timeval_diff and util_timeval_add 2014-08-29 18:17:27 +02:00
Sébastien Helleu 5424c5f9de core: fix build of tests with autotools 2014-08-25 20:26:19 +02:00
Sébastien Helleu f39b37351c tests: fix build of tests when the build directory is outside source tree (closes #178) 2014-08-25 07:38:38 +02:00
Sébastien Helleu bc34c3cfc2 tests: fix memory leak in tests launcher 2014-08-15 15:08:31 +02:00
Sébastien Helleu dcf46a2ca0 tests: read WeeChat command line arguments in environment variable "WEECHAT_TESTS_ARGS" 2014-08-14 19:15:25 +02:00
Sébastien Helleu 99b7aa9d27 tests: fix memory leaks 2014-08-14 19:13:32 +02:00
Sébastien Helleu 00e79af39c tests: add tests of function string_split_shell 2014-08-14 19:12:00 +02:00
Sébastien Helleu 328eeee5e1 tests: add partial tests of functions hashtable_set* 2014-08-14 19:09:27 +02:00
Sébastien Helleu 346fb62cf6 tests: don't install binary "tests" with autotools 2014-08-14 19:06:21 +02:00
Sébastien Helleu 536318eafe tests: add tests of function string_replace_with_callback 2014-08-14 07:38:42 +02:00
Sébastien Helleu a538a9c08e tests: add tests of function string_replace_regex 2014-08-09 09:08:06 +02:00
Sébastien Helleu 13fc108c6d tests: add TODO comments for missing tests 2014-08-06 07:53:04 +02:00
Sébastien Helleu 2cc265f34e tests: add tests of functions hashtable_hash_key_djb2 and hashtable_new 2014-08-04 07:41:24 +02:00
Sébastien Helleu 1aa8fd09ef tests: add tests of functions string_is_command_char and string_input_for_buffer 2014-08-02 16:55:49 +02:00
Sébastien Helleu 28cb1ae6f5 tests: add tests of base 16/64 decoding/encoding 2014-08-02 16:54:24 +02:00
Sébastien Helleu e29f01b4fb Merge branch 'travis-tests' 2014-08-02 15:47:20 +02:00
Sébastien Helleu ee1e181894 tests: remove test of han char in utf8_strlen_screen (failing on Ubuntu Precise) 2014-08-02 15:36:40 +02:00
Sébastien Helleu 1294bce155 tests: remove test of han char in utf8_char_size_screen (failing on Ubuntu Precise) 2014-08-02 15:25:56 +02:00
Sébastien Helleu d046315e8b api: fix function string_format_size on 32-bit systems 2014-08-02 11:44:15 +02:00
Sébastien Helleu f9b04635d3 tests: fix compilation of tests
The header gui-curses.h doesn't need to be included (this causes an error
because the real ncurses lib header is not found when compiling tests).
2014-08-02 11:38:58 +02:00
Sébastien Helleu 2987f9208e tests: add tests of function string_format_size 2014-08-01 07:34:35 +02:00
Sébastien Helleu aaa29153b0 tests: add tests of functions string_iconv* 2014-07-31 07:48:36 +02:00
Sébastien Helleu 3d6b9ff5a7 tests: add tests of function string_is_word_char 2014-07-29 07:39:30 +02:00
Sébastien Helleu 9177e02f1a tests: add -v option for command "tests" to increase verbosity (CMake) 2014-07-22 21:04:59 +02:00
Sébastien Helleu 29385e39be tests: fix compilation warning with autotools 2014-07-21 21:25:55 +02:00
Sébastien Helleu 63add00da7 tests: add compilation of tests with autotools 2014-07-21 21:25:43 +02:00
Sébastien Helleu 2eebb817fd tests: fix compilation of tests 2014-07-21 21:18:57 +02:00
Sébastien Helleu 5408db58d1 tests: add UTF-8 tests (check of some invalid UTF-8 chars) 2014-07-20 15:50:51 +02:00
Sébastien Helleu db9a8e7bc4 tests: add unit tests using CppUTest
The tests can be run only via CMake:

  1. build with tests: cmake .. -DENABLE_TESTS=ON
  2. make
  3. ctest  (or ctest -V for verbose output)
2014-07-20 12:13:25 +02:00