guile: update unit tests
Make it work with meson.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
## Copyright (C) 2021 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
## Copyright (C) 2022 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
##
|
##
|
||||||
## This program is free software; you can redistribute it and/or modify
|
## This program is free software; you can redistribute it and/or modify
|
||||||
## it under the terms of the GNU General Public License as published by
|
## it under the terms of the GNU General Public License as published by
|
||||||
@ -15,13 +15,16 @@
|
|||||||
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
|
||||||
|
guile_load_path=':'.join([
|
||||||
|
join_paths(meson.source_root(), 'guile'),
|
||||||
|
join_paths(meson.current_build_dir(), '..')])
|
||||||
|
|
||||||
test('test-mu-guile',
|
test('test-mu-guile',
|
||||||
executable('test-mu-guile',
|
executable('test-mu-guile',
|
||||||
'test-mu-guile.cc',
|
'test-mu-guile.cc',
|
||||||
install: false,
|
install: false,
|
||||||
cpp_args: [
|
cpp_args: [
|
||||||
'-DABS_SRCDIR="' + meson.current_source_dir() + '"',
|
'-DABS_SRCDIR="' + meson.current_source_dir() + '"',
|
||||||
'-DMU_GUILE_LIBRARY_PATH="' + guile_builddir + '"',
|
'-DGUILE_LOAD_PATH="' + guile_load_path + '"'
|
||||||
'-DMU_GUILE_MODULE_PATH="' + guile_builddir + '"'
|
|
||||||
],
|
],
|
||||||
dependencies: [glib_dep, lib_mu_dep, lib_test_mu_common_dep]))
|
dependencies: [glib_dep, lib_mu_dep, lib_test_mu_common_dep]))
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright (C) 2012-2021 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2012-2022 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** This program is free software; you can redistribute it and/or modify it
|
||||||
** under the terms of the GNU General Public License as published by the
|
** under the terms of the GNU General Public License as published by the
|
||||||
@ -40,13 +40,13 @@ fill_database(void)
|
|||||||
|
|
||||||
tmpdir = test_mu_common_get_random_tmpdir();
|
tmpdir = test_mu_common_get_random_tmpdir();
|
||||||
cmdline = g_strdup_printf("/bin/sh -c '"
|
cmdline = g_strdup_printf("/bin/sh -c '"
|
||||||
"%s init --muhome=%s --maildir=%s --quiet; "
|
"%s init --muhome=%s --maildir=%s --quiet; "
|
||||||
"%s index --muhome=%s --quiet'",
|
"%s index --muhome=%s --quiet'",
|
||||||
MU_PROGRAM,
|
MU_PROGRAM,
|
||||||
tmpdir,
|
tmpdir,
|
||||||
MU_TESTMAILDIR2,
|
MU_TESTMAILDIR2,
|
||||||
MU_PROGRAM,
|
MU_PROGRAM,
|
||||||
tmpdir);
|
tmpdir);
|
||||||
|
|
||||||
if (g_test_verbose())
|
if (g_test_verbose())
|
||||||
g_print("%s\n", cmdline);
|
g_print("%s\n", cmdline);
|
||||||
@ -67,17 +67,17 @@ test_something(const char* what)
|
|||||||
char *dir, *cmdline;
|
char *dir, *cmdline;
|
||||||
gint result;
|
gint result;
|
||||||
|
|
||||||
|
|
||||||
|
g_setenv("GUILE_AUTO_COMPILE", "0", TRUE);
|
||||||
|
g_setenv("GUILE_LOAD_PATH", GUILE_LOAD_PATH, TRUE);
|
||||||
|
|
||||||
dir = fill_database();
|
dir = fill_database();
|
||||||
cmdline = g_strdup_printf("GUILE_AUTO_COMPILE=0 "
|
cmdline = g_strdup_printf("%s -q -e main %s/test-mu-guile.scm "
|
||||||
"LD_LIBRARY_PATH=%s:$LD_LIBRARY_PATH "
|
"--muhome=%s --test=%s",
|
||||||
"%s -q -L %s -e main %s/test-mu-guile.scm "
|
GUILE_BINARY,
|
||||||
"--muhome=%s --test=%s",
|
ABS_SRCDIR,
|
||||||
MU_GUILE_LIBRARY_PATH,
|
dir,
|
||||||
GUILE_BINARY,
|
what);
|
||||||
MU_GUILE_MODULE_PATH,
|
|
||||||
ABS_SRCDIR,
|
|
||||||
dir,
|
|
||||||
what);
|
|
||||||
|
|
||||||
if (g_test_verbose())
|
if (g_test_verbose())
|
||||||
g_print("cmdline: %s\n", cmdline);
|
g_print("cmdline: %s\n", cmdline);
|
||||||
@ -121,10 +121,10 @@ main(int argc, char* argv[])
|
|||||||
g_test_add_func("/guile/stats", test_mu_guile_stats);
|
g_test_add_func("/guile/stats", test_mu_guile_stats);
|
||||||
|
|
||||||
g_log_set_handler(NULL,
|
g_log_set_handler(NULL,
|
||||||
(GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_LEVEL_WARNING |
|
(GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_LEVEL_WARNING |
|
||||||
G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION),
|
G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION),
|
||||||
(GLogFunc)black_hole,
|
(GLogFunc)black_hole,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
rv = g_test_run();
|
rv = g_test_run();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user