assert(in_fixture);
__igt_fixture_end();
} else {
- exit(77);
+ exit(IGT_EXIT_SKIP);
}
}
*/
void igt_fail(int exitcode)
{
- assert(exitcode != 0 && exitcode != 77);
+ assert(exitcode != IGT_EXIT_SUCCESS && exitcode != IGT_EXIT_SKIP);
if (!failed_one)
igt_exitcode = exitcode;
exit(exitcode);
if (in_subtest) {
- if (exitcode == 78)
+ if (exitcode == IGT_EXIT_TIMEOUT)
exit_subtest("TIMEOUT");
else
exit_subtest("FAIL");
igt_exit_called = true;
if (igt_only_list_subtests())
- exit(0);
+ exit(IGT_EXIT_SUCCESS);
if (!test_with_subtests)
- exit(0);
+ exit(IGT_EXIT_SUCCESS);
/* Calling this without calling one of the above is a failure */
assert(skipped_one || succeeded_one || failed_one);
if (failed_one)
exit(igt_exitcode);
else if (succeeded_one)
- exit(0);
+ exit(IGT_EXIT_SUCCESS);
else
- exit(77);
+ exit(IGT_EXIT_SKIP);
}
/* fork support code */
/* subsequent tests are skipped */
skip_subtests_henceforth = SKIP;
- /* exit with status 78 to indicate timeout */
- igt_fail(78);
+ /* exit with timeout status */
+ igt_fail(IGT_EXIT_TIMEOUT);
}
/**
* @seconds: number of seconds before timeout
*
* Stop the current test and skip any subsequent tests after the specified
- * number of seconds have elapsed. The test will exit with "timeout" status
- * (78). Any previous timer is cancelled and no timeout is scheduled if @seconds
- * is zero.
+ * number of seconds have elapsed. The test will exit with #IGT_EXIT_TIMEOUT
+ * status. Any previous timer is cancelled and no timeout is scheduled if
+ * @seconds is zero.
*
*/
void igt_set_timeout(unsigned int seconds)
/* simple tests */
simple = true;
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
- assert(do_fork() == 77);
+ assert(do_fork() == IGT_EXIT_SKIP);
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
- assert(do_fork() == 0);
+ assert(do_fork() == IGT_EXIT_SUCCESS);
/* subtests, list mode */
simple = false;
in_fixture = false;
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
- assert(do_fork() == 0);
+ assert(do_fork() == IGT_EXIT_SUCCESS);
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
- assert(do_fork() == 0);
+ assert(do_fork() == IGT_EXIT_SUCCESS);
in_fixture = true;
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
- assert(do_fork() == 0);
+ assert(do_fork() == IGT_EXIT_SUCCESS);
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
- assert(do_fork() == 0);
+ assert(do_fork() == IGT_EXIT_SUCCESS);
in_fixture = false;
in_subtest = true;
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
- assert(do_fork() == 0);
+ assert(do_fork() == IGT_EXIT_SUCCESS);
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
- assert(do_fork() == 0);
+ assert(do_fork() == IGT_EXIT_SUCCESS);
/* subtest, run mode */
simple = false;
in_fixture = false;
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
- assert(do_fork() == 77);
+ assert(do_fork() == IGT_EXIT_SKIP);
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
- assert(do_fork() == 0);
+ assert(do_fork() == IGT_EXIT_SUCCESS);
in_fixture = true;
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
- assert(do_fork() == 77);
+ assert(do_fork() == IGT_EXIT_SKIP);
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
- assert(do_fork() == 0);
+ assert(do_fork() == IGT_EXIT_SUCCESS);
in_fixture = false;
in_subtest = true;
assert(setenv("INTEL_SIMULATION", "1", 1) == 0);
- assert(do_fork() == 77);
+ assert(do_fork() == IGT_EXIT_SKIP);
assert(setenv("INTEL_SIMULATION", "0", 1) == 0);
- assert(do_fork() == 0);
+ assert(do_fork() == IGT_EXIT_SUCCESS);
return 0;
}