From d16209180486738187487737832ba5675d5935ce Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Mon, 11 Sep 2023 19:53:41 +0200 Subject: Add kit_test.h usage example --- source/kit/kit_test.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 -- cgit v1.2.3