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_bad_cmpmem_len (void)
52 g_assert_cmpmem ("foo", 3, "foot", 4);
57 test_assertions_bad_cmpmem_data (void)
59 g_assert_cmpmem ("foo", 3, "fzz", 3);
64 test_assertions (void)
67 g_assert_cmpint (1, >, 0);
68 g_assert_cmphex (2, ==, 2);
69 g_assert_cmpfloat (3.3, !=, 7);
70 g_assert_cmpfloat (7, <=, 3 + 4);
72 g_assert_cmpstr ("foo", !=, "faa");
73 fuu
= g_strdup_printf ("f%s", "uu");
74 g_test_queue_free (fuu
);
75 g_assert_cmpstr ("foo", !=, fuu
);
76 g_assert_cmpstr ("fuu", ==, fuu
);
77 g_assert_cmpstr (NULL
, <, "");
78 g_assert_cmpstr (NULL
, ==, NULL
);
79 g_assert_cmpstr ("", >, NULL
);
80 g_assert_cmpstr ("foo", <, "fzz");
81 g_assert_cmpstr ("fzz", >, "faa");
82 g_assert_cmpstr ("fzz", ==, "fzz");
83 g_assert_cmpmem ("foo", 3, "foot", 3);
85 g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpstr", 0, 0);
86 g_test_trap_assert_failed ();
87 g_test_trap_assert_stderr ("*assertion failed*");
89 g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpint", 0, 0);
90 g_test_trap_assert_failed ();
91 g_test_trap_assert_stderr ("*assertion failed*");
93 g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_len", 0, 0);
94 g_test_trap_assert_failed ();
95 g_test_trap_assert_stderr ("*assertion failed*len*");
97 g_test_trap_subprocess ("/misc/assertions/subprocess/bad_cmpmem_data", 0, 0);
98 g_test_trap_assert_failed ();
99 g_test_trap_assert_stderr ("*assertion failed*");
100 g_test_trap_assert_stderr_unmatched ("*assertion failed*len*");
103 /* test g_test_timer* API */
108 g_test_timer_start();
109 g_assert_cmpfloat (g_test_timer_last(), ==, 0);
110 g_usleep (25 * 1000);
111 ttime
= g_test_timer_elapsed();
112 g_assert_cmpfloat (ttime
, >, 0);
113 g_assert_cmpfloat (g_test_timer_last(), ==, ttime
);
114 g_test_minimized_result (ttime
, "timer-test-time: %fsec", ttime
);
115 g_test_maximized_result (5, "bogus-quantity: %ddummies", 5); /* simple API test */
119 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
121 /* fork out for a failing test */
123 test_fork_fail (void)
125 if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR
))
127 g_assert_not_reached();
129 g_test_trap_assert_failed();
130 g_test_trap_assert_stderr ("*ERROR*test_fork_fail*should not be reached*");
133 /* fork out to assert stdout and stderr patterns */
135 test_fork_patterns (void)
137 if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT
| G_TEST_TRAP_SILENCE_STDERR
))
139 g_print ("some stdout text: somagic17\n");
140 g_printerr ("some stderr text: semagic43\n");
143 g_test_trap_assert_passed();
144 g_test_trap_assert_stdout ("*somagic17*");
145 g_test_trap_assert_stderr ("*semagic43*");
148 /* fork out for a timeout test */
150 test_fork_timeout (void)
152 /* allow child to run for only a fraction of a second */
153 if (g_test_trap_fork (0.11 * 1000000, 0))
155 /* loop and sleep forever */
157 g_usleep (1000 * 1000);
159 g_test_trap_assert_failed();
160 g_assert (g_test_trap_reached_timeout());
163 G_GNUC_END_IGNORE_DEPRECATIONS
164 #endif /* G_OS_UNIX */
167 test_subprocess_fail (void)
169 if (g_test_subprocess ())
171 g_assert_not_reached ();
175 g_test_trap_subprocess (NULL
, 0, 0);
176 g_test_trap_assert_failed ();
177 g_test_trap_assert_stderr ("*ERROR*test_subprocess_fail*should not be reached*");
181 test_subprocess_no_such_test (void)
183 if (g_test_subprocess ())
185 g_test_trap_subprocess ("/trap_subprocess/this-test-does-not-exist", 0, 0);
186 g_assert_not_reached ();
189 g_test_trap_subprocess (NULL
, 0, 0);
190 g_test_trap_assert_failed ();
191 g_test_trap_assert_stderr ("*test does not exist*");
192 g_test_trap_assert_stderr_unmatched ("*should not be reached*");
196 test_subprocess_patterns (void)
198 if (g_test_subprocess ())
200 g_print ("some stdout text: somagic17\n");
201 g_printerr ("some stderr text: semagic43\n");
204 g_test_trap_subprocess (NULL
, 0, 0);
205 g_test_trap_assert_passed ();
206 g_test_trap_assert_stdout ("*somagic17*");
207 g_test_trap_assert_stderr ("*semagic43*");
211 test_subprocess_timeout (void)
213 if (g_test_subprocess ())
215 /* loop and sleep forever */
217 g_usleep (1000 * 1000);
220 /* allow child to run for only a fraction of a second */
221 g_test_trap_subprocess (NULL
, 0.11 * 1000000, 0);
222 g_test_trap_assert_failed ();
223 g_assert (g_test_trap_reached_timeout ());
226 /* run a test with fixture setup and teardown */
233 fixturetest_setup (Fixturetest
*fix
,
234 gconstpointer test_data
)
236 g_assert (test_data
== (void*) 0xc0cac01a);
239 fix
->msg
= g_strdup_printf ("%d", fix
->prime
);
242 fixturetest_test (Fixturetest
*fix
,
243 gconstpointer test_data
)
245 guint prime
= g_spaced_primes_closest (fix
->seed
);
246 g_assert_cmpint (prime
, ==, fix
->prime
);
247 prime
= g_ascii_strtoull (fix
->msg
, NULL
, 0);
248 g_assert_cmpint (prime
, ==, fix
->prime
);
249 g_assert (test_data
== (void*) 0xc0cac01a);
252 fixturetest_teardown (Fixturetest
*fix
,
253 gconstpointer test_data
)
255 g_assert (test_data
== (void*) 0xc0cac01a);
260 int bit
, vint1
, vint2
, irange
;
261 long double vdouble
, drange
;
267 shared_rand_state
.bit
= g_test_rand_bit();
268 shared_rand_state
.vint1
= g_test_rand_int();
269 shared_rand_state
.vint2
= g_test_rand_int();
270 g_assert_cmpint (shared_rand_state
.vint1
, !=, shared_rand_state
.vint2
);
271 shared_rand_state
.irange
= g_test_rand_int_range (17, 35);
272 g_assert_cmpint (shared_rand_state
.irange
, >=, 17);
273 g_assert_cmpint (shared_rand_state
.irange
, <=, 35);
274 shared_rand_state
.vdouble
= g_test_rand_double();
275 shared_rand_state
.drange
= g_test_rand_double_range (-999, +17);
276 g_assert_cmpfloat (shared_rand_state
.drange
, >=, -999);
277 g_assert_cmpfloat (shared_rand_state
.drange
, <=, +17);
283 /* this test only works if run after test1.
284 * we do this to check that random number generators
285 * are reseeded upon fixture setup.
287 g_assert_cmpint (shared_rand_state
.bit
, ==, g_test_rand_bit());
288 g_assert_cmpint (shared_rand_state
.vint1
, ==, g_test_rand_int());
289 g_assert_cmpint (shared_rand_state
.vint2
, ==, g_test_rand_int());
290 g_assert_cmpint (shared_rand_state
.irange
, ==, g_test_rand_int_range (17, 35));
291 g_assert_cmpfloat (shared_rand_state
.vdouble
, ==, g_test_rand_double());
292 g_assert_cmpfloat (shared_rand_state
.drange
, ==, g_test_rand_double_range (-999, +17));
296 test_data_test (gconstpointer test_data
)
298 g_assert (test_data
== (void*) 0xc0c0baba);
302 test_random_conversions (void)
304 /* very simple conversion test using random numbers */
305 int vint
= g_test_rand_int();
306 char *err
, *str
= g_strdup_printf ("%d", vint
);
307 gint64 vint64
= g_ascii_strtoll (str
, &err
, 10);
308 g_assert_cmphex (vint
, ==, vint64
);
309 g_assert (!err
|| *err
== 0);
314 fatal_handler (const gchar
*log_domain
,
315 GLogLevelFlags log_level
,
316 const gchar
*message
,
323 test_fatal_log_handler_critical_pass (void)
325 g_test_log_set_fatal_handler (fatal_handler
, NULL
);
326 g_str_has_prefix (NULL
, "file://");
327 g_critical ("Test passing");
332 test_fatal_log_handler_error_fail (void)
334 g_error ("Test failing");
339 test_fatal_log_handler_critical_fail (void)
341 g_str_has_prefix (NULL
, "file://");
342 g_critical ("Test passing");
347 test_fatal_log_handler (void)
349 g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-pass", 0, 0);
350 g_test_trap_assert_passed ();
351 g_test_trap_assert_stderr ("*CRITICAL*g_str_has_prefix*");
352 g_test_trap_assert_stderr ("*CRITICAL*Test passing*");
354 g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/error-fail", 0, 0);
355 g_test_trap_assert_failed ();
356 g_test_trap_assert_stderr ("*ERROR*Test failing*");
358 g_test_trap_subprocess ("/misc/fatal-log-handler/subprocess/critical-fail", 0, 0);
359 g_test_trap_assert_failed ();
360 g_test_trap_assert_stderr ("*CRITICAL*g_str_has_prefix*");
361 g_test_trap_assert_stderr_unmatched ("*CRITICAL*Test passing*");
365 test_expected_messages_warning (void)
367 g_warning ("This is a %d warning", g_random_int ());
368 g_return_if_reached ();
372 test_expected_messages_expect_warning (void)
374 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_WARNING
,
375 "This is a * warning");
376 test_expected_messages_warning ();
380 test_expected_messages_wrong_warning (void)
382 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_CRITICAL
,
384 test_expected_messages_warning ();
388 test_expected_messages_expected (void)
390 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_WARNING
,
391 "This is a * warning");
392 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_CRITICAL
,
393 "*should not be reached");
395 test_expected_messages_warning ();
397 g_test_assert_expected_messages ();
402 test_expected_messages_null_domain (void)
404 g_test_expect_message (NULL
, G_LOG_LEVEL_WARNING
, "no domain");
405 g_log (NULL
, G_LOG_LEVEL_WARNING
, "no domain");
406 g_test_assert_expected_messages ();
410 test_expected_messages_expect_error (void)
412 /* make sure we can't try to expect a g_error() */
413 g_test_expect_message ("GLib", G_LOG_LEVEL_CRITICAL
, "*G_LOG_LEVEL_ERROR*");
414 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_ERROR
, "this won't work");
415 g_test_assert_expected_messages ();
419 test_expected_messages_extra_warning (void)
421 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_WARNING
,
422 "This is a * warning");
423 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_CRITICAL
,
424 "*should not be reached");
425 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_CRITICAL
,
428 test_expected_messages_warning ();
430 /* If we don't assert, it won't notice the missing message */
435 test_expected_messages_unexpected_extra_warning (void)
437 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_WARNING
,
438 "This is a * warning");
439 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_CRITICAL
,
440 "*should not be reached");
441 g_test_expect_message (G_LOG_DOMAIN
, G_LOG_LEVEL_CRITICAL
,
444 test_expected_messages_warning ();
446 g_test_assert_expected_messages ();
451 test_expected_messages (void)
453 g_test_trap_subprocess ("/misc/expected-messages/subprocess/warning", 0, 0);
454 g_test_trap_assert_failed ();
455 g_test_trap_assert_stderr ("*This is a * warning*");
456 g_test_trap_assert_stderr_unmatched ("*should not be reached*");
458 g_test_trap_subprocess ("/misc/expected-messages/subprocess/expect-warning", 0, 0);
459 g_test_trap_assert_failed ();
460 g_test_trap_assert_stderr_unmatched ("*This is a * warning*");
461 g_test_trap_assert_stderr ("*should not be reached*");
463 g_test_trap_subprocess ("/misc/expected-messages/subprocess/wrong-warning", 0, 0);
464 g_test_trap_assert_failed ();
465 g_test_trap_assert_stderr_unmatched ("*should not be reached*");
466 g_test_trap_assert_stderr ("*GLib-CRITICAL*Did not see expected message testing-CRITICAL*should not be *WARNING*This is a * warning*");
468 g_test_trap_subprocess ("/misc/expected-messages/subprocess/expected", 0, 0);
469 g_test_trap_assert_passed ();
470 g_test_trap_assert_stderr ("");
472 g_test_trap_subprocess ("/misc/expected-messages/subprocess/null-domain", 0, 0);
473 g_test_trap_assert_passed ();
474 g_test_trap_assert_stderr ("");
476 g_test_trap_subprocess ("/misc/expected-messages/subprocess/extra-warning", 0, 0);
477 g_test_trap_assert_passed ();
478 g_test_trap_assert_stderr ("");
480 g_test_trap_subprocess ("/misc/expected-messages/subprocess/unexpected-extra-warning", 0, 0);
481 g_test_trap_assert_failed ();
482 g_test_trap_assert_stderr ("*GLib:ERROR*Did not see expected message testing-CRITICAL*nope*");
486 test_expected_messages_debug (void)
488 g_test_expect_message ("Test", G_LOG_LEVEL_WARNING
, "warning message");
489 g_log ("Test", G_LOG_LEVEL_DEBUG
, "should be ignored");
490 g_log ("Test", G_LOG_LEVEL_WARNING
, "warning message");
491 g_test_assert_expected_messages ();
493 g_test_expect_message ("Test", G_LOG_LEVEL_DEBUG
, "debug message");
494 g_log ("Test", G_LOG_LEVEL_DEBUG
, "debug message");
495 g_test_assert_expected_messages ();
499 test_dash_p_hidden (void)
501 if (!g_test_subprocess ())
502 g_assert_not_reached ();
504 g_print ("Test /misc/dash-p/subprocess/hidden ran\n");
508 test_dash_p_hidden_sub (void)
510 if (!g_test_subprocess ())
511 g_assert_not_reached ();
513 g_print ("Test /misc/dash-p/subprocess/hidden/sub ran\n");
516 /* The rest of the dash_p tests will get run by the toplevel test
517 * process, but they shouldn't do anything there.
521 test_dash_p_child (void)
523 if (!g_test_subprocess ())
526 g_print ("Test /misc/dash-p/child ran\n");
530 test_dash_p_child_sub (void)
532 if (!g_test_subprocess ())
535 g_print ("Test /misc/dash-p/child/sub ran\n");
539 test_dash_p_child_sub2 (void)
541 if (!g_test_subprocess ())
544 g_print ("Test /misc/dash-p/child/sub2 ran\n");
548 test_dash_p_child_sub_child (void)
550 if (!g_test_subprocess ())
553 g_print ("Test /misc/dash-p/child/subprocess ran\n");
559 g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden", 0, 0);
560 g_test_trap_assert_passed ();
561 g_test_trap_assert_stdout ("*Test /misc/dash-p/subprocess/hidden ran*");
562 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub ran*");
563 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub2 ran*");
564 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub/subprocess ran*");
565 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child*");
567 g_test_trap_subprocess ("/misc/dash-p/subprocess/hidden/sub", 0, 0);
568 g_test_trap_assert_passed ();
569 g_test_trap_assert_stdout ("*Test /misc/dash-p/subprocess/hidden/sub ran*");
570 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden ran*");
571 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/sub2 ran*");
572 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden/subprocess ran*");
573 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child*");
575 g_test_trap_subprocess ("/misc/dash-p/child", 0, 0);
576 g_test_trap_assert_passed ();
577 g_test_trap_assert_stdout ("*Test /misc/dash-p/child ran*");
578 g_test_trap_assert_stdout ("*Test /misc/dash-p/child/sub ran*");
579 g_test_trap_assert_stdout ("*Test /misc/dash-p/child/sub2 ran*");
580 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child/subprocess ran*");
581 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden*");
583 g_test_trap_subprocess ("/misc/dash-p/child/sub", 0, 0);
584 g_test_trap_assert_passed ();
585 g_test_trap_assert_stdout ("*Test /misc/dash-p/child/sub ran*");
586 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child ran*");
587 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child/sub2 ran*");
588 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/child/subprocess ran*");
589 g_test_trap_assert_stdout_unmatched ("*Test /misc/dash-p/subprocess/hidden*");
595 if (g_test_subprocess ())
597 g_test_set_nonfatal_assertions ();
598 g_assert_cmpint (4, ==, 5);
599 g_print ("The End\n");
602 g_test_trap_subprocess (NULL
, 0, 0);
603 g_test_trap_assert_failed ();
604 g_test_trap_assert_stderr ("*assertion failed*4 == 5*");
605 g_test_trap_assert_stdout ("*The End*");
611 g_test_skip ("Skipped should count as passed, not failed");
622 if (g_test_subprocess ())
625 g_assert (g_test_failed ());
628 g_test_trap_subprocess (NULL
, 0, 0);
629 g_test_trap_assert_failed ();
633 test_incomplete (void)
635 if (g_test_subprocess ())
637 g_test_incomplete ("not done");
638 g_assert (g_test_failed ());
641 g_test_trap_subprocess (NULL
, 0, 0);
642 g_test_trap_assert_failed ();
646 test_subprocess_timed_out (void)
648 if (g_test_subprocess ())
653 g_test_trap_subprocess (NULL
, 50000, 0);
654 g_assert (g_test_trap_reached_timeout ());
657 static const char *argv0
;
663 GError
*error
= NULL
;
666 argv
= g_ptr_array_new ();
667 g_ptr_array_add (argv
, (char *) argv0
);
668 g_ptr_array_add (argv
, "--GTestSubprocess");
669 g_ptr_array_add (argv
, "-p");
670 g_ptr_array_add (argv
, "/misc/skip");
671 g_ptr_array_add (argv
, NULL
);
673 g_spawn_sync (NULL
, (char **) argv
->pdata
, NULL
,
674 G_SPAWN_STDOUT_TO_DEV_NULL
| G_SPAWN_STDERR_TO_DEV_NULL
,
675 NULL
, NULL
, NULL
, NULL
, &status
,
677 g_assert_no_error (error
);
679 g_spawn_check_exit_status (status
, &error
);
680 g_assert_error (error
, G_SPAWN_EXIT_ERROR
, 77);
681 g_clear_error (&error
);
683 g_ptr_array_set_size (argv
, 0);
684 g_ptr_array_add (argv
, (char *) argv0
);
685 g_ptr_array_add (argv
, "--GTestSubprocess");
686 g_ptr_array_add (argv
, "-p");
687 g_ptr_array_add (argv
, "/misc/skip");
688 g_ptr_array_add (argv
, "-p");
689 g_ptr_array_add (argv
, "/misc/skip-all/subprocess/skip1");
690 g_ptr_array_add (argv
, "-p");
691 g_ptr_array_add (argv
, "/misc/skip-all/subprocess/skip2");
692 g_ptr_array_add (argv
, NULL
);
694 g_spawn_sync (NULL
, (char **) argv
->pdata
, NULL
,
695 G_SPAWN_STDOUT_TO_DEV_NULL
| G_SPAWN_STDERR_TO_DEV_NULL
,
696 NULL
, NULL
, NULL
, NULL
, &status
,
698 g_assert_no_error (error
);
700 g_spawn_check_exit_status (status
, &error
);
701 g_assert_error (error
, G_SPAWN_EXIT_ERROR
, 77);
702 g_clear_error (&error
);
704 g_ptr_array_set_size (argv
, 0);
705 g_ptr_array_add (argv
, (char *) argv0
);
706 g_ptr_array_add (argv
, "--GTestSubprocess");
707 g_ptr_array_add (argv
, "-p");
708 g_ptr_array_add (argv
, "/misc/skip");
709 g_ptr_array_add (argv
, "-p");
710 g_ptr_array_add (argv
, "/misc/skip-all/subprocess/pass");
711 g_ptr_array_add (argv
, "-p");
712 g_ptr_array_add (argv
, "/misc/skip-all/subprocess/skip1");
713 g_ptr_array_add (argv
, NULL
);
715 g_spawn_sync (NULL
, (char **) argv
->pdata
, NULL
,
716 G_SPAWN_STDOUT_TO_DEV_NULL
| G_SPAWN_STDERR_TO_DEV_NULL
,
717 NULL
, NULL
, NULL
, NULL
, &status
,
719 g_assert_no_error (error
);
721 g_spawn_check_exit_status (status
, &error
);
722 g_assert_no_error (error
);
724 g_ptr_array_unref (argv
);
733 g_test_init (&argc
, &argv
, NULL
);
735 g_test_add_func ("/random-generator/rand-1", test_rand1
);
736 g_test_add_func ("/random-generator/rand-2", test_rand2
);
737 g_test_add_func ("/random-generator/random-conversions", test_random_conversions
);
738 g_test_add_func ("/misc/assertions", test_assertions
);
739 g_test_add_func ("/misc/assertions/subprocess/bad_cmpstr", test_assertions_bad_cmpstr
);
740 g_test_add_func ("/misc/assertions/subprocess/bad_cmpint", test_assertions_bad_cmpint
);
741 g_test_add_func ("/misc/assertions/subprocess/bad_cmpmem_len", test_assertions_bad_cmpmem_len
);
742 g_test_add_func ("/misc/assertions/subprocess/bad_cmpmem_data", test_assertions_bad_cmpmem_data
);
743 g_test_add_data_func ("/misc/test-data", (void*) 0xc0c0baba, test_data_test
);
744 g_test_add ("/misc/primetoul", Fixturetest
, (void*) 0xc0cac01a, fixturetest_setup
, fixturetest_test
, fixturetest_teardown
);
746 g_test_add_func ("/misc/timer", test_timer
);
749 g_test_add_func ("/forking/fail assertion", test_fork_fail
);
750 g_test_add_func ("/forking/patterns", test_fork_patterns
);
752 g_test_add_func ("/forking/timeout", test_fork_timeout
);
755 g_test_add_func ("/trap_subprocess/fail", test_subprocess_fail
);
756 g_test_add_func ("/trap_subprocess/no-such-test", test_subprocess_no_such_test
);
758 g_test_add_func ("/trap_subprocess/timeout", test_subprocess_timeout
);
760 g_test_add_func ("/trap_subprocess/patterns", test_subprocess_patterns
);
762 g_test_add_func ("/misc/fatal-log-handler", test_fatal_log_handler
);
763 g_test_add_func ("/misc/fatal-log-handler/subprocess/critical-pass", test_fatal_log_handler_critical_pass
);
764 g_test_add_func ("/misc/fatal-log-handler/subprocess/error-fail", test_fatal_log_handler_error_fail
);
765 g_test_add_func ("/misc/fatal-log-handler/subprocess/critical-fail", test_fatal_log_handler_critical_fail
);
767 g_test_add_func ("/misc/expected-messages", test_expected_messages
);
768 g_test_add_func ("/misc/expected-messages/subprocess/warning", test_expected_messages_warning
);
769 g_test_add_func ("/misc/expected-messages/subprocess/expect-warning", test_expected_messages_expect_warning
);
770 g_test_add_func ("/misc/expected-messages/subprocess/wrong-warning", test_expected_messages_wrong_warning
);
771 g_test_add_func ("/misc/expected-messages/subprocess/expected", test_expected_messages_expected
);
772 g_test_add_func ("/misc/expected-messages/subprocess/null-domain", test_expected_messages_null_domain
);
773 g_test_add_func ("/misc/expected-messages/subprocess/extra-warning", test_expected_messages_extra_warning
);
774 g_test_add_func ("/misc/expected-messages/subprocess/unexpected-extra-warning", test_expected_messages_unexpected_extra_warning
);
775 g_test_add_func ("/misc/expected-messages/expect-error", test_expected_messages_expect_error
);
776 g_test_add_func ("/misc/expected-messages/skip-debug", test_expected_messages_debug
);
778 g_test_add_func ("/misc/dash-p", test_dash_p
);
779 g_test_add_func ("/misc/dash-p/child", test_dash_p_child
);
780 g_test_add_func ("/misc/dash-p/child/sub", test_dash_p_child_sub
);
781 g_test_add_func ("/misc/dash-p/child/sub/subprocess", test_dash_p_child_sub_child
);
782 g_test_add_func ("/misc/dash-p/child/sub/subprocess/child", test_dash_p_child_sub_child
);
783 g_test_add_func ("/misc/dash-p/child/sub2", test_dash_p_child_sub2
);
784 g_test_add_func ("/misc/dash-p/subprocess/hidden", test_dash_p_hidden
);
785 g_test_add_func ("/misc/dash-p/subprocess/hidden/sub", test_dash_p_hidden_sub
);
787 g_test_add_func ("/misc/nonfatal", test_nonfatal
);
789 g_test_add_func ("/misc/skip", test_skip
);
790 g_test_add_func ("/misc/skip-all", test_skip_all
);
791 g_test_add_func ("/misc/skip-all/subprocess/skip1", test_skip
);
792 g_test_add_func ("/misc/skip-all/subprocess/skip2", test_skip
);
793 g_test_add_func ("/misc/skip-all/subprocess/pass", test_pass
);
794 g_test_add_func ("/misc/fail", test_fail
);
795 g_test_add_func ("/misc/incomplete", test_incomplete
);
796 g_test_add_func ("/misc/timeout", test_subprocess_timed_out
);