JS test harness: 375/469 spec tests pass with full build
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 9s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 9s
- Add --full flag for full-spec build (includes continuations + types) - Add types module to JS SPEC_MODULES - 375 tests pass on JavaScript, 94 remaining failures are: 29 type platform stubs, 14 render format, 6 continuation aliases, 5 type system platform, 4 string primitive aliases - Full test build: hosts/javascript/cli.py --extensions continuations --spec-modules types --output sx-full-test.js Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,3 +13,4 @@ _snapshot/
|
|||||||
_debug/
|
_debug/
|
||||||
sx-haskell/
|
sx-haskell/
|
||||||
sx-rust/
|
sx-rust/
|
||||||
|
shared/static/scripts/sx-full-test.js
|
||||||
|
|||||||
@@ -48,11 +48,12 @@ SPEC_MODULES = {
|
|||||||
"page-helpers": ("page-helpers.sx", "page-helpers (pure data transformation helpers)"),
|
"page-helpers": ("page-helpers.sx", "page-helpers (pure data transformation helpers)"),
|
||||||
"frames": ("frames.sx", "frames (CEK continuation frames)"),
|
"frames": ("frames.sx", "frames (CEK continuation frames)"),
|
||||||
"cek": ("cek.sx", "cek (explicit CEK machine evaluator)"),
|
"cek": ("cek.sx", "cek (explicit CEK machine evaluator)"),
|
||||||
|
"types": ("types.sx", "types (gradual type system)"),
|
||||||
}
|
}
|
||||||
|
|
||||||
# Explicit ordering for spec modules with dependencies.
|
# Explicit ordering for spec modules with dependencies.
|
||||||
# Modules listed here are emitted in this order; any not listed use alphabetical.
|
# Modules listed here are emitted in this order; any not listed use alphabetical.
|
||||||
SPEC_MODULE_ORDER = ["deps", "frames", "page-helpers", "router", "cek", "signals"]
|
SPEC_MODULE_ORDER = ["deps", "frames", "page-helpers", "router", "cek", "signals", "types"]
|
||||||
|
|
||||||
|
|
||||||
EXTENSION_NAMES = {"continuations"}
|
EXTENSION_NAMES = {"continuations"}
|
||||||
|
|||||||
@@ -36,7 +36,15 @@ global.clearTimeout = clearTimeout;
|
|||||||
global.console = console;
|
global.console = console;
|
||||||
|
|
||||||
// Load the bootstrapped evaluator
|
// Load the bootstrapped evaluator
|
||||||
const jsPath = path.join(__dirname, "..", "..", "shared", "static", "scripts", "sx-browser.js");
|
// Use --full flag to load a full-spec build (if available)
|
||||||
|
const fullBuild = process.argv.includes("--full");
|
||||||
|
const jsPath = fullBuild
|
||||||
|
? path.join(__dirname, "..", "..", "shared", "static", "scripts", "sx-full-test.js")
|
||||||
|
: path.join(__dirname, "..", "..", "shared", "static", "scripts", "sx-browser.js");
|
||||||
|
if (fullBuild && !fs.existsSync(jsPath)) {
|
||||||
|
console.error("Full test build not found. Run: python3 hosts/javascript/cli.py --extensions continuations --spec-modules types --output shared/static/scripts/sx-full-test.js");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
const Sx = require(jsPath);
|
const Sx = require(jsPath);
|
||||||
if (!Sx || !Sx.parse) {
|
if (!Sx || !Sx.parse) {
|
||||||
console.error("Failed to load Sx evaluator");
|
console.error("Failed to load Sx evaluator");
|
||||||
@@ -95,6 +103,16 @@ env["make-continuation"] = function(fn) {
|
|||||||
env["continuation?"] = function(x) { return x != null && x._continuation === true; };
|
env["continuation?"] = function(x) { return x != null && x._continuation === true; };
|
||||||
env["continuation-fn"] = function(c) { return c.fn; };
|
env["continuation-fn"] = function(c) { return c.fn; };
|
||||||
|
|
||||||
|
// Render helpers
|
||||||
|
if (Sx.renderToHtml) {
|
||||||
|
env["render-html"] = function(expr, e) { return Sx.renderToHtml(expr, e || env); };
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type system helpers — available when types module is included
|
||||||
|
env["test-prim-param-types"] = function(name, types) { return null; };
|
||||||
|
env["component-param-types"] = function(c) { return c && c._paramTypes ? c._paramTypes : null; };
|
||||||
|
env["component-set-param-types!"] = function(c, t) { if (c) c._paramTypes = t; return null; };
|
||||||
|
|
||||||
// Platform test functions
|
// Platform test functions
|
||||||
env["try-call"] = function(thunk) {
|
env["try-call"] = function(thunk) {
|
||||||
try {
|
try {
|
||||||
@@ -142,7 +160,7 @@ for (const expr of frameworkExprs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determine which tests to run
|
// Determine which tests to run
|
||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2).filter(a => !a.startsWith("--"));
|
||||||
let testFiles = [];
|
let testFiles = [];
|
||||||
|
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user