aboutsummaryrefslogtreecommitdiff
path: root/src/tests/ktests/bam.lua
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-30 23:17:12 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-30 23:17:12 +0200
commitf58f65c30de315d4419f69a92a708cbed797ff37 (patch)
treeefaaa82089523dc0f7a3b9a6ab4c963550f9b241 /src/tests/ktests/bam.lua
parentfa5327d4cc5e47656326b8c0c55d23cd71b04462 (diff)
downloadkogata-f58f65c30de315d4419f69a92a708cbed797ff37.tar.gz
kogata-f58f65c30de315d4419f69a92a708cbed797ff37.zip
Release mode (enables some optimizations) ; fix tests.
Diffstat (limited to 'src/tests/ktests/bam.lua')
-rw-r--r--src/tests/ktests/bam.lua61
1 files changed, 32 insertions, 29 deletions
diff --git a/src/tests/ktests/bam.lua b/src/tests/ktests/bam.lua
index b721a8b..c1be337 100644
--- a/src/tests/ktests/bam.lua
+++ b/src/tests/ktests/bam.lua
@@ -1,35 +1,38 @@
-local obj_nokmain = {}
-for name in TableWalk(kernel_obj) do
- if not name:find('kmain') then
- table.insert(obj_nokmain, name)
+return function(s, common, kernel_obj)
+ local tests = {}
+
+ local obj_nokmain = {}
+ for name in TableWalk(kernel_obj) do
+ if not name:find('kmain') then
+ table.insert(obj_nokmain, name)
+ end
end
-end
-for _, name in pairs({
- "breakpoint",
- "btree1", "btree2",
- "cmdline",
- "hashtbl1", "hashtbl2",
- "kmalloc",
- "region1"
-}) do
- local map = "build/tests/ktest_" .. name .. ".map"
+ for _, name in pairs({
+ "breakpoint",
+ "btree1", "btree2",
+ "cmdline",
+ "hashtbl1", "hashtbl2",
+ "kmalloc",
+ "region1"
+ }) do
+ local test_config = TableDeepCopy(s.common_settings)
+ test_config.cc.includes:Add("src/kernel/include",
+ "src/common/include/kogata",
+ "src/tests/ktests/"..name)
+ test_config.cc.flags:Add('-DBUILD_KERNEL_TEST')
+ test_config.link.flags:Add("-T src/kernel/linker.ld")
+ test_config.cc.extension = ".ktest_" .. name .. ".o"
- 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 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 = bin .. ".log"
+ AddJob(out, "ktest " .. name, "./src/tests/ktests/run_qemu_test.sh " .. bin .. " " .. out)
+ AddDependency(out, bin)
+ table.insert(tests, out)
+ end
- 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)
+ return tests
end
-