|
iPXE
|
Self-test infrastructure. More...
#include <stddef.h>#include <stdio.h>#include <string.h>#include <errno.h>#include <assert.h>#include <ipxe/test.h>#include <ipxe/init.h>#include <ipxe/image.h>#include <usr/profstat.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| void | test_ok (int success, const char *file, unsigned int line, const char *test) |
| Report test result. More... | |
| static void | run_tests (struct self_test *tests) |
| Run self-test set. More... | |
| static int | run_all_tests (void) |
| Run all self-tests. More... | |
| static int | test_image_probe (struct image *image __unused) |
| static int | test_image_exec (struct image *image __unused) |
| static void | test_init (void) |
| struct init_fn test_init_fn | __init_fn (INIT_EARLY) |
| Self-test initialisation function. More... | |
Variables | |
| static struct self_test * | current_tests |
| Current self-test set. More... | |
| static struct image_type | test_image_type |
| static struct image | test_image |
Self-test infrastructure.
Definition in file test.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| void test_ok | ( | int | success, |
| const char * | file, | ||
| unsigned int | line, | ||
| const char * | test | ||
| ) |
Report test result.
| success | Test succeeded |
| file | Test code file |
| line | Test code line |
| test | Test code |
Definition at line 56 of file test.c.
References assert(), current_tests, self_test::failures, self_test::name, NULL, printf(), test, and self_test::total.
|
static |
Run self-test set.
Definition at line 77 of file test.c.
References assert(), self_test::assertion_failures, assertion_failures, current_tests, self_test::exec, self_test::failures, self_test::name, NULL, printf(), and self_test::total.
Referenced by run_all_tests().
|
static |
Run all self-tests.
| rc | Return status code |
Definition at line 116 of file test.c.
References _S2, self_test::assertion_failures, EINPROGRESS, self_test::failures, for_each_table_entry, printf(), profstat(), run_tests(), SELF_TESTS, and self_test::total.
Referenced by test_image_exec().
|
static |
Definition at line 169 of file test.c.
References DBG, rc, register_image(), strerror(), and test_image.
| struct init_fn test_init_fn __init_fn | ( | INIT_EARLY | ) |
Self-test initialisation function.
|
static |
Current self-test set.
Definition at line 46 of file test.c.
Referenced by run_tests(), and test_ok().
|
static |
|
static |
Definition at line 162 of file test.c.
Referenced by test_init().
1.8.15