Convert the inn test to work with the test library and not import InOut; it now
authorDavid Given <dg@cowlark.com>
Sun, 11 Dec 2016 22:06:37 +0000 (23:06 +0100)
committerDavid Given <dg@cowlark.com>
Sun, 11 Dec 2016 22:06:37 +0000 (23:06 +0100)
runs on qemuppc again. Reenable qemuppc tests.

build.lua
tests/plat/bugs/bug-22-inn_mod.mod
tests/plat/build.lua
tests/plat/lib/Test.def [new file with mode: 0644]
tests/plat/lib/build.lua [deleted file]

index 91415d6..6364e5f 100644 (file)
--- a/build.lua
+++ b/build.lua
@@ -18,7 +18,7 @@ vars.plats = {
 vars.plats_with_tests = {
        "linux386",
        "linuxppc",
-       -- "qemuppc", FIXME: disable until we figure out why qemu won't run binaries bigger than 4kB
+       "qemuppc",
        "pc86",
 }
 
index 8f3a2d0..53fe935 100644 (file)
@@ -1,5 +1,5 @@
 MODULE test;
-FROM InOut IMPORT WriteLn, WriteString;
+FROM Test IMPORT fail, finished;
 
 TYPE charset = SET OF CHAR;
 
@@ -10,17 +10,13 @@ END Space;
 
 BEGIN
   IF Space('a') THEN
-    WriteString("@@FAIL 1");
-    WriteLn;
+    fail(1);
   END;
   IF NOT Space(' ') THEN
-    WriteString("@@FAIL 2");
-    WriteLn;
+    fail(2);
   END;
   IF NOT Space(12C) THEN
-    WriteString("@@FAIL 3");
-    WriteLn;
+    fail(3);
   END;
-  WriteString("@@FINISHED");
-  WriteLn;
+  finished;
 END test.
\ No newline at end of file
index d8362b3..3f43fb9 100644 (file)
@@ -18,7 +18,10 @@ definerule("plat_testsuite",
                acklibrary {
                        name = "lib",
                        srcs = { "tests/plat/lib/test.c" },
-                       hdrs = { "tests/plat/lib/test.h" },
+                       hdrs = {
+                               "tests/plat/lib/test.h",
+                               "tests/plat/lib/Test.def"
+                       },
                        vars = { plat = e.plat },
                }
 
diff --git a/tests/plat/lib/Test.def b/tests/plat/lib/Test.def
new file mode 100644 (file)
index 0000000..cab31f2
--- /dev/null
@@ -0,0 +1,6 @@
+(*$Foreign*)
+DEFINITION MODULE Test;
+  PROCEDURE finished();
+  PROCEDURE writehex(code: LONGINT);
+  PROCEDURE fail(code: LONGINT);
+END Test.
diff --git a/tests/plat/lib/build.lua b/tests/plat/lib/build.lua
deleted file mode 100644 (file)
index be9928c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-include("plat/build.lua")
-
-acklibrary {
-       name = "lib",
-       srcs = { "./test.c" },
-       hdrs = { "./test.h" },
-}