TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
test_framework.c File Reference
#include "test_framework.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for test_framework.c:

Go to the source code of this file.

Functions

const char * test_err_to_str (enum test_suite_err_t err)
 Translates the test suite error into a string. More...
 
enum test_suite_err_t set_testsuite (const char *name, struct test_t *test_list, uint32_t size, struct test_suite_t *p_ts)
 Sets test suite parameters. More...
 
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. More...
 
enum test_suite_err_t run_testsuite (struct test_suite_t *test_suite)
 Runs the given test suite. More...
 

Function Documentation

enum test_suite_err_t run_testsuite ( struct test_suite_t test_suite)

Runs the given test suite.

Parameters
[in,out]test_suiteTest 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.

Here is the call graph for this function:

Here is the caller graph for this function:

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_msgInformation message to show
[in]filenameFilename where the error has ocurred
[in]lineLine in the file where the error has ocurred
[out]retPointer 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.

enum test_suite_err_t set_testsuite ( const char *  name,
struct test_t test_list,
uint32_t  size,
struct test_suite_t p_ts 
)

Sets test suite parameters.

Parameters
[in]nameTest suite name
[in]test_listPointer to the test list
[in]sizeTest list size
[in,out]p_tsPointer 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.

Here is the caller graph for this function:

const char* test_err_to_str ( enum test_suite_err_t  err)

Translates the test suite error into a string.

Parameters
[in]errError value test_suite_err_t
Returns
error as string.

Definition at line 38 of file test_framework.c.