diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2023-09-11 19:53:41 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2023-09-11 19:53:41 +0200 |
commit | d16209180486738187487737832ba5675d5935ce (patch) | |
tree | 7fed363ab8b42466348b876fc7001c3273ef48c0 | |
parent | cf853bea908830194065349f3a8a75e163aea5b9 (diff) | |
download | kit-d16209180486738187487737832ba5675d5935ce.zip |
Add kit_test.h usage example
-rw-r--r-- | source/kit/kit_test.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/kit/kit_test.h b/source/kit/kit_test.h index a6bf2ea..b102b73 100644 --- a/source/kit/kit_test.h +++ b/source/kit/kit_test.h @@ -5,11 +5,13 @@ // // Header-only unit-testing and microbenchmarks framework for C. // +// // - Define a unique KIT_TEST_FILE for each file to avoid name // collisions. // // - Define KIT_TEST_IMPLEMENTATION to include the implementation. // +// // Optional settings // // - KIT_TESTS_SIZE_LIMIT @@ -20,6 +22,24 @@ // - KIT_BENCH_REPEATS_DEFAULT_1 // - KIT_BENCH_REPEATS_DEFAULT_2 // +// +// Usage example +// +// // foo.test.c +// #define KIT_TEST_FILE // This is required if you want to use +// // multiple test files. +// #include "kit_test.h" +// TEST("foo") { +// REQUIRE(1); +// REQUIRE_EQ(2 + 2, 4); +// } +// +// // main.c +// #include "kit_test.h" +// int main(int argc, char **argv) { +// return run_tests(argc, argv); +// } +// // ================================================================ // // The MIT License |