diff options
author | Peter Wu <peter@lekensteyn.nl> | 2020-01-21 02:21:31 +0000 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2020-01-21 02:21:31 +0000 |
commit | d498196712c209fdcbd92f65c0b47ff26fc6c009 (patch) | |
tree | c29e3155fe89dc3451352abb0796149731d13ea9 /test/rspamd_test_suite.c | |
parent | 425bb31e1dd095e16cdc463a636a78193e6c86b5 (diff) | |
download | rspamd-d498196712c209fdcbd92f65c0b47ff26fc6c009.tar.gz rspamd-d498196712c209fdcbd92f65c0b47ff26fc6c009.zip |
[Minor] test: remove hard-coded build directory
* Reproducible build: avoid defining the BUILDROOT macro and avoid
embedding the build directory in the test image. Instead rely on the
test files being present next to the executable.
* I considered using g_test_build_filename, available since GLib 2.38
(available on all supported platforms, RHEL 7, Debian, Ubuntu, etc.),
but decided against it because it would require setting the
G_TEST_SRCDIR or G_TEST_BUILDDIR environment variables. Therefore this
patch simply parses argv0 directly.
Diffstat (limited to 'test/rspamd_test_suite.c')
-rw-r--r-- | test/rspamd_test_suite.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/rspamd_test_suite.c b/test/rspamd_test_suite.c index d7b660642..48645ca93 100644 --- a/test/rspamd_test_suite.c +++ b/test/rspamd_test_suite.c @@ -12,6 +12,7 @@ worker_t *workers[] = { NULL }; gchar *lua_test = NULL; gchar *lua_test_case = NULL; gboolean verbose = FALSE; +gchar *argv0_dirname = NULL; static GOptionEntry entries[] = { @@ -45,6 +46,8 @@ main (int argc, char **argv) g_test_init (&argc, &argv, NULL); + argv0_dirname = g_path_get_dirname (argv[0]); + context = g_option_context_new ("- run rspamd test"); g_option_context_add_main_entries (context, entries, NULL); |