diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-10-07 18:45:16 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-10-07 18:45:16 +0200 |
commit | ee19cfbf49902ce9c2ef0eb3090529de30f27ba1 (patch) | |
tree | ee4b6b4b23459ffc23bbe2bc8c24af145d5e0eb1 /tests/scripts | |
parent | 003f5de16b43fcb5ef57a4f7f7f9e8dd6b612419 (diff) | |
download | weechat-ee19cfbf49902ce9c2ef0eb3090529de30f27ba1.zip |
tests: fix scripting API tests when they are run from autotools build directory
Diffstat (limited to 'tests/scripts')
-rw-r--r-- | tests/scripts/test-scripts.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/scripts/test-scripts.cpp b/tests/scripts/test-scripts.cpp index 58052f157..e4dc441d1 100644 --- a/tests/scripts/test-scripts.cpp +++ b/tests/scripts/test-scripts.cpp @@ -131,6 +131,8 @@ TEST(Scripts, API) { char path_testapigen[PATH_MAX], path_testapi[PATH_MAX]; char *path_testapi_output_dir, str_command[4096]; + char *test_scripts_dir; + const char *ptr_test_scripts_dir; const char *languages[][2] = { { "python", "py" }, { "perl", "pl" }, @@ -146,15 +148,20 @@ TEST(Scripts, API) printf ("...\n"); + ptr_test_scripts_dir = getenv ("WEECHAT_TESTS_SCRIPTS_DIR"); + test_scripts_dir = strdup ( + (ptr_test_scripts_dir) ? + ptr_test_scripts_dir : "../tests/scripts/python"); + /* build paths for scripting API tests */ snprintf (path_testapigen, sizeof (path_testapigen), "%s%s%s", - getenv ("WEECHAT_TESTS_SCRIPTS_DIR"), + test_scripts_dir, DIR_SEPARATOR, "testapigen.py"); snprintf (path_testapi, sizeof (path_testapi), "%s%s%s", - getenv ("WEECHAT_TESTS_SCRIPTS_DIR"), + test_scripts_dir, DIR_SEPARATOR, "testapi.py"); path_testapi_output_dir = string_eval_path_home ("%h/testapi", @@ -238,6 +245,7 @@ TEST(Scripts, API) } free (path_testapi_output_dir); + free (test_scripts_dir); printf ("TEST(Scripts, API)"); } |