aboutsummaryrefslogtreecommitdiff
path: root/src/tests/utests/bam.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/utests/bam.lua')
-rw-r--r--src/tests/utests/bam.lua37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/tests/utests/bam.lua b/src/tests/utests/bam.lua
index 6137399..abbce88 100644
--- a/src/tests/utests/bam.lua
+++ b/src/tests/utests/bam.lua
@@ -1,21 +1,24 @@
-for _, name in pairs({
- "chan1", "chan2",
- "fs1", "fs2",
- "malloc",
- "subfs"
-}) do
- local map = "build/tests/utest_" .. name .. ".map"
+return function(s, kernel, lib)
+ local tests = {}
- local config = TableDeepCopy(user_settings)
- config.link.flags:Add( '-Xlinker -Map=' .. map,
- '-T src/sysbin/linker.ld')
+ for _, name in pairs({
+ "chan1", "chan2",
+ "fs1", "fs2",
+ "malloc",
+ "subfs"
+ }) do
+ local config = TableDeepCopy(s.user_settings)
+ config.link.flags:Add('-T src/lib/linker.ld')
- local obj = Compile(config, 'src/tests/utests/' .. name .. '/test.c')
- local bin = Link(config, 'tests/utest_' .. name, {obj, libkogata})
+ local obj = Compile(config, 'src/tests/utests/' .. name .. '/test.c')
+ local bin = Link(config, 'tests/utest_' .. name, {obj, lib.libkogata})
- local out = "build/tests/utest_"..name..".log"
- AddJob(out, "utest " .. name, "./src/tests/utests/run_qemu_test.sh " .. bin .. " " .. out .. " " .. map)
- AddDependency(out, bin)
- AddDependency(out, kernel)
- table.insert(tests, out)
+ local out = bin .. ".log"
+ AddJob(out, "utest " .. name, "./src/tests/utests/run_qemu_test.sh " .. bin .. " " .. out .. " " .. kernel)
+ AddDependency(out, bin)
+ AddDependency(out, kernel)
+ table.insert(tests, out)
+ end
+
+ return tests
end