Skip to content

Commit 1ad33e2

Browse files
ithinuelkartben
authored andcommitted
tests: arch: arm: Correctly report skipped tests as skipped
test_arm_user_interrupt and test_arm_null_pointer_exception currently only print "Skipped" but reports as PASS in twister. This fixes that misleading report. Signed-off-by: Wilfried Chauveau <[email protected]>
1 parent 4451cee commit 1ad33e2

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

tests/arch/arm/arm_interrupt/src/arm_interrupt.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -455,16 +455,17 @@ ZTEST_USER(arm_interrupt, test_arm_user_interrupt)
455455
#else
456456
ZTEST_USER(arm_interrupt, test_arm_user_interrupt)
457457
{
458-
TC_PRINT("Skipped\n");
458+
ztest_test_skip();
459459
}
460460
#endif /* CONFIG_USERSPACE */
461461

462-
#if defined(CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION)
463462
#pragma GCC push_options
464463
#pragma GCC optimize("O0")
465464
/* Avoid compiler optimizing null pointer de-referencing. */
466465
ZTEST(arm_interrupt, test_arm_null_pointer_exception)
467466
{
467+
Z_TEST_SKIP_IFNDEF(CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION);
468+
468469
int reason;
469470

470471
struct test_struct {
@@ -483,13 +484,6 @@ ZTEST(arm_interrupt, test_arm_null_pointer_exception)
483484
"expected_reason has not been reset (%d)\n", reason);
484485
}
485486
#pragma GCC pop_options
486-
#else
487-
ZTEST(arm_interrupt, test_arm_null_pointer_exception)
488-
{
489-
TC_PRINT("Skipped\n");
490-
}
491-
492-
#endif /* CONFIG_CORTEX_M_NULL_POINTER_EXCEPTION */
493487

494488
/**
495489
* @}

0 commit comments

Comments
 (0)