New tooling

Entry: scripts/run-bin.mjs
Preload shim (must load first): scripts/run-bin-prelude.mjs
Harness: scripts/lib/run-bin-harness.mjs

Usage:

node scripts/run-bin.mjs ls -la /bin
node scripts/run-bin.mjs cat /etc/passwd
node scripts/run-bin.mjs --cmd sed -n '1,5p' /home/user/note.txt
node scripts/run-bin.mjs --json echo "hello"
printf 'a\nb\n' | node scripts/run-bin.mjs cat
npm run test:coreutils -- --suite basic
npm run test:coreutils -- --build --watch -- echo test   # rebuild + watch src/<cmd>.js (use `--buil
This commit is contained in:
Raven Scott
2026-04-27 21:32:50 -04:00
parent 93742db1cc
commit ff9ab499a2
15 changed files with 926 additions and 6 deletions
+51
View File
@@ -0,0 +1,51 @@
{
"schema": 1,
"cases": [
{
"id": "echo-text",
"argv": ["echo", "bare-os-run-bin"],
"expect": {
"exitCode": 0,
"stdoutIncludes": "bare-os-run-bin"
}
},
{
"id": "pwd-root",
"argv": ["pwd"],
"expect": {
"exitCode": 0,
"stdoutIncludes": "/"
}
},
{
"id": "true-exit",
"argv": ["true"],
"expect": {
"exitCode": 0
}
},
{
"id": "false-exit",
"argv": ["false"],
"expect": {
"exitCode": 1
}
},
{
"id": "cat-note",
"argv": ["cat", "/home/user/note.txt"],
"expect": {
"exitCode": 0,
"stdoutIncludes": "hello from fixture layout"
}
},
{
"id": "grep-home",
"argv": ["grep", "hello", "/home/user/note.txt"],
"expect": {
"exitCode": 0,
"stdoutIncludes": "hello"
}
}
]
}
@@ -0,0 +1 @@
optional overlay file for suites that set "fixture": "with-extra"