diff options
author | s-over-4 | 2023-07-10 01:00:53 -0400 |
---|---|---|
committer | s-over-4 | 2023-07-10 01:00:53 -0400 |
commit | 497a3b690c3828775ad1d141f53484a748d5b61a (patch) | |
tree | cb81866944c5a2e4358a7c321ab73bc7c4a71f64 /src | |
parent | fa403b3fb6ff14dbed73d815684d6935c3c19717 (diff) |
made a test framework (HLKT) (2)
Diffstat (limited to 'src')
-rw-r--r-- | src/include/hlkt.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/include/hlkt.h b/src/include/hlkt.h index 295e5f4..4496ce1 100644 --- a/src/include/hlkt.h +++ b/src/include/hlkt.h @@ -1,8 +1,6 @@ #ifndef HLKT_H #define HLKT_H -#include <time.h> - #include "util.h" static int hlkt_run = 0; /* number of tests run */ @@ -10,20 +8,20 @@ static int hlkt_failed = 0; /* number of tests that have failed */ #define HLKT_HIDE(stuff) do { stuff } while (0) -#define HLKT_LOG() HLKT_HIDE( \ - if ((hlkt_run > 0) && (hlkt_failed > 0)) { \ - log_war("HLKT: %d/%d tests failed", hlkt_failed, hlkt_run); \ - } else { \ - log_inf("HLKT: all %d tests passed", hlkt_run); \ - } \ +#define HLKT_LOG() HLKT_HIDE( \ + if ((hlkt_run > 0) && (hlkt_failed > 0)) { \ + log_war("HLKT: %d/%d tests failed", hlkt_failed, hlkt_run); \ + } else { \ + log_inf("HLKT: all %d tests passed", hlkt_run); \ + } \ ) -#define HLKT_ASS(pred) HLKT_HIDE( \ - hlkt_run ++; \ - if (! pred) { \ - hlkt_failed ++; \ - log_err("HLKT: test [%s] failed: %s:%s:%d", #pred, __FILE__, __func__, __LINE__);\ - } \ +#define HLKT_ASS(pred) HLKT_HIDE( \ + hlkt_run ++; \ + if (! pred) { \ + hlkt_failed ++; \ + log_err("HLKT: test [%s] failed: %s:%s:%d", #pred, __FILE__, __func__, __LINE__); \ + } \ ) #endif |