From 2e52124c0859a3a707f64b3a540f1164e33a63b2 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 20 Mar 2025 09:42:45 +0100 Subject: ADD: KernelTest Kit. - This one is important to test the kernel before committing and pushing. Signed-off-by: Amlal El Mahrouss --- tests/KernelTestKit/KernelTest.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/KernelTestKit/KernelTest.h (limited to 'tests/KernelTestKit') diff --git a/tests/KernelTestKit/KernelTest.h b/tests/KernelTestKit/KernelTest.h new file mode 100644 index 00000000..3fb0f3de --- /dev/null +++ b/tests/KernelTestKit/KernelTest.h @@ -0,0 +1,33 @@ +/* ------------------------------------------- + + Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#define NE_TEST_VERSION_BCD (0x0001) +#define NE_TEST_VERSION "0.0.1" + +#define NE_TEST_FAILURE (1) + +#define NE_TEST_SUCCESS (0) + +#define NE_DECL_TEST(NAME, FN) \ + class NAME final \ + { \ + public: \ + int Run(); \ + const char* ToString(); \ + }; \ + inline int NAME::Run() \ + { \ + return FN() == 0; \ + } \ + inline const char* NAME::ToString() \ + { \ + return #FN; \ + } + +NE_DECL_TEST(ALWAYS_BREAK, []() -> bool { return false; }); +NE_DECL_TEST(ALWAYS_GOOD, []() -> bool { return true; }); \ No newline at end of file -- cgit v1.2.3