aboutsummaryrefslogtreecommitdiff
path: root/src/tests/ktests/bam.lua
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-13 22:31:46 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-13 22:31:46 +0200
commit360da84db0d7165c84d160b518f39cd16006c758 (patch)
treea6fea5da753ec4ac5a37237cefda52801f9647ac /src/tests/ktests/bam.lua
parent27a6934ea3073c3eaf782cc7615ce4ed0dbf4a18 (diff)
downloadkogata-360da84db0d7165c84d160b518f39cd16006c758.tar.gz
kogata-360da84db0d7165c84d160b518f39cd16006c758.zip
Migrate to BAM build tool
Diffstat (limited to 'src/tests/ktests/bam.lua')
-rw-r--r--src/tests/ktests/bam.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/tests/ktests/bam.lua b/src/tests/ktests/bam.lua
new file mode 100644
index 0000000..b721a8b
--- /dev/null
+++ b/src/tests/ktests/bam.lua
@@ -0,0 +1,35 @@
+local obj_nokmain = {}
+for name in TableWalk(kernel_obj) do
+ if not name:find('kmain') then
+ table.insert(obj_nokmain, name)
+ end
+end
+
+for _, name in pairs({
+ "breakpoint",
+ "btree1", "btree2",
+ "cmdline",
+ "hashtbl1", "hashtbl2",
+ "kmalloc",
+ "region1"
+}) do
+ local map = "build/tests/ktest_" .. name .. ".map"
+
+ local test_config = TableDeepCopy(common_settings)
+ test_config.cc.includes:Add("src/kernel/include",
+ "src/tests/ktests/"..name)
+ test_config.cc.flags:Add('-DBUILD_KERNEL_TEST')
+ test_config.link.flags:Add("-T src/kernel/linker.ld",
+ "-Xlinker -Map=" .. map)
+ test_config.cc.extension = ".ktest_" .. name .. ".o"
+
+ local kmain = Compile(test_config, "src/kernel/core/kmain.c")
+ local bin = Link(test_config, "tests/ktest_"..name,
+ {obj_nokmain, kmain, common_libkogata, common_libc, common_libalgo})
+
+ local out = "build/tests/ktest_"..name..".log"
+ AddJob(out, "ktest " .. name, "./src/tests/ktests/run_qemu_test.sh " .. bin .. " " .. out .. " " .. map)
+ AddDependency(out, bin)
+ table.insert(tests, out)
+end
+