Lines Matching full:test
43 * @brief The expected result of a test.
49 ZTEST_EXPECTED_RESULT_FAIL = 0, /**< Expect a test to fail */
50 ZTEST_EXPECTED_RESULT_SKIP, /**< Expect a test to pass */
60 const char *test_suite_name; /**< The test suite's name for the expectation */
61 const char *test_name; /**< The test's name for the expectation */
78 * @brief Expect a test to fail (mark it passing if it failed)
80 * Adding this macro to your logic will allow the failing test to be considered passing, example:
88 * @param _test_name The name of the test
94 * @brief Expect a test to skip (mark it passing if it failed)
96 * Adding this macro to your logic will allow the failing test to be considered passing, example:
104 * @param _test_name The name of the test
112 void (*test)(void *data); member
137 /** The number of times that the test ran */
139 /** The number of times that the test was skipped */
141 /** The number of times that the test failed */
143 /** The number of times that the test passed */
145 /** The longest duration of the test across multiple times */
152 * @return Pointer to the data structure that will be used throughout this test suite
157 * Function to run before each test in this suite
159 * @param fixture The test suite's fixture returned from setup()
164 * Function to run after each test in this suite
166 * @param fixture The test suite's fixture returned from setup()
173 * @param fixture The test suite's data returned from setup()
178 * An optional predicate function to determine if the test should run. If NULL, then the
179 * test will only run once on the first attempt.
181 * @param global_state The current state of the test application.
187 * A single node of test suite. Each node should be added to a single linker section which will
191 /** The name of the test suite. */
216 /** Number of registered test suites */
220 * Create and register a ztest suite. Using this macro creates a new test suite.
227 * @param PREDICATE A function to test against the state and determine if the test should run.
228 * @param setup_fn The setup function to call before running this test suite
229 * @param before_fn The function to call before each unit test in this suite
230 * @param after_fn The function to call after each unit test in this suite
248 * @param state The current state of the machine as it relates to the test executable.
250 * @param suite_iter Test suite repetitions.
251 * @param case_iter Test case repetitions.
256 * The result of the current running test. It's possible that the setup function sets the result
257 * to ZTEST_RESULT_SUITE_* which will apply the failure/skip to every test in the suite.
268 * Each enum member represents a distinct phase of execution for the test binary.
270 * corresponding phases of user test code.
284 * @param state The current state of the machine as it relates to the test executable.
286 * @param suite_iter Test suite repetitions.
287 * @param case_iter Test case repetitions.
325 * @brief Fails the test if any of the registered tests did not run.
327 * When registering test suites, a pragma function can be provided to determine WHEN the test should
328 * run. It is possible that a test suite could be registered but the pragma always prevents it from
329 * running. In cases where a test should make sure that ALL suites ran at least once, this function
330 * may be called at the end of test_main(). It will cause the test to fail if any suite was
336 * @brief Run a test suite.
338 * Internal implementation. Do not call directly. This will run the full test suite along with some
343 * @param suite_iter Test suite repetitions.
344 * @param case_iter Test case repetitions.
345 * @param param Parameter passing into test.
346 * @return Negative value if the test suite never ran; otherwise, return the number of failures.
352 * @brief Returns next test within suite.
354 * @param suite Name of suite to get next test from.
355 * @param prev Previous unit test acquired from suite, use NULL to return first
356 * unit test.
383 * @brief Fail the currently running test.
391 * @brief Pass the currently running test.
393 * Normally a test passes just by returning without an assertion failure.
394 * However, if the success case for your test involves a fatal fault,
396 * the test passed before aborting the thread.
401 * @brief Skip the current test.
416 .test = (_##suite##_##fn##_wrapper), \
437 .test = (_##suite##_##fn##_wrapper), \
453 * @brief Skips the test if config is enabled
455 * Use this macro at the start of your test case, to skip it when
456 * config is enabled. Useful when your test is still under development.
458 * @param config The Kconfig option used to skip the test.
463 * @brief Skips the test if config is not enabled
465 * Use this macro at the start of your test case, to skip it when
466 * config is not enabled. Useful when your need to skip test if some
469 * @param config The Kconfig option used to skip the test (if not enabled).
474 * @brief Create and register a new unit test.
476 * Calling this macro will create a new unit test and attach it to the declared `suite`. The `suite`
479 * @param suite The name of the test suite to attach this test
480 * @param fn The test function to call.
485 * @brief Define a test function that should run as a user thread
487 * This macro behaves exactly the same as ZTEST, but calls the test function in user space if
490 * @param suite The name of the test suite to attach this test
491 * @param fn The test function to call.
496 * @brief Define a test function
501 * @param suite The name of the test suite to attach this test
502 * @param fn The test function to call.
507 * @brief Define a test function that should run as a user thread
509 * If CONFIG_USERSPACE is not enabled, this is functionally identical to ZTEST_F(). The test
512 * @param suite The name of the test suite to attach this test
513 * @param fn The test function to call.
518 * @brief Test rule callback function signature
520 * The function signature that can be used to register a test rule's before/after callback. This
521 * provides access to the test and the fixture data (if provided).
523 * @param test Pointer to the unit test in context
524 * @param data Pointer to the test's fixture data (may be NULL)
526 typedef void (*ztest_rule_cb)(const struct ztest_unit_test *test, void *data);
535 * @brief Define a test rule that will run before/after each unit test.
537 * Functions defined here will run before/after each unit test for every test suite. Along with the
538 * callback, the test functions are provided a pointer to the test being run, and the data. This
539 * provides a mechanism for tests to perform custom operations depending on the specific test or
540 * the data (for example logging may use the test's name).
543 * - Test rule's `before` function will run before the suite's `before` function. This is done to
544 * allow the test suite's customization to take precedence over the rule which is applied to all
546 * - Test rule's `after` function is not guaranteed to run in any particular order.
548 * @param name The name for the test rule (must be unique within the compilation unit)
549 * @param before_each_fn The callback function (ztest_rule_cb) to call before each test
551 * @param after_each_fn The callback function (ztest_rule_cb) to call after each test (may be NULL)
563 * @brief A 'before' function to use in test suites that just need to start 1cpu
567 * @param data The test suite's data
572 * @brief A 'after' function to use in test suites that just need to stop 1cpu
576 * @param data The test suite's data
581 * @brief Run the specified test suite.
583 * @param suite Test suite to run.
585 * @param suite_iter Test suite repetitions.
586 * @param case_iter Test case repetitions.
587 * @param param Test parameter
599 bool (*should_test_run)(const char *suite, const char *test);