summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-29 17:27:19 -0500
committerAmlal El Mahrouss <amlal@nekernel.org>2025-11-29 17:27:19 -0500
commitdad25544802de6d4cd839f5d6d5753ad7faeef97 (patch)
treeac60308829c163689c47da059d5de14296d81f4e /tests
parentbdef578a578177ce95c01fa061a028292556ecbe (diff)
chore: update general specs and citation file, breaking project structure changes as well.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/samples/sample.asm4
-rw-r--r--tests/test_01_codegen/codegen_test.cc6
-rw-r--r--tests/test_02_linker/linker_test.cc12
3 files changed, 18 insertions, 4 deletions
diff --git a/tests/samples/sample.asm b/tests/samples/sample.asm
new file mode 100644
index 0000000..82c0320
--- /dev/null
+++ b/tests/samples/sample.asm
@@ -0,0 +1,4 @@
+public_segment .code64 __ImageStart
+ ;; rax is the return value register.
+ mov rax, 5
+ ret \ No newline at end of file
diff --git a/tests/test_01_codegen/codegen_test.cc b/tests/test_01_codegen/codegen_test.cc
index 89afd8d..6cbea22 100644
--- a/tests/test_01_codegen/codegen_test.cc
+++ b/tests/test_01_codegen/codegen_test.cc
@@ -10,5 +10,9 @@
#include <gtest/gtest.h>
TEST(CodegenTest, BasicCodegenTest) {
-
+ /// compile asm
+ {
+ auto expr = std::system("asm sample/sample.asm");
+ EXPECT_TRUE(expr == 0) << "ASM Driver did not compile the easy ASM unit.";
+ }
}
diff --git a/tests/test_02_linker/linker_test.cc b/tests/test_02_linker/linker_test.cc
index cc580a3..a6b0387 100644
--- a/tests/test_02_linker/linker_test.cc
+++ b/tests/test_02_linker/linker_test.cc
@@ -9,14 +9,20 @@
#include <gtest/gtest.h>
+/// c++
TEST(LinkerTest, BasicLinkTest) {
- /// @note this is the driver, it will look for a .cc.pp (.pp stands for pre-processed)
auto expr = std::system("pef-amd64-cxxdrv sample/sample.cc");
EXPECT_TRUE(expr == 0) << "C++ Driver did not compile the easy C++ unit.";
+}
- expr = std::system("asm -asm:x64 sample/sample.cc.pp.masm");
+/// assemble
+TEST(LinkerTest, BasicLinkTest2) {
+ auto expr = std::system("asm -asm:x64 sample/sample.cc.pp.masm");
EXPECT_TRUE(expr == 0) << "Assembler did not assemble the easy asm unit.";
+}
- expr = std::system("ld64 -amd64 sample/sample.cc.pp.obj -start __NECTI_main -output main.exec");
+/// link
+TEST(LinkerTest, BasicLinkTest3) {
+ auto expr = std::system("ld64 -amd64 sample/sample.cc.pp.obj -start __NECTI_main -output main.exec");
EXPECT_TRUE(expr == 0) << "Linker did not link the easy object.";
}