19 #ifndef UTEST_SPECIFICATION_H 20 #define UTEST_SPECIFICATION_H 25 #include "utest/utest_types.h" 26 #include "utest/utest_case.h" 27 #include "utest/utest_default_handlers.h" 51 template<
size_t N,
typename CaseType >
55 cases(static_cast<const Case*>(static_cast<const CaseType*>(cases))), length(N),
59 sizeof(CaseType) ==
sizeof(
Case),
60 "CaseType and Case should have the same size" 64 template<
size_t N,
typename CaseType >
65 Specification(
const CaseType (&cases)[N],
69 cases(static_cast<const Case*>(static_cast<const CaseType*>(cases))), length(N),
73 sizeof(CaseType) ==
sizeof(
Case),
74 "CaseType and Case should have the same size" 78 template<
size_t N,
typename CaseType >
79 Specification(
const CaseType (&cases)[N],
83 cases(static_cast<const Case*>(static_cast<const CaseType*>(cases))), length(N),
87 sizeof(CaseType) ==
sizeof(
Case),
88 "CaseType and Case should have the same size" 92 template<
size_t N,
typename CaseType >
93 Specification(
const CaseType (&cases)[N],
97 setup_handler(
default_handler), teardown_handler(teardown_handler), failure_handler(failure_handler),
98 cases(static_cast<const Case*>(static_cast<const CaseType*>(cases))), length(N),
102 sizeof(CaseType) ==
sizeof(
Case),
103 "CaseType and Case should have the same size" 107 template<
size_t N,
typename CaseType >
109 const CaseType (&cases)[N],
112 cases(static_cast<const Case*>(static_cast<const CaseType*>(cases))), length(N),
116 template<
size_t N,
typename CaseType >
118 const CaseType (&cases)[N],
121 setup_handler(setup_handler), teardown_handler(
default_handler), failure_handler(failure_handler),
122 cases(static_cast<const Case*>(static_cast<const CaseType*>(cases))), length(N),
126 sizeof(CaseType) ==
sizeof(
Case),
127 "CaseType and Case should have the same size" 131 template<
size_t N,
typename CaseType >
133 const CaseType (&cases)[N],
136 setup_handler(setup_handler), teardown_handler(teardown_handler), failure_handler(
default_handler),
137 cases(static_cast<const Case*>(static_cast<const CaseType*>(cases))), length(N),
141 sizeof(CaseType) ==
sizeof(
Case),
142 "CaseType and Case should have the same size" 146 template<
size_t N,
typename CaseType >
148 const CaseType (&cases)[N],
152 setup_handler(setup_handler), teardown_handler(teardown_handler), failure_handler(failure_handler),
153 cases(static_cast<const Case*>(static_cast<const CaseType*>(cases))), length(N),
157 sizeof(CaseType) ==
sizeof(
Case),
158 "CaseType and Case should have the same size" 168 setup_handler(setup_handler), teardown_handler(teardown_handler), failure_handler(failure_handler),
169 cases(cases), length(length),
178 const Case *
const cases;
188 #endif // UTEST_SPECIFICATION_H
static const struct utest::v1::@357 default_handler
Default handler hint.
utest::v1::status_t(* test_setup_handler_t)(const size_t number_of_cases)
Test setup handler.
void(* test_teardown_handler_t)(const size_t passed, const size_t failed, const failure_t failure)
Test teardown handler.
const handlers_t & default_handlers
The greentea aborting handlers are the default.
void(* test_failure_handler_t)(const failure_t reason)
Test failure handler.
Test specification containing the setup and teardown handlers and test cases.