summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml (renamed from .github/workflows/maven.yml)7
-rw-r--r--README.md6
-rw-r--r--chapter25/Makefile2
-rw-r--r--chapter25/src/test/java/com/seaofnodes/simple/Chapter21Test.java2
-rw-r--r--chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java5
-rw-r--r--skills/chapter25-codex-notes.md4
6 files changed, 16 insertions, 10 deletions
diff --git a/.github/workflows/maven.yml b/.github/workflows/ci.yml
index 26c2a083..67ab702c 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,4 @@
-name: Java CI with Maven
+name: Java CI with Make
on: [ push, pull_request ]
@@ -14,6 +14,5 @@ jobs:
with:
java-version: '21'
distribution: 'temurin'
- cache: 'maven'
- - name: Build with Maven
- run: mvn --batch-mode --update-snapshots verify
+ - name: Build and test all chapters
+ run: make lib tests CTAGS=
diff --git a/README.md b/README.md
index e75fa42a..ef31f64e 100644
--- a/README.md
+++ b/README.md
@@ -78,7 +78,11 @@ Chapters 10a, 10b, and 18–25 launch it with `make view` from the chapter direc
The top-level Makefile runs each chapter's `tests`, `tags` (also `tag`),
`release`, or `lib` target. Start with `make lib` on a fresh checkout, then
-`make tests`.
+`make tests`.
+
+CI runs `make lib tests CTAGS=` on Linux with JDK 21. The Make targets also build
+Chapter 25's native runtime and `sys` library before running the tests that use
+them; Maven's Java build alone does not produce those prerequisites.
The [chapter backport queue](docs/chapter-backports.md) records proposed small
corrections and the per-chapter test/review workflow. Larger architectural moves
diff --git a/chapter25/Makefile b/chapter25/Makefile
index fb71fc6b..14a4c2a2 100644
--- a/chapter25/Makefile
+++ b/chapter25/Makefile
@@ -146,7 +146,7 @@ $(CLZDIR)/test/.ttag: $(test_javas) $(CLZDIR)/main/.mtag
OBJS:= build/objs
SYS_SMPS:= $(wildcard src/main/smp/*.smp src/main/smp/*/*.smp src/main/smp/*/*/*.smp)
CPU_PORT:= x86_64_v2
-CALL_CONV:= win64
+CALL_CONV:= $(if $(filter Windows_NT,$(OS)),win64,SystemV)
CPU_ABI:= $(CPU_PORT)_$(CALL_CONV)
RELEASE:= build/release
TEST_SYS:= $(OBJS)/lib_$(CPU_ABI)/sys.o
diff --git a/chapter25/src/test/java/com/seaofnodes/simple/Chapter21Test.java b/chapter25/src/test/java/com/seaofnodes/simple/Chapter21Test.java
index 08da0654..a400dc5f 100644
--- a/chapter25/src/test/java/com/seaofnodes/simple/Chapter21Test.java
+++ b/chapter25/src/test/java/com/seaofnodes/simple/Chapter21Test.java
@@ -424,7 +424,7 @@ val test_sqrt = { flt x ->
}
};
""";
- TestC.runC(src, "newtonFloat", result, 42);
+ TestC.runC(src, "newtonFloat", result, TestC.CALL_CONVENTION.equals("win64") ? 42 : 34);
EvalRisc5 R5 = TestRisc5.build( src, "test_sqrt", 0, 10, false);
R5.fregs[riscv.FA0 - riscv.F_OFFSET] = 3.0;
diff --git a/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java b/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java
index 346c503a..7158ace0 100644
--- a/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java
+++ b/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java
@@ -98,7 +98,7 @@ public class Chapter25Test {
new CodeGen(root.toString(),root.toString(),imported ? paths : null,"Main",src,126,true,TypeInteger.BOT)
.driver(TestC.CPU_PORT,TestC.CALL_CONVENTION,false,false);
assertEquals("",TestC.gcc(root+"/Main.o","",TestC.C_DRIVERS_DIR+"extern_data_import.c",
- (String)null,new Ary<>(new String[]{dir+"/Globals.o"}),root+"/main"+(TestC.OS.startsWith("Windows") ? ".exe" : "")));
+ (String)null,new Ary<>(new String[]{dir+"/Globals.o"}),root+"/program"+(TestC.OS.startsWith("Windows") ? ".exe" : "")));
}
}
@@ -364,8 +364,7 @@ public class Chapter25Test {
String syms = run(new String[]{"nm",obj});
assertTrue(syms, syms.contains(" U sys.io.p_noInline"));
- String out = run(new String[]{"gcc",obj,SYS_FILE.toString(),TestC.runtimeObject(),"-lm","-g","-o",exe});
- assertEquals("",out);
+ TestC.linkExe(obj,null,null,new Ary<>(new String[]{SYS_FILE.toString()}),exe);
String rez = run(new String[]{exe});
assertEquals(expected,rez);
}
diff --git a/skills/chapter25-codex-notes.md b/skills/chapter25-codex-notes.md
index d4f9bf2c..041eba8f 100644
--- a/skills/chapter25-codex-notes.md
+++ b/skills/chapter25-codex-notes.md
@@ -711,6 +711,10 @@ Consequences:
`helloWorld`, Chapter25Test uses `helloWorldSys`, and driver variants have
separate output directories. `NativeExecutionTest` covers overwriting an
executable between link and execution, full exit statuses, and driver errors.
+9. CI uses `make lib tests CTAGS=` so native runtime and sys prerequisites are
+ built. Chapter 25's default ABI must match TestC: win64 on Windows, SystemV
+ elsewhere. Native spill expectations can differ by ABI (Newton is 42/34);
+ validate Linux as well as Windows when changing native test setup.
Useful test ladder: