1 /* GLib testing framework examples and tests
2 * Copyright (C) 2007 Imendio AB
5 * This work is provided "as is"; redistribution and modification
6 * in whole or in part, in any medium, physical or electronic is
7 * permitted without restriction.
9 * This work is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * In no event shall the authors or contributors be liable for any
14 * direct, indirect, incidental, special, exemplary, or consequential
15 * damages (including, but not limited to, procurement of substitute
16 * goods or services; loss of use, data, or profits; or business
17 * interruption) however caused and on any theory of liability, whether
18 * in contract, strict liability, or tort (including negligence or
19 * otherwise) arising in any way out of the use of this software, even
20 * if advised of the possibility of such damage.
23 /* We want to distinguish between messages originating from libglib
24 * and messages originating from this program.
27 #define G_LOG_DOMAIN "testing"
34 /* test assertion variants */
36 test_assertions_bad_cmpstr (void)
38 g_assert_cmpstr ("fzz", !=, "fzz");
43 test_assertions_bad_cmpint (void)
45 g_assert_cmpint (4, !=, 4);
50 test_assertions (void)
53 g_assert_cmpint (1, >, 0);
54 g_assert_cmphex (2, ==, 2);
55 g_assert_cmpfloat (3.3, !=, 7);
56 g_assert_cmpfloat (7, <=, 3 + 4);
58 g_assert_cmpstr ("foo", !=, "faa");
59 fuu = g_strdup_printf ("f%s", "uu");
60 g_test_queue_free (fuu);
61 g_assert_cmpstr ("foo", !=, fuu);
62 g_assert_cmpstr ("fuu", ==, fuu);
63 g_assert_cmpstr (NULL, <, "");
64 g_assert_cmpstr (NULL, ==, NULL);
65 g_assert_cmpstr ("", >, NULL);
66 g_assert_cmpstr ("foo", <, "fzz");
67 g_assert_cmpstr ("fzz", >, "faa");
68 g_assert_cmpstr ("fzz", ==, "fzz");
70 g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstr", 0, 0);
71 g_test_trap_assert_failed ();
72 g_test_trap_assert_stderr ("*assertion failed*");
74 g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpint", 0, 0);
75 g_test_trap_assert_failed ();
76 g_test_trap_assert_stderr ("*assertion failed*");
79 /* test g_test_timer* API */
85 g_assert_cmpfloat (g_test_timer_last(), ==, 0);
87 ttime = g_test_timer_elapsed();
88 g_assert_cmpfloat (ttime, >, 0);
89 g_assert_cmpfloat (g_test_timer_last(), ==, ttime);
90 g_test_minimized_result (ttime, "timer-test-time: %fsec", ttime);
91 g_test_maximized_result (5, "bogus-quantity: %ddummies", 5); /* simple API test */
95 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
97 /* fork out for a failing test */
101 if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
103 g_assert_not_reached();
105 g_test_trap_assert_failed();
106 g_test_trap_assert_stderr ("*ERROR*test_fork_fail*should not be reached*");
109 /* fork out to assert stdout and stderr patterns */
111 test_fork_patterns (void)
113 if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
115 g_print ("some stdout text: somagic17\n");
116 g_printerr ("some stderr text: semagic43\n");
119 g_test_trap_assert_passed();
120 g_test_trap_assert_stdout ("*somagic17*");
121 g_test_trap_assert_stderr ("*semagic43*");
124 /* fork out for a timeout test */
126 test_fork_timeout (void)
128 /* allow child to run for only a fraction of a second */
129 if (g_test_trap_fork (0.11 * 1000000, 0))
131 /* loop and sleep forever */
133 g_usleep (1000 * 1000);
135 g_test_trap_assert_failed();
136 g_assert (g_test_trap_reached_timeout());
139 G_GNUC_END_IGNORE_DEPRECATIONS
140 #endif /* G_OS_UNIX */
143 test_subprocess_fail (void)
145 if (g_test_subprocess ())
147 g_assert_not_reached ();
151 g_test_trap_subprocess (NULL, 0, 0);
152 g_test_trap_assert_failed ();
153 g_test_trap_assert_stderr ("*ERROR*test_subprocess_fail*should not be reached*");
157 test_subprocess_no_such_test (void)
159 if (g_test_subprocess ())
161 g_test_trap_subprocess ("/trap_subprocess/this-test-does-not-exist", 0, 0);
162 g_assert_not_reached ();
165 g_test_trap_subprocess (NULL, 0, 0);
166 g_test_trap_assert_failed ();
167 g_test_trap_assert_stderr ("*test does not exist*");
168 g_test_trap_assert_stderr_unmatched ("*should not be reached*");
172 test_subprocess_patterns (void)
174 if (g_test_subprocess ())
176 g_print ("some stdout text: somagic17\n");
177 g_printerr ("some stderr text: semagic43\n");
180 g_test_trap_subprocess (NULL, 0, 0);
181 g_test_trap_assert_passed ();
182 g_test_trap_assert_stdout ("*somagic17*");
183 g_test_trap_assert_stderr ("*semagic43*");
187 test_subprocess_timeout (void)
189 if (g_test_subprocess ())
191 /* loop and sleep forever */
193 g_usleep (1000 * 1000);
196 /* allow child to run for only a fraction of a second */
197 g_test_trap_subprocess (NULL, 0.11 * 1000000, 0);
198 g_test_trap_assert_failed ();
199 g_assert (g_test_trap_reached_timeout ());
202 /* run a test with fixture setup and teardown */
209 fixturetest_setup (Fixturetest *fix,
210 gconstpointer test_data)
212 g_assert (test_data == (void*) 0xc0cac01a);
215 fix->msg = g_strdup_printf ("%d", fix->prime);
218 fixturetest_test (Fixturetest *fix,
219 gconstpointer test_data)
221 guint prime = g_spaced_primes_closest (fix->seed);
222 g_assert_cmpint (prime, ==, fix->prime);
223 prime = g_ascii_strtoull (fix->msg, NULL, 0);
224 g_assert_cmpint (prime, ==, fix->prime);
225 g_assert (test_data == (void*) 0xc0cac01a);
228 fixturetest_teardown (Fixturetest *fix,
229 gconstpointer test_data)
231 g_assert (test_data == (void*) 0xc0cac01a);
236 int bit, vint1, vint2, irange;
237 long double vdouble, drange;
243 shared_rand_state.bit = g_test_rand_bit();
244 shared_rand_state.vint1 = g_test_rand_int();
245 shared_rand_state.vint2 = g_test_rand_int();
246 g_assert_cmpint (shared_rand_state.vint1, !=, shared_rand_state.vint2);
247 shared_rand_state.irange = g_test_rand_int_range (17, 35);
248 g_assert_cmpint (shared_rand_state.irange, >=, 17);
249 g_assert_cmpint (shared_rand_state.irange, <=, 35);
250 shared_rand_state.vdouble = g_test_rand_double();
251 shared_rand_state.drange = g_test_rand_double_range (-999, +17);
252 g_assert_cmpfloat (shared_rand_state.drange, >=, -999);
253 g_assert_cmpfloat (shared_rand_state.drange, <=, +17);
259 /* this test only works if run after test1.
260 * we do this to check that random number generators
261 * are reseeded upon fixture setup.
263 g_assert_cmpint (shared_rand_state.bit, ==, g_test_rand_bit());
264 g_assert_cmpint (shared_rand_state.vint1, ==, g_test_rand_int());
265 g_assert_cmpint (shared_rand_state.vint2, ==, g_test_rand_int());
266 g_assert_cmpint (shared_rand_state.irange, ==, g_test_rand_int_range (17, 35));
267 g_assert_cmpfloat (shared_rand_state.vdouble, ==, g_test_rand_double());
268 g_assert_cmpfloat (shared_rand_state.drange, ==, g_test_rand_double_range (-999, +17));
272 test_data_test (gconstpointer test_data)
274 g_assert (test_data == (void*) 0xc0c0baba);
278 test_random_conversions (void)
280 /* very simple conversion test using random numbers */
281 int vint = g_test_rand_int();
282 char *err, *str = g_strdup_printf ("%d", vint);
283 gint64 vint64 = g_ascii_strtoll (str, &err, 10);
284 g_assert_cmphex (vint, ==, vint64);
285 g_assert (!err || *err == 0);
290 fatal_handler (const gchar *log_domain,
291 GLogLevelFlags log_level,
292 const gchar *message,
299 test_fatal_log_handler_critical_pass (void)
301 g_test_log_set_fatal_handler (fatal_handler, NULL);
302 g_str_has_prefix (NULL, "file://");
303 g_critical ("Test passing");
308 test_fatal_log_handler_error_fail (void)
310 g_error ("Test failing");
315 test_fatal_log_handler_critical_fail (void)
317 g_str_has_prefix (NULL, "file://");
318 g_critical ("Test passing");
323 test_fatal_log_handler (void)
325 g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-pass", 0, 0);
326 g_test_trap_assert_passed ();
327 g_test_trap_assert_stderr ("*CRITICAL*g_str_has_prefix*");
328 g_test_trap_assert_stderr ("*CRITICAL*Test passing*");
330 g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/error-fail", 0, 0);
331 g_test_trap_assert_failed ();
332 g_test_trap_assert_stderr ("*ERROR*Test failing*");
334 g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-fail", 0, 0);
335 g_test_trap_assert_failed ();
336 g_test_trap_assert_stderr ("*CRITICAL*g_str_has_prefix*");
337 g_test_trap_assert_stderr_unmatched ("*CRITICAL*Test passing*");
341 test_expected_messages_warning (void)
343 g_warning ("This is a %d warning", g_random_int ());
344 g_return_if_reached ();
348 test_expected_messages_expect_warning (void)
350 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
351 "This is a * warning");
352 test_expected_messages_warning ();
356 test_expected_messages_wrong_warning (void)
358 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
360 test_expected_messages_warning ();
364 test_expected_messages_expected (void)
366 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
367 "This is a * warning");
368 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
369 "*should not be reached");
371 test_expected_messages_warning ();
373 g_test_assert_expected_messages ();
378 test_expected_messages_null_domain (void)
380 g_test_expect_message (NULL, G_LOG_LEVEL_WARNING, "no domain");
381 g_log (NULL, G_LOG_LEVEL_WARNING, "no domain");
382 g_test_assert_expected_messages ();
386 test_expected_messages_expect_error (void)
388 /* make sure we can't try to expect a g_error() */
389 g_test_expect_message ("GLib", G_LOG_LEVEL_CRITICAL, "*G_LOG_LEVEL_ERROR*");
390 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "this won't work");
391 g_test_assert_expected_messages ();
395 test_expected_messages_extra_warning (void)
397 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
398 "This is a * warning");
399 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
400 "*should not be reached");
401 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
404 test_expected_messages_warning ();
406 /* If we don't assert, it won't notice the missing message */
411 test_expected_messages_unexpected_extra_warning (void)
413 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
414 "This is a * warning");
415 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
416 "*should not be reached");
417 g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
420 test_expected_messages_warning ();
422 g_test_assert_expected_messages ();
427 test_expected_messages (void)
429 g_test_trap_subprocess ("/misc/expected-messages/subprocess/warning", 0, 0);
430 g_test_trap_assert_failed ();
431 g_test_trap_assert_stderr ("*This is a * warning*");
432 g_test_trap_assert_stderr_unmatched ("*should not be reached*");
434 g_test_trap_subprocess ("/misc/expected-messages/subprocess/expect-warning", 0, 0);
435 g_test_trap_assert_failed ();
436 g_test_trap_assert_stderr_unmatched ("*This is a * warning*");
437 g_test_trap_assert_stderr ("*should not be reached*");
439 g_test_trap_subprocess ("/misc/expected-messages/subprocess/wrong-warning", 0, 0);
440 g_test_trap_assert_failed ();
441 g_test_trap_assert_stderr_unmatched ("*should not be reached*");
442 g_test_trap_assert_stderr ("*GLib-CRITICAL*Did not see expected message testing-CRITICAL*should not be *WARNING*This is a * warning*");
444 g_test_trap_subprocess ("/misc/expected-messages/subprocess/expected", 0, 0);
445 g_test_trap_assert_passed ();
446 g_test_trap_assert_stderr ("");
448 g_test_trap_subprocess ("/misc/expected-messages/subprocess/null-domain", 0, 0);
449 g_test_trap_assert_passed ();
450 g_test_trap_assert_stderr ("");
452 g_test_trap_subprocess ("/misc/expected-messages/subprocess/extra-warning", 0, 0);
453 g_test_trap_assert_passed ();
454 g_test_trap_assert_stderr ("");
456 g_test_trap_subprocess ("/misc/expected-messages/subprocess/unexpected-extra-warning", 0, 0);
457 g_test_trap_assert_failed ();
458 g_test_trap_assert_stderr ("*GLib:ERROR*Did not see expected message testing-CRITICAL*nope*");
462 test_expected_messages_debug (void)
464 g_test_expect_message ("Test", G_LOG_LEVEL_WARNING, "warning message");
465 g_log ("Test", G_LOG_LEVEL_DEBUG, "should be ignored");
466 g_log ("Test", G_LOG_LEVEL_WARNING, "warning message");
467 g_test_assert_expected_messages ();
469 g_test_expect_message ("Test", G_LOG_LEVEL_DEBUG, "debug message");
470 g_log ("Test", G_LOG_LEVEL_DEBUG, "debug message");
471 g_test_assert_expected_messages ();
475 test_dash_p_hidden (void)
477 if (!g_test_subprocess ())
478 g_assert_not_reached ();
480 g_print ("Test /misc/dash-p/subprocess/hidden ran\n");
484 test_dash_p_hidden_sub (void)
486 if (!g_test_subprocess ())
487 g_assert_not_reached ();
489 g_print ("Test /misc/dash-p/subprocess/hidden/sub ran\n");
492 /* The rest of the dash_p tests will get run by the toplevel test
493 * process, but they shouldn't do anything there.
497 test_dash_p_child (void)
499 if (!g_test_subprocess ())
502 g_print ("Test /misc/dash-p/child ran\n");
506 test_dash_p_child_sub (void)
508 if (!g_test_subprocess ())
511 g_print ("Test /misc/dash-p/child/sub ran\n");
515 test_dash_p_child_sub2 (void)
517 if (!g_test_subprocess ())
520 g_print ("Test /misc/dash-p/child/sub2 ran\n");
524 test_dash_p_child_sub_child (void)
526 if (!g_test_subprocess ())
529 g_print ("Test /misc/dash-p/child/subprocess ran\n");
535 g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden", 0, 0);
536 g_test_trap_assert_passed ();
537 g_test_trap_assert_stdout ("*Test /misc/dash-p/subprocess/hidden ran*");
538 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub ran*");
539 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub2 ran*");
540 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub/subprocess ran*");
541 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child*");
543 g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden/sub", 0, 0);
544 g_test_trap_assert_passed ();
545 g_test_trap_assert_stdout ("*Test /misc/dash-p/subprocess/hidden/sub ran*");
546 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden ran*");
547 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub2 ran*");
548 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/subprocess ran*");
549 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child*");
551 g_test_trap_subprocess ("/misc/dash-p/child", 0, 0);
552 g_test_trap_assert_passed ();
553 g_test_trap_assert_stdout ("*Test /misc/dash-p/child ran*");
554 g_test_trap_assert_stdout ("*Test /misc/dash-p/child/sub ran*");
555 g_test_trap_assert_stdout ("*Test /misc/dash-p/child/sub2 ran*");
556 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child/subprocess ran*");
557 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden*");
559 g_test_trap_subprocess ("/misc/dash-p/child/sub", 0, 0);
560 g_test_trap_assert_passed ();
561 g_test_trap_assert_stdout ("*Test /misc/dash-p/child/sub ran*");
562 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child ran*");
563 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child/sub2 ran*");
564 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child/subprocess ran*");
565 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden*");
571 if (g_test_subprocess ())
573 g_test_set_nonfatal_assertions ();
574 g_assert_cmpint (4, ==, 5);
575 g_print ("The End\n");
578 g_test_trap_subprocess (NULL, 0, 0);
579 g_test_trap_assert_failed ();
580 g_test_trap_assert_stderr ("*assertion failed*4 == 5*");
581 g_test_trap_assert_stdout ("*The End*");
587 g_test_skip ("Skipped should count as passed, not failed");
598 if (g_test_subprocess ())
601 g_assert (g_test_failed ());
604 g_test_trap_subprocess (NULL, 0, 0);
605 g_test_trap_assert_failed ();
609 test_incomplete (void)
611 if (g_test_subprocess ())
613 g_test_incomplete ("not done");
614 g_assert (g_test_failed ());
617 g_test_trap_subprocess (NULL, 0, 0);
618 g_test_trap_assert_failed ();
622 test_subprocess_timed_out (void)
624 if (g_test_subprocess ())
629 g_test_trap_subprocess (NULL, 50000, 0);
630 g_assert (g_test_trap_reached_timeout ());
633 static const char *argv0;
639 GError *error = NULL;
642 argv = g_ptr_array_new ();
643 g_ptr_array_add (argv, (char *) argv0);
644 g_ptr_array_add (argv, "--GTestSubprocess");
645 g_ptr_array_add (argv, "-p");
646 g_ptr_array_add (argv, "/misc/skip");
647 g_ptr_array_add (argv, NULL);
649 g_spawn_sync (NULL, (char **) argv->pdata, NULL,
650 G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
651 NULL, NULL, NULL, NULL, &status,
653 g_assert_no_error (error);
655 g_spawn_check_exit_status (status, &error);
656 g_assert_error (error, G_SPAWN_EXIT_ERROR, 77);
657 g_clear_error (&error);
659 g_ptr_array_set_size (argv, 0);
660 g_ptr_array_add (argv, (char *) argv0);
661 g_ptr_array_add (argv, "--GTestSubprocess");
662 g_ptr_array_add (argv, "-p");
663 g_ptr_array_add (argv, "/misc/skip");
664 g_ptr_array_add (argv, "-p");
665 g_ptr_array_add (argv, "/misc/skip-all/subprocess/skip1");
666 g_ptr_array_add (argv, "-p");
667 g_ptr_array_add (argv, "/misc/skip-all/subprocess/skip2");
668 g_ptr_array_add (argv, NULL);
670 g_spawn_sync (NULL, (char **) argv->pdata, NULL,
671 G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
672 NULL, NULL, NULL, NULL, &status,
674 g_assert_no_error (error);
676 g_spawn_check_exit_status (status, &error);
677 g_assert_error (error, G_SPAWN_EXIT_ERROR, 77);
678 g_clear_error (&error);
680 g_ptr_array_set_size (argv, 0);
681 g_ptr_array_add (argv, (char *) argv0);
682 g_ptr_array_add (argv, "--GTestSubprocess");
683 g_ptr_array_add (argv, "-p");
684 g_ptr_array_add (argv, "/misc/skip");
685 g_ptr_array_add (argv, "-p");
686 g_ptr_array_add (argv, "/misc/skip-all/subprocess/pass");
687 g_ptr_array_add (argv, "-p");
688 g_ptr_array_add (argv, "/misc/skip-all/subprocess/skip1");
689 g_ptr_array_add (argv, NULL);
691 g_spawn_sync (NULL, (char **) argv->pdata, NULL,
692 G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
693 NULL, NULL, NULL, NULL, &status,
695 g_assert_no_error (error);
697 g_spawn_check_exit_status (status, &error);
698 g_assert_no_error (error);
700 g_ptr_array_unref (argv);
709 g_test_init (&argc, &argv, NULL);
711 g_test_add_func ("/random-generator/rand-1", test_rand1);
712 g_test_add_func ("/random-generator/rand-2", test_rand2);
713 g_test_add_func ("/random-generator/random-conversions", test_random_conversions);
714 g_test_add_func ("/misc/assertions", test_assertions);
715 g_test_add_func ("/misc/assertions/subprocess/bad_cmpstr", test_assertions_bad_cmpstr);
716 g_test_add_func ("/misc/assertions/subprocess/bad_cmpint", test_assertions_bad_cmpint);
717 g_test_add_data_func ("/misc/test-data", (void*) 0xc0c0baba, test_data_test);
718 g_test_add ("/misc/primetoul", Fixturetest, (void*) 0xc0cac01a, fixturetest_setup, fixturetest_test, fixturetest_teardown);
720 g_test_add_func ("/misc/timer", test_timer);
723 g_test_add_func ("/forking/fail assertion", test_fork_fail);
724 g_test_add_func ("/forking/patterns", test_fork_patterns);
726 g_test_add_func ("/forking/timeout", test_fork_timeout);
729 g_test_add_func ("/trap_subprocess/fail", test_subprocess_fail);
730 g_test_add_func ("/trap_subprocess/no-such-test", test_subprocess_no_such_test);
732 g_test_add_func ("/trap_subprocess/timeout", test_subprocess_timeout);
734 g_test_add_func ("/trap_subprocess/patterns", test_subprocess_patterns);
736 g_test_add_func ("/misc/fatal-log-handler", test_fatal_log_handler);
737 g_test_add_func ("/misc/fatal-log-handler/subprocess/critical-pass", test_fatal_log_handler_critical_pass);
738 g_test_add_func ("/misc/fatal-log-handler/subprocess/error-fail", test_fatal_log_handler_error_fail);
739 g_test_add_func ("/misc/fatal-log-handler/subprocess/critical-fail", test_fatal_log_handler_critical_fail);
741 g_test_add_func ("/misc/expected-messages", test_expected_messages);
742 g_test_add_func ("/misc/expected-messages/subprocess/warning", test_expected_messages_warning);
743 g_test_add_func ("/misc/expected-messages/subprocess/expect-warning", test_expected_messages_expect_warning);
744 g_test_add_func ("/misc/expected-messages/subprocess/wrong-warning", test_expected_messages_wrong_warning);
745 g_test_add_func ("/misc/expected-messages/subprocess/expected", test_expected_messages_expected);
746 g_test_add_func ("/misc/expected-messages/subprocess/null-domain", test_expected_messages_null_domain);
747 g_test_add_func ("/misc/expected-messages/subprocess/extra-warning", test_expected_messages_extra_warning);
748 g_test_add_func ("/misc/expected-messages/subprocess/unexpected-extra-warning", test_expected_messages_unexpected_extra_warning);
749 g_test_add_func ("/misc/expected-messages/expect-error", test_expected_messages_expect_error);
750 g_test_add_func ("/misc/expected-messages/skip-debug", test_expected_messages_debug);
752 g_test_add_func ("/misc/dash-p", test_dash_p);
753 g_test_add_func ("/misc/dash-p/child", test_dash_p_child);
754 g_test_add_func ("/misc/dash-p/child/sub", test_dash_p_child_sub);
755 g_test_add_func ("/misc/dash-p/child/sub/subprocess", test_dash_p_child_sub_child);
756 g_test_add_func ("/misc/dash-p/child/sub/subprocess/child", test_dash_p_child_sub_child);
757 g_test_add_func ("/misc/dash-p/child/sub2", test_dash_p_child_sub2);
758 g_test_add_func ("/misc/dash-p/subprocess/hidden", test_dash_p_hidden);
759 g_test_add_func ("/misc/dash-p/subprocess/hidden/sub", test_dash_p_hidden_sub);
761 g_test_add_func ("/misc/nonfatal", test_nonfatal);
763 g_test_add_func ("/misc/skip", test_skip);
764 g_test_add_func ("/misc/skip-all", test_skip_all);
765 g_test_add_func ("/misc/skip-all/subprocess/skip1", test_skip);
766 g_test_add_func ("/misc/skip-all/subprocess/skip2", test_skip);
767 g_test_add_func ("/misc/skip-all/subprocess/pass", test_pass);
768 g_test_add_func ("/misc/fail", test_fail);
769 g_test_add_func ("/misc/incomplete", test_incomplete);
770 g_test_add_func ("/misc/timeout", test_subprocess_timed_out);