summaryrefslogtreecommitdiff
path: root/source/kit_test/test.h
diff options
context:
space:
mode:
authorMitya Selivanov <0x7fffff@guattari.ru>2022-08-19 16:09:33 +0400
committerMitya Selivanov <0x7fffff@guattari.ru>2022-08-19 16:09:33 +0400
commit5ad5cb5a1b5642f40e3df158ff1979de8487dc10 (patch)
tree0be28d04e4af7a7cec160a79bfc80d3b2a23712e /source/kit_test/test.h
parent45459652d69f053ec5690a8a7734054c652934d3 (diff)
downloadkit-5ad5cb5a1b5642f40e3df158ff1979de8487dc10.zip
Signals for test environment
Diffstat (limited to 'source/kit_test/test.h')
-rw-r--r--source/kit_test/test.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/kit_test/test.h b/source/kit_test/test.h
index 176d957..2ef339f 100644
--- a/source/kit_test/test.h
+++ b/source/kit_test/test.h
@@ -19,18 +19,18 @@ extern "C" {
# define KIT_TEST_ASSERTIONS_LIMIT 0x50
#endif
-typedef void (*kit_test_report_fn)(int test_index, char const *file,
- int line, int ok);
+typedef void (*kit_test_report_fn)(int test_index, int line, int ok);
typedef void (*kit_test_run_fn)(
int kit_test_index_, kit_test_report_fn kit_test_report_fn_);
typedef struct {
char const *test_name;
+ char const *test_file;
kit_test_run_fn test_fn;
int assertions;
- char const *file[KIT_TEST_ASSERTIONS_LIMIT];
int line[KIT_TEST_ASSERTIONS_LIMIT];
int status[KIT_TEST_ASSERTIONS_LIMIT];
+ int signal;
} kit_test_case_t;
typedef struct {
@@ -75,7 +75,8 @@ extern kit_tests_list_t kit_tests_list;
# endif
#endif
-void kit_test_register(char const *name, kit_test_run_fn fn);
+void kit_test_register(char const *name, char const *file,
+ kit_test_run_fn fn);
#define KIT_TEST(name) \
static void KIT_TEST_CONCAT3_(kit_test_run_, __LINE__, \
@@ -84,16 +85,15 @@ void kit_test_register(char const *name, kit_test_run_fn fn);
KIT_TEST_ON_START_( \
KIT_TEST_CONCAT3_(kit_test_case_, __LINE__, KIT_TEST_FILE)) { \
kit_test_register( \
- name, \
+ name, __FILE__, \
KIT_TEST_CONCAT3_(kit_test_run_, __LINE__, KIT_TEST_FILE)); \
} \
static void KIT_TEST_CONCAT3_(kit_test_run_, __LINE__, \
KIT_TEST_FILE)( \
int kit_test_index_, kit_test_report_fn kit_test_report_fn_)
-#define KIT_REQUIRE(...) \
- kit_test_report_fn_(kit_test_index_, __FILE__, __LINE__, \
- (__VA_ARGS__))
+#define KIT_REQUIRE(...) \
+ kit_test_report_fn_(kit_test_index_, __LINE__, (__VA_ARGS__))
int kit_run_tests(int argc, char **argv);