tests: update test helpers and users
Move test-mu-common to mu-test-utils. Use mu_test_init as a wrapper for g_test_init. Update users.
This commit is contained in:
@ -23,18 +23,18 @@ test('test-cmd',
|
||||
executable('test-cmd',
|
||||
'test-mu-cmd.cc',
|
||||
install: false,
|
||||
dependencies: [glib_dep, lib_test_mu_common_dep, config_h_dep, lib_mu_dep]))
|
||||
dependencies: [glib_dep, config_h_dep, lib_mu_dep]))
|
||||
|
||||
test('test-cmd-cfind',
|
||||
executable('test-cmd-cfind',
|
||||
'test-mu-cmd-cfind.cc',
|
||||
install: false,
|
||||
dependencies: [glib_dep, lib_test_mu_common_dep, config_h_dep, lib_mu_dep]))
|
||||
dependencies: [glib_dep, config_h_dep, lib_mu_dep]))
|
||||
test('test-cmd-query',
|
||||
executable('test-cmd-query',
|
||||
'test-mu-query.cc',
|
||||
install: false,
|
||||
dependencies: [glib_dep, lib_test_mu_common_dep, config_h_dep, lib_mu_dep]))
|
||||
dependencies: [glib_dep, config_h_dep, lib_mu_dep]))
|
||||
|
||||
gmime_test = executable(
|
||||
'gmime-test', [
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "test-mu-common.hh"
|
||||
#include "utils/mu-test-utils.hh"
|
||||
#include "mu-store.hh"
|
||||
#include "mu-query.hh"
|
||||
#include "utils/mu-utils.hh"
|
||||
@ -325,7 +325,7 @@ test_mu_cfind_csv(void)
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
g_test_init(&argc, &argv, NULL);
|
||||
mu_test_init(&argc, &argv);
|
||||
|
||||
if (!set_en_us_utf8_locale())
|
||||
return 0; /* don't error out... */
|
||||
@ -341,11 +341,5 @@ main(int argc, char* argv[])
|
||||
g_test_add_func("/mu-cmd-cfind/test-mu-cfind-org-contact", test_mu_cfind_org_contact);
|
||||
g_test_add_func("/mu-cmd-cfind/test-mu-cfind-csv", test_mu_cfind_csv);
|
||||
|
||||
g_log_set_handler(NULL,
|
||||
(GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_LEVEL_WARNING |
|
||||
G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION),
|
||||
(GLogFunc)black_hole,
|
||||
NULL);
|
||||
|
||||
return g_test_run();
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "test-mu-common.hh"
|
||||
#include "utils/mu-test-utils.hh"
|
||||
#include "mu-store.hh"
|
||||
#include "mu-query.hh"
|
||||
#include "utils/mu-result.hh"
|
||||
@ -829,8 +829,7 @@ main(int argc, char* argv[])
|
||||
if (!g_getenv("RUN_TEST_MU_CMD"))
|
||||
return 0;
|
||||
|
||||
|
||||
g_test_init(&argc, &argv, NULL);
|
||||
mu_test_init(&argc, &argv);
|
||||
|
||||
if (!set_en_us_utf8_locale())
|
||||
return 0; /* don't error out... */
|
||||
@ -870,12 +869,6 @@ main(int argc, char* argv[])
|
||||
g_test_add_func("/mu-cmd/test-mu-verify-good", test_mu_verify_good);
|
||||
g_test_add_func("/mu-cmd/test-mu-verify-bad", test_mu_verify_bad);
|
||||
|
||||
g_log_set_handler(NULL,
|
||||
(GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_LEVEL_WARNING |
|
||||
G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION),
|
||||
(GLogFunc)black_hole,
|
||||
NULL);
|
||||
|
||||
TempDir tempdir;
|
||||
DBPATH = tempdir.path();
|
||||
fill_database();
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include "test-mu-common.hh"
|
||||
#include "utils/mu-test-utils.hh"
|
||||
#include "mu-query.hh"
|
||||
#include "utils/mu-result.hh"
|
||||
#include "utils/mu-utils.hh"
|
||||
@ -625,7 +625,7 @@ main(int argc, char* argv[])
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
g_test_init(&argc, &argv, nullptr);
|
||||
mu_test_init(&argc, &argv);
|
||||
DB_PATH1 = make_database(MU_TESTMAILDIR);
|
||||
g_assert_false(DB_PATH1.empty());
|
||||
|
||||
@ -668,13 +668,6 @@ main(int argc, char* argv[])
|
||||
|
||||
g_test_add_func("/mu-query/test-mu-query-cjk",
|
||||
test_mu_query_cjk);
|
||||
|
||||
if (!g_test_verbose())
|
||||
g_log_set_handler(NULL,
|
||||
(GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
|
||||
G_LOG_LEVEL_WARNING | G_LOG_FLAG_RECURSION),
|
||||
(GLogFunc)black_hole,
|
||||
NULL);
|
||||
rv = g_test_run();
|
||||
|
||||
return rv;
|
||||
|
||||
Reference in New Issue
Block a user