From 8cdf1afb795cf4f2d6eb01fa6a533d9321adec59 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 21 Aug 2021 05:46:01 -0300 Subject: src/tests-lib.c: Move testing helper function and share it with other files --- src/tar.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/tar.c') diff --git a/src/tar.c b/src/tar.c index 6e231b0..63aebe8 100644 --- a/src/tar.c +++ b/src/tar.c @@ -1,18 +1,34 @@ #include "config.h" #include "tar.h" + #ifdef TEST + +#include "tests-lib.h" + +#include #include -#endif +#include -#ifdef TEST -static void unit_tests(void) { -} #endif + void a(void) { } #ifdef TEST +static void test_a(void) { + test_start("test_a:"); + { + testing("a"); + assert(true); + test_ok(); + } +} + +static void unit_tests(void) { + test_a(); +} + int main(void) { unit_tests(); return EXIT_SUCCESS; -- cgit v1.2.3