1.. _ztest_framework_failure_tests: 2 3Ztest framework failure tests 4############################# 5 6Overview 7******** 8 9In order to test the actual framework's failure cases, this test suite has to do something unique. 10There's a subdirectory to this test called 'core'. This project builds a sample ``native_posix`` or 11``unit_testing`` binary which is expected to fail by calling one of the following: 12- ``ztest_test_fail()`` during either the ``after`` or ``teardown`` phase of the test suite 13- ``ztest_test_skip()`` during either the ``after`` or ``teardown`` phase of the test suite 14- ``ztest_test_pass()`` during either the ``after`` or ``teardown`` phase of the test suite 15 16Note that these can be called indirectly through failed asserts or assumptions. 17 18The binary by itself, when executed, will fail to run and return a code of ``1``. The main test 19binary will use ``popen()`` to run the failing test binary and will assert both the return code and 20the output. The output itself cannot be printed to the log as it will confuse ``twister`` by 21reporting a failure. 22