Template
feat: self-host configure generation for stupidtools
Wire the full pipeline into the binary: parse + validate the KDL buildfile, discover extensions, bridge Lua, detect the C toolchain, and emit ./configure. Adds the project's own stupid.kdl build file and a temp-dir-isolated self-host integration test proving the generated configure + make rebuild the tool with -std=c23. tests/run.sh tests 6+8 re-pin the interim 'accepted, no read' CLI assertions to the wired 'missing buildfile -> exit 1' behavior.
This commit is contained in:
+11
-7
@@ -98,11 +98,13 @@ else
|
||||
fail "no arguments exited rc=$noargs_rc (want 1): $noargs_out"
|
||||
fi
|
||||
|
||||
# --- 6. one positional buildfile must be accepted (exit 0, no read) ------
|
||||
if "$BIN" buildfile.kdl >/dev/null 2>&1; then
|
||||
pass "one positional buildfile is accepted (exit 0)"
|
||||
# --- 6. a missing buildfile is a runtime error (exit 1) -------------------
|
||||
"$BIN" buildfile.kdl >/dev/null 2>&1
|
||||
rc=$?
|
||||
if [ "$rc" -eq 1 ]; then
|
||||
pass "missing buildfile exits 1 (runtime error)"
|
||||
else
|
||||
fail "one positional buildfile was rejected (rc=$?)"
|
||||
fail "missing buildfile exited rc=$rc (want 1)"
|
||||
fi
|
||||
|
||||
# --- 7. --version=1 is an unknown option form -> exit 2 -------------------
|
||||
@@ -115,10 +117,12 @@ else
|
||||
fi
|
||||
|
||||
# --- 8. -- ends option parsing; following text is positional --------------
|
||||
if "$BIN" -- --bogus >/dev/null 2>&1; then
|
||||
pass "-- terminates option parsing (--bogus taken as buildfile)"
|
||||
"$BIN" -- --bogus >/dev/null 2>&1
|
||||
rc=$?
|
||||
if [ "$rc" -eq 1 ]; then
|
||||
pass "-- terminates option parsing (--bogus taken as a missing buildfile: rc=1, not 2)"
|
||||
else
|
||||
fail "-- --bogus exited non-zero (rc=$?)"
|
||||
fail "-- --bogus exited rc=$rc (want 1, proving --bogus was a buildfile not an option)"
|
||||
fi
|
||||
|
||||
# --- 9. two positionals are a usage error -> exit 2 -----------------------
|
||||
|
||||
Reference in New Issue
Block a user