summaryrefslogtreecommitdiffhomepage
path: root/tests/KernelTestKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-20 09:42:45 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-20 09:43:50 +0100
commit2e52124c0859a3a707f64b3a540f1164e33a63b2 (patch)
treeedf346b024470ddb7504d1ae5864ce9568b22cf8 /tests/KernelTestKit
parent710601cf021d5c1822a0c1ccd8869be7f4b78b3b (diff)
ADD: KernelTest Kit.
- This one is important to test the kernel before committing and pushing. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'tests/KernelTestKit')
-rw-r--r--tests/KernelTestKit/KernelTest.h33
1 files changed, 33 insertions, 0 deletions
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