diff --git a/subsys/testsuite/ztest/src/ztest_new.c b/subsys/testsuite/ztest/src/ztest_new.c index ecede8060ccdeb..0b7c401166140b 100644 --- a/subsys/testsuite/ztest/src/ztest_new.c +++ b/subsys/testsuite/ztest/src/ztest_new.c @@ -334,7 +334,7 @@ void ztest_test_fail(void) case TEST_PHASE_AFTER: case TEST_PHASE_TEARDOWN: case TEST_PHASE_FRAMEWORK: - PRINT(" ERROR: cannot fail in test '%s()', bailing\n", + PRINT(" ERROR: cannot fail in test phase '%s()', bailing\n", get_friendly_phase_name(phase)); longjmp(stack_fail, 1); } @@ -345,7 +345,8 @@ void ztest_test_pass(void) if (phase == TEST_PHASE_TEST) { longjmp(test_pass, 1); } - PRINT(" ERROR: cannot pass in test '%s()', bailing\n", get_friendly_phase_name(phase)); + PRINT(" ERROR: cannot pass in test phase '%s()', bailing\n", + get_friendly_phase_name(phase)); longjmp(stack_fail, 1); } @@ -357,7 +358,7 @@ void ztest_test_skip(void) case TEST_PHASE_TEST: longjmp(test_skip, 1); default: - PRINT(" ERROR: cannot skip in test '%s()', bailing\n", + PRINT(" ERROR: cannot skip in test phase '%s()', bailing\n", get_friendly_phase_name(phase)); longjmp(stack_fail, 1); } @@ -448,7 +449,7 @@ void ztest_test_fail(void) test_finalize(); break; default: - PRINT(" ERROR: cannot fail in test '%s()', bailing\n", + PRINT(" ERROR: cannot fail in test phase '%s()', bailing\n", get_friendly_phase_name(phase)); test_status = ZTEST_STATUS_CRITICAL_ERROR; break; @@ -463,7 +464,7 @@ void ztest_test_pass(void) test_finalize(); break; default: - PRINT(" ERROR: cannot pass in test '%s()', bailing\n", + PRINT(" ERROR: cannot pass in test phase '%s()', bailing\n", get_friendly_phase_name(phase)); test_status = ZTEST_STATUS_CRITICAL_ERROR; if (phase == TEST_PHASE_BEFORE) { @@ -484,7 +485,7 @@ void ztest_test_skip(void) test_finalize(); break; default: - PRINT(" ERROR: cannot skip in test '%s()', bailing\n", + PRINT(" ERROR: cannot skip in test phase '%s()', bailing\n", get_friendly_phase_name(phase)); test_status = ZTEST_STATUS_CRITICAL_ERROR; break; diff --git a/tests/ztest/fail/Kconfig b/tests/ztest/fail/Kconfig index 251175623ae627..c1ca3535ea7443 100644 --- a/tests/ztest/fail/Kconfig +++ b/tests/ztest/fail/Kconfig @@ -29,12 +29,12 @@ endchoice config TEST_ERROR_STRING string - default "ERROR: cannot fail in test 'after()', bailing" if ZTEST_FAIL_TEST_ASSERT_AFTER - default "ERROR: cannot fail in test 'teardown()', bailing" if ZTEST_FAIL_TEST_ASSERT_TEARDOWN - default "ERROR: cannot skip in test 'after()', bailing" if ZTEST_FAIL_TEST_ASSUME_AFTER - default "ERROR: cannot skip in test 'teardown()', bailing" if ZTEST_FAIL_TEST_ASSUME_TEARDOWN - default "ERROR: cannot pass in test 'after()', bailing" if ZTEST_FAIL_TEST_PASS_AFTER - default "ERROR: cannot pass in test 'teardown()', bailing" if ZTEST_FAIL_TEST_PASS_TEARDOWN + default "ERROR: cannot fail in test phase 'after()', bailing" if ZTEST_FAIL_TEST_ASSERT_AFTER + default "ERROR: cannot fail in test phase 'teardown()', bailing" if ZTEST_FAIL_TEST_ASSERT_TEARDOWN + default "ERROR: cannot skip in test phase 'after()', bailing" if ZTEST_FAIL_TEST_ASSUME_AFTER + default "ERROR: cannot skip in test phase 'teardown()', bailing" if ZTEST_FAIL_TEST_ASSUME_TEARDOWN + default "ERROR: cannot pass in test phase 'after()', bailing" if ZTEST_FAIL_TEST_PASS_AFTER + default "ERROR: cannot pass in test phase 'teardown()', bailing" if ZTEST_FAIL_TEST_PASS_TEARDOWN default "Assumption failed at " if ZTEST_FAIL_TEST_UNEXPECTED_ASSUME source "Kconfig.zephyr"