test(corpus): Java oracle — FILIUS 2.14 reads the corpus itself
tools/java-oracle builds FILIUS at 6640354 and loads every .fls through its own private loader under Xvfb. All 23 files load with every node positioned and every cable resolved (Swift: 20 of 25 nodes in the Internet example). MAC addresses FILIUS generates are left out, so two runs are byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
# Reads every .fls under corpus/ with Java FILIUS itself and writes
|
||||
# corpus/corpus.java.json. Java is the arbiter for the file format (plan §13, M2).
|
||||
# Needs a JDK (17+), Maven and xvfb-run: FILIUS opens its main window while
|
||||
# loading (Information.reset → JMainFrame), so it needs a display, not headless.
|
||||
set -eu
|
||||
here="$(cd "$(dirname "$0")" && pwd)"
|
||||
root="$(cd "$here/../.." && pwd)"
|
||||
commit=6640354
|
||||
upstream="$here/.upstream"
|
||||
if [ ! -d "$upstream/.git" ]; then
|
||||
git clone -q https://gitlab.com/filius1/filius.git "$upstream"
|
||||
fi
|
||||
if [ "$(git -C "$upstream" rev-parse --short=7 HEAD)" != "$commit" ]; then
|
||||
git -C "$upstream" fetch -q origin
|
||||
git -C "$upstream" checkout -q "$commit"
|
||||
rm -rf "$upstream/target"
|
||||
fi
|
||||
if [ ! -f "$upstream/target/filius.jar" ]; then
|
||||
(cd "$upstream" && mvn -q -DskipTests package dependency:copy-dependencies -DoutputDirectory=target/lib)
|
||||
fi
|
||||
classpath="$upstream/target/filius.jar:$upstream/target/lib/*"
|
||||
mkdir -p "$here/.build"
|
||||
javac -d "$here/.build" -cp "$classpath" "$here/src/FlsOracle.java"
|
||||
# FILIUS writes its settings below $HOME; keep them out of the real one.
|
||||
mkdir -p "$here/.build/home"
|
||||
# Removed first: a crashed run must not leave the previous result standing.
|
||||
rm -f "$root/corpus/corpus.java.json"
|
||||
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" FlsOracle \
|
||||
"$root/corpus" "$root/corpus/corpus.java.json" 2>&1 | grep -v 'logback\|^$' || true
|
||||
test -s "$root/corpus/corpus.java.json"
|
||||
Reference in New Issue
Block a user