1 /******************************************************************************
4 * Company XS Embedded GmbH
5 *****************************************************************************/
6 /******************************************************************************
7 * This Source Code Form is subject to the terms of the
8 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
9 * with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 ******************************************************************************/
12 * @file pers_test_base.h
13 * @ingroup Persistence client library test
15 * @brief Test of persistence client library
20 #ifndef PERSBASETEST_H_
21 #define PERSBASETEST_H_
30 #define MAGIC_STRING "$$XS_TEST$$"
43 * @brief: Report name of test. This has to be reported first.
46 #define X_TEST_REPORT_TEST_ID(ID) do { \
47 printf (MAGIC_STRING"%s", ID); \
52 * @brief: Report name of test. This has to be reported first.
55 #define X_TEST_REPORT_TEST_NAME_ID(ID, ...) do { \
56 printf (MAGIC_STRING"%s$$", ID); \
57 printf ("testName:%s", __VA_ARGS__); \
62 * @brief: Path to root of source code directory under test
65 #define X_TEST_REPORT_PATH_ID(ID, ...) do { \
66 printf (MAGIC_STRING"%s$$", ID); \
67 printf ("path:"__VA_ARGS__); \
72 * @brief: Name of subcomponent under test, leave empty or set value NONE if not suitable for a COMPONENT test
75 #define X_TEST_REPORT_COMP_NAME_ID(ID, ...) do { \
76 printf (MAGIC_STRING"%s$$", ID); \
77 printf ("compName:"__VA_ARGS__); \
82 * @brief: Name of class or file under test, leave empty or set value NONE for a COMPONENT test
85 #define X_TEST_REPORT_FILE_NAME_ID(ID, ...) do { \
86 printf (MAGIC_STRING"%s$$", ID); \
87 printf ("fileName:"__VA_ARGS__); \
92 * @brief: If information exists: Reference to a requirement, feature or bug ID. Else leave empty or set value NONE
95 #define X_TEST_REPORT_REFERENCE_ID(ID, ...) do { \
96 printf (MAGIC_STRING"%s$$", ID); \
97 printf ("ref:"__VA_ARGS__); \
102 * @brief: A short description of test case.
103 * Do not leave empty, can also be a internal department Test ID like CORE-OS-BOOT-0001
106 #define X_TEST_REPORT_DESCRIPTION_ID(ID, ...) do { \
107 printf (MAGIC_STRING"%s$$", ID); \
108 printf ("desc:"__VA_ARGS__); \
113 * @brief: Reports weather this is a UNIT or a COMPONENT test
116 #define X_TEST_REPORT_KIND_ID(ID, kind) do { \
117 printf (MAGIC_STRING"%s$$kind:%s\n", ID, kind==UNIT?"UNIT":kind==COMPONENT?"COMPONENT":"NONE"); \
121 * @brief: valid values: PASSED, FAILED or NONE. PASSED if test result is ok, FAILED if test result is not as expected, NONE if no test exists for whole file or class
124 #define X_TEST_REPORT_RESULT_ID(ID, result) do { \
125 printf (MAGIC_STRING"%s$$result:%s\n", ID, result==PASSED?"PASSED":result==FAILED?"FAILED":"NONE"); \
129 * @brief: Additional information, if test "just" checks common information flow inside structure (GOOD test case) or if structure is tested with invalid or border values(BORDER)
132 #define X_TEST_REPORT_TYPE_ID(ID, type) do { \
133 printf (MAGIC_STRING"%s$$type:%s\n", ID, type==BORDER?"BORDER":"GOOD"); \
140 #endif /* PERSBASETEST_H_ */