Moved actual implementation of Test & TestSuite in internal/test.h
This commit is contained in:
parent
8bcc21e55c
commit
411bdb73df
2 changed files with 12 additions and 12 deletions
|
@ -32,34 +32,28 @@
|
||||||
# include "assert.h"
|
# include "assert.h"
|
||||||
# include "alloc.h"
|
# include "alloc.h"
|
||||||
|
|
||||||
# include "internal/test.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test(Suite, Name, [Options...]) { Function body }
|
|
||||||
*
|
|
||||||
* Defines a new test.
|
* Defines a new test.
|
||||||
*
|
*
|
||||||
* @param Suite The name of the test suite containing this test.
|
* @param Suite The name of the test suite containing this test.
|
||||||
* @param Name The name of the test.
|
* @param Name The name of the test.
|
||||||
* @param Options An optional sequence of designated initializer key/value
|
* @param ... An optional sequence of designated initializer key/value
|
||||||
* pairs as described in the `criterion_test_extra_data` structure
|
* pairs as described in the `criterion_test_extra_data` structure
|
||||||
* (see criterion/types.h).
|
* (see criterion/types.h).\n
|
||||||
* Example: .exit_code = 1
|
* Example: .exit_code = 1
|
||||||
*/
|
*/
|
||||||
# define Test(...) CR_EXPAND(CR_TEST_BASE(__VA_ARGS__, .sentinel_ = 0))
|
# define Test(Suite, Name, ...) <internal>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TestSuite(Name, [Options...]);
|
|
||||||
*
|
|
||||||
* Explicitely defines a test suite and its options.
|
* Explicitely defines a test suite and its options.
|
||||||
*
|
*
|
||||||
* @param Name The name of the test suite.
|
* @param Name The name of the test suite.
|
||||||
* @param Options An optional sequence of designated initializer key/value
|
* @param ... An optional sequence of designated initializer key/value
|
||||||
* pairs as described in the `criterion_test_extra_data` structure
|
* pairs as described in the `criterion_test_extra_data` structure
|
||||||
* (see criterion/types.h).
|
* (see criterion/types.h).
|
||||||
* These options will provide the defaults for each test.
|
* These options will provide the defaults for each test.
|
||||||
*/
|
*/
|
||||||
# define TestSuite(...) CR_EXPAND(CR_SUITE_BASE(__VA_ARGS__, .sentinel_ = 0))
|
# define TestSuite(Name, ...) <internal>
|
||||||
|
|
||||||
CR_BEGIN_C_API
|
CR_BEGIN_C_API
|
||||||
|
|
||||||
|
@ -122,4 +116,6 @@ extern const struct criterion_suite *const criterion_current_suite;
|
||||||
|
|
||||||
CR_END_C_API
|
CR_END_C_API
|
||||||
|
|
||||||
|
# include "internal/test.h"
|
||||||
|
|
||||||
#endif /* !CRITERION_H_ */
|
#endif /* !CRITERION_H_ */
|
||||||
|
|
|
@ -181,5 +181,9 @@ static const char *const cr_msg_test_fini_other_exception = "Caught some unexpec
|
||||||
struct criterion_suite *CR_SUITE_IDENTIFIER_(Name, ptr) \
|
struct criterion_suite *CR_SUITE_IDENTIFIER_(Name, ptr) \
|
||||||
= &CR_SUITE_IDENTIFIER_(Name, meta) CR_SECTION_SUFFIX_
|
= &CR_SUITE_IDENTIFIER_(Name, meta) CR_SECTION_SUFFIX_
|
||||||
|
|
||||||
|
# undef Test
|
||||||
|
# define Test(...) CR_EXPAND(CR_TEST_BASE(__VA_ARGS__, .sentinel_ = 0))
|
||||||
|
# undef TestSuite
|
||||||
|
# define TestSuite(...) CR_EXPAND(CR_SUITE_BASE(__VA_ARGS__, .sentinel_ = 0))
|
||||||
|
|
||||||
#endif /* !CRITERION_INTERNAL_TEST_H_ */
|
#endif /* !CRITERION_INTERNAL_TEST_H_ */
|
||||||
|
|
Loading…
Add table
Reference in a new issue