nmtst: initialize g_test_init() after parsing NMTST_DEBUG

This commit is contained in:
Thomas Haller 2015-11-23 17:40:44 +01:00
parent 9b1d195600
commit 5031fc3c71

View file

@ -286,17 +286,6 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
if (argc)
__nmtst_internal.orig_argv = g_strdupv (*argv);
if (argc && !g_test_initialized ()) {
/* g_test_init() is a variadic function, so we cannot pass it
* (variadic) arguments. If you need to pass additional parameters,
* call nmtst_init() with argc==NULL and call g_test_init() yourself. */
/* g_test_init() sets g_log_set_always_fatal() for G_LOG_LEVEL_WARNING
* and G_LOG_LEVEL_CRITICAL. So, beware that the test will fail if you
* have any WARN or ERR log messages -- unless you g_test_expect_message(). */
g_test_init (argc, argv, NULL);
}
__nmtst_internal.assert_logging = !!assert_logging;
nm_g_type_init ();
@ -370,6 +359,17 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_
}
}
if (argc && !g_test_initialized ()) {
/* g_test_init() is a variadic function, so we cannot pass it
* (variadic) arguments. If you need to pass additional parameters,
* call nmtst_init() with argc==NULL and call g_test_init() yourself. */
/* g_test_init() sets g_log_set_always_fatal() for G_LOG_LEVEL_WARNING
* and G_LOG_LEVEL_CRITICAL. So, beware that the test will fail if you
* have any WARN or ERR log messages -- unless you g_test_expect_message(). */
g_test_init (argc, argv, NULL);
}
if (test_quick_set)
__nmtst_internal.test_quick = test_quick;
else if (test_quick_argv)