| 
    Zephyr Project API 3.5.0
    
   A Scalable Open Source RTOS 
   | 
 
This module eases the testing process by providing helpful macros and other testing structures. More...
Macros | |
| #define | ztest_unit_test_setup_teardown(fn, setup, teardown) | 
| Define a test with setup and teardown functions.   | |
| #define | ztest_user_unit_test_setup_teardown(fn, setup, teardown) | 
| Define a user mode test with setup and teardown functions.   | |
| #define | ztest_unit_test(fn) ztest_unit_test_setup_teardown(fn, unit_test_noop, unit_test_noop) | 
| Define a test function.   | |
| #define | ztest_user_unit_test(fn) ztest_user_unit_test_setup_teardown(fn, unit_test_noop, unit_test_noop) | 
| Define a test function that should run as a user thread.   | |
| #define | ztest_1cpu_unit_test(fn) ztest_unit_test_setup_teardown(fn, z_test_1cpu_start, z_test_1cpu_stop) | 
| Define a SMP-unsafe test function.   | |
| #define | ztest_1cpu_user_unit_test(fn) ztest_user_unit_test_setup_teardown(fn, z_test_1cpu_start, z_test_1cpu_stop) | 
| Define a SMP-unsafe test function that should run as a user thread.   | |
| #define | ZTEST_DMEM K_APP_DMEM(ztest_mem_partition) | 
| #define | ZTEST_BMEM K_APP_BMEM(ztest_mem_partition) | 
| #define | ZTEST_SECTION K_APP_DMEM_SECTION(ztest_mem_partition) | 
| #define | ztest_test_suite(suite, ...) | 
| Define a test suite.   | |
| #define | ztest_run_test_suite(suite) | 
| Run the specified test suite.   | |
Functions | |
| void | ztest_test_fail (void) | 
| Fail the currently running test.   | |
| void | ztest_test_pass (void) | 
| Pass the currently running test.   | |
| void | ztest_test_skip (void) | 
| Skip the current test.   | |
| static void | unit_test_noop (void) | 
| Do nothing, successfully.   | |
Variables | |
| struct k_mem_partition | ztest_mem_partition | 
This module eases the testing process by providing helpful macros and other testing structures.
| #define ztest_1cpu_unit_test | ( | fn | ) | ztest_unit_test_setup_teardown(fn, z_test_1cpu_start, z_test_1cpu_stop) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Define a SMP-unsafe test function.
As ztest_unit_test(), but ensures all test code runs on only one CPU when in SMP.
| fn | Test function | 
| #define ztest_1cpu_user_unit_test | ( | fn | ) | ztest_user_unit_test_setup_teardown(fn, z_test_1cpu_start, z_test_1cpu_stop) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Define a SMP-unsafe test function that should run as a user thread.
As ztest_user_unit_test(), but ensures all test code runs on only one CPU when in SMP.
| fn | Test function | 
| #define ZTEST_BMEM K_APP_BMEM(ztest_mem_partition) | 
| #define ZTEST_DMEM K_APP_DMEM(ztest_mem_partition) | 
| #define ztest_run_test_suite | ( | suite | ) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Run the specified test suite.
| suite | Test suite to run. | 
| #define ZTEST_SECTION K_APP_DMEM_SECTION(ztest_mem_partition) | 
| #define ztest_test_suite | ( | suite, | |
| ... | |||
| ) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Define a test suite.
This function should be called in the following fashion:
| suite | Name of the testing suite | 
| #define ztest_unit_test | ( | fn | ) | ztest_unit_test_setup_teardown(fn, unit_test_noop, unit_test_noop) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Define a test function.
This should be called as an argument to ztest_test_suite.
| fn | Test function | 
| #define ztest_unit_test_setup_teardown | ( | fn, | |
| setup, | |||
| teardown | |||
| ) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Define a test with setup and teardown functions.
This should be called as an argument to ztest_test_suite. The test will be run in the following order: setup, fn, teardown.
| fn | Main test function | 
| setup | Setup function | 
| teardown | Teardown function | 
| #define ztest_user_unit_test | ( | fn | ) | ztest_user_unit_test_setup_teardown(fn, unit_test_noop, unit_test_noop) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Define a test function that should run as a user thread.
This should be called as an argument to ztest_test_suite. If CONFIG_USERSPACE is not enabled, this is functionally identical to ztest_unit_test().
| fn | Test function | 
| #define ztest_user_unit_test_setup_teardown | ( | fn, | |
| setup, | |||
| teardown | |||
| ) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Define a user mode test with setup and teardown functions.
This should be called as an argument to ztest_test_suite. The test will be run in the following order: setup, fn, teardown. ALL test functions will be run in user mode, and only if CONFIG_USERSPACE is enabled, otherwise this is the same as ztest_unit_test_setup_teardown().
| fn | Main test function | 
| setup | Setup function | 
| teardown | Teardown function | 
      
  | 
  inlinestatic | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Do nothing, successfully.
Unit test / setup function / teardown function that does nothing, successfully. Can be used as a parameter to ztest_unit_test_setup_teardown().
| void ztest_test_fail | ( | void | ) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Fail the currently running test.
This is the function called from failed assertions and the like. You probably don't need to call it yourself.
| void ztest_test_pass | ( | void | ) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Pass the currently running test.
Normally a test passes just by returning without an assertion failure. However, if the success case for your test involves a fatal fault, you can call this function from k_sys_fatal_error_handler to indicate that the test passed before aborting the thread.
| void ztest_test_skip | ( | void | ) | 
#include <subsys/testsuite/ztest/include/zephyr/ztest_test_deprecated.h>
Skip the current test.
      
  | 
  extern |