From 57e573ecc1c53b3aafe6ac4784069d79bd73107d Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 20 Aug 2013 22:03:30 +0200 Subject: [PATCH] tests/pc8: Update to latest igt infrastructure - Use igt_require for magic SKIP results while still printing results for all subtests. - Wrap setup/teardown code outside of subtests with igt_fixture. This will ensure that the so wrapped code isn't run when an igt_require/igt_assert failed (and we're essentially just printing the SKIP/FAIL result for all subtests) or when just enumerating subtests. - Use igt_exit. Otherwise SKIP/FAIL results of subtests won't be propagated correctly. - igt_subtest checks should be run unconditionally to make sure we always enumerate the same set of subtests. A bit on the line here since this is a subtest hidden behind a runtime flag. Signed-off-by: Daniel Vetter --- tests/pc8.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/pc8.c b/tests/pc8.c index 06c54b70..16960ec0 100644 --- a/tests/pc8.c +++ b/tests/pc8.c @@ -781,9 +781,8 @@ int main(int argc, char *argv[]) /* Skip instead of failing in case the machine is not prepared to reach * PC8+. We don't want bug reports from cases where the machine is just * not properly configured. */ - printf("Checking if the environment is properly configured.\n"); - if (!setup_environment()) - return 77; + igt_fixture + igt_require(setup_environment()); igt_subtest("drm-resources-equal") drm_resources_equal_subtest(); @@ -793,12 +792,13 @@ int main(int argc, char *argv[]) i2c_subtest(); igt_subtest("stress-test") stress_test(); - if (do_register_compare) - igt_subtest("register-compare") - register_compare_subtest(); + igt_subtest("register-compare") { + igt_require(do_register_compare); + register_compare_subtest(); + } - teardown_environment(); + igt_fixture + teardown_environment(); - printf("Done!\n"); - return 0; + igt_exit(); }