Skip to content

Commit

Permalink
selftest/powerpc: Fix false failures for skipped tests
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sachin Sant authored and Michael Ellerman committed Mar 3, 2017
1 parent 424f8ac commit a6d8a21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/testing/selftests/powerpc/harness.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ int test_harness(int (test_function)(void), char *name)

rc = run_test(test_function, name);

if (rc == MAGIC_SKIP_RETURN_VALUE)
if (rc == MAGIC_SKIP_RETURN_VALUE) {
test_skip(name);
else
/* so that skipped test is not marked as failed */
rc = 0;
} else
test_finish(name, rc);

return rc;
Expand Down

0 comments on commit a6d8a21

Please sign in to comment.