#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include "tfm_log_raw.h"
#include "test_framework_helpers.h"
Go to the source code of this file.
#define TEST_FAIL |
( |
|
info_msg | ) |
set_test_failed(info_msg, __FILE__, __LINE__, ret) |
Runs the test.
- Parameters
-
[out] | ret | Test result value |
Definition at line 41 of file test_framework.h.
typedef void TESTSUITE_REG(struct test_suite_t *p_test_suite) |
Registers test in the testsuite structure and sets the name.
- Parameters
-
[in] | p_test_suite | Pointer to the p_test_suite_location. |
Definition at line 57 of file test_framework.h.
Enumerator |
---|
TEST_PASSED |
Test has passed
|
TEST_FAILED |
Test has failed
|
Definition at line 22 of file test_framework.h.
Enumerator |
---|
TEST_SUITE_ERR_NO_ERROR |
No error
|
TEST_SUITE_ERR_INVALID_DATA |
Invalid test suite if any of the pointers is NULL
|
TEST_SUITE_ERR_INVALID_TEST_DATA |
Invalid test if any of the pointers is NULL
|
TEST_SUITE_ERR_TEST_FAILED |
Last executed test has failed
|
Definition at line 69 of file test_framework.h.
Runs the given test suite.
- Parameters
-
[in,out] | test_suite | Test suite to run the list of tests and store test results. |
- Returns
- Returns error code as specified in test_suite_err_t
Definition at line 86 of file test_framework.c.
void set_test_failed |
( |
const char * |
info_msg, |
|
|
const char * |
filename, |
|
|
uint32_t |
line, |
|
|
struct test_result_t * |
ret |
|
) |
| |
Sets test failure state and information in the test_result_t structure.
- Parameters
-
[in] | info_msg | Information message to show |
[in] | filename | Filename where the error has ocurred |
[in] | line | Line in the file where the error has ocurred |
[out] | ret | Pointer to test_result_t structure to set the values |
- Note
- : If info_msg is "" or , info message is not shown. If filename is "", filename and line are not shown.
Definition at line 72 of file test_framework.c.
Sets test suite parameters.
- Parameters
-
[in] | name | Test suite name |
[in] | test_list | Pointer to the test list |
[in] | size | Test list size |
[in,out] | p_ts | Pointer to test suite object to fill in the parameters |
- Returns
- Returns error code as specified in test_suite_err_t
Definition at line 56 of file test_framework.c.
Prints all test in the the given test suite.
- Parameters
-
[in] | ts | Test suite to print the list of tests |
Translates the test suite error into a string.
- Parameters
-
- Returns
- error as string.
Definition at line 38 of file test_framework.c.