Skip to content

Commit a6d8a21

Browse files
sacsantmpe
authored andcommitted
selftest/powerpc: Fix false failures for skipped tests
Tests under alignment subdirectory are skipped when executed on previous generation hardware, but harness still marks them as failed. test: test_copy_unaligned tags: git_version:unknown [SKIP] Test skipped on line 26 skip: test_copy_unaligned selftests: copy_unaligned [FAIL] The MAGIC_SKIP_RETURN_VALUE value assigned to rc variable is retained till the program exit which causes the test to be marked as failed. This patch resets the value before returning to the main() routine. With this patch the test o/p is as follows: test: test_copy_unaligned tags: git_version:unknown [SKIP] Test skipped on line 26 skip: test_copy_unaligned selftests: copy_unaligned [PASS] Signed-off-by: Sachin Sant <sachinp@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 424f8ac commit a6d8a21

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/testing/selftests/powerpc/harness.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ int test_harness(int (test_function)(void), char *name)
114114

115115
rc = run_test(test_function, name);
116116

117-
if (rc == MAGIC_SKIP_RETURN_VALUE)
117+
if (rc == MAGIC_SKIP_RETURN_VALUE) {
118118
test_skip(name);
119-
else
119+
/* so that skipped test is not marked as failed */
120+
rc = 0;
121+
} else
120122
test_finish(name, rc);
121123

122124
return rc;

0 commit comments

Comments
 (0)