1# Copyright (c) 2022 Google LLC
2# SPDX-License-Identifier: Apache-2.0
3
4choice ZTEST_FAIL_TEST
5	prompt "Select the type of failure to test"
6
7config ZTEST_FAIL_TEST_ASSERT_AFTER
8	bool "Add a failed assert in the after phase"
9
10config ZTEST_FAIL_TEST_ASSERT_TEARDOWN
11	bool "Add a failed assert in the teardown phase"
12
13config ZTEST_FAIL_TEST_ASSUME_AFTER
14	bool "Add a failed assume in the after phase"
15
16config ZTEST_FAIL_TEST_ASSUME_TEARDOWN
17	bool "Add a failed assume in the teardown phase"
18
19config ZTEST_FAIL_TEST_PASS_AFTER
20	bool "Add a call to ztest_test_pass() in the after phase"
21
22config ZTEST_FAIL_TEST_PASS_TEARDOWN
23	bool "Add a call to ztest_test_pass() in the teardown phase"
24
25config ZTEST_FAIL_TEST_UNEXPECTED_ASSUME
26	bool "Add a test which fails a zassume() call"
27
28endchoice
29
30config TEST_ERROR_STRING
31	string
32	default "ERROR: cannot fail in test phase 'after()', bailing" if ZTEST_FAIL_TEST_ASSERT_AFTER
33	default "ERROR: cannot fail in test phase 'teardown()', bailing" if ZTEST_FAIL_TEST_ASSERT_TEARDOWN
34	default "ERROR: cannot skip in test phase 'after()', bailing" if ZTEST_FAIL_TEST_ASSUME_AFTER
35	default "ERROR: cannot skip in test phase 'teardown()', bailing" if ZTEST_FAIL_TEST_ASSUME_TEARDOWN
36	default "ERROR: cannot pass in test phase 'after()', bailing" if ZTEST_FAIL_TEST_PASS_AFTER
37	default "ERROR: cannot pass in test phase 'teardown()', bailing" if ZTEST_FAIL_TEST_PASS_TEARDOWN
38	default "Assumption failed at " if ZTEST_FAIL_TEST_UNEXPECTED_ASSUME
39
40source "Kconfig.zephyr"
41