Lines Matching refs:test

82 struct test  struct
92 test_common (const struct test *test) in test_common() argument
95 switch (test->write_mode) in test_common()
98 TEST_VERIFY (fputs (test->out, stdout) >= 0); in test_common()
100 TEST_VERIFY (fputs (test->err, stderr) >= 0); in test_common()
105 TEST_VERIFY (fputs (test->err, stderr) >= 0); in test_common()
107 TEST_VERIFY (fputs (test->out, stdout) >= 0); in test_common()
113 const unsigned char *pout = (const unsigned char *) test->out; in test_common()
114 const unsigned char *perr = (const unsigned char *) test->err; in test_common()
127 if (test->signal != 0) in test_common()
128 raise (test->signal); in test_common()
129 exit (test->status); in test_common()
149 struct test test = in handle_restart() local
157 test_common (&test); in handle_restart()
164 const struct test *test = closure; in callback() local
165 test_common (test); in callback()
204 do_subprocess (struct test *test) in do_subprocess() argument
206 return support_capture_subprocess (callback, test); in do_subprocess()
210 do_subprogram (const struct test *test) in do_subprogram() argument
214 snprintf (signalstr, sizeof (signalstr), "%d", test->signal); in do_subprogram()
216 snprintf (statusstr, sizeof (statusstr), "%d", test->status); in do_subprogram()
233 args[argc++] = test->out; in do_subprogram()
234 args[argc++] = test->err; in do_subprogram()
235 args[argc++] = (char*) write_mode_to_str (test->write_mode); in do_subprogram()
273 struct test test = in do_multiple_tests() local
281 TEST_VERIFY (strlen (test.out) == lengths[length_idx_stdout]); in do_multiple_tests()
282 TEST_VERIFY (strlen (test.err) == lengths[length_idx_stderr]); in do_multiple_tests()
285 = type == subprocess ? do_subprocess (&test) in do_multiple_tests()
286 : do_subprogram (&test); in do_multiple_tests()
288 check_stream ("stdout", &result.out, test.out); in do_multiple_tests()
289 check_stream ("stderr", &result.err, test.err); in do_multiple_tests()
300 if (test.signal != 0) in do_multiple_tests()
303 TEST_VERIFY (WTERMSIG (result.status) == test.signal); in do_multiple_tests()
310 TEST_VERIFY (WEXITSTATUS (result.status) == test.status); in do_multiple_tests()
312 test.status, check_allow); in do_multiple_tests()
315 free (test.out); in do_multiple_tests()
316 free (test.err); in do_multiple_tests()