Skip to content

Commit c1e1b3f

Browse files
committed
test/ci: wire JS into CI, add embedded-map sync check, drop dead tests
- flake check test-js: runs the full cross-impl test/test against the Node CLI (now passes thanks to the package.json type:module fix); JS was untested in CI. - flake check test-embedded-map-sync: regenerates character_map_embedded.h from character_map.txt and fails if it differs from the committed file (kills the manual-regen drift footgun the audit flagged). - remove 4 assertion-less JS 'tests' (test_format/test_performance/test_cross_compat/ test_web_encoder — zero assertions, not wired, false coverage) and the orphaned utils/xxhash32 (referenced nowhere; fuzz_test uses utils/prng).
1 parent 4d8f461 commit c1e1b3f

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

flake.nix

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,34 @@
296296
'';
297297
installPhase = "mkdir -p $out && touch $out/passed";
298298
};
299+
300+
test-js = pkgs.stdenv.mkDerivation {
301+
name = "test-js";
302+
src = ./.;
303+
nativeBuildInputs = with pkgs; [ nodejs_24 python3 xxd hexdump ];
304+
buildPhase = ''
305+
export HOME=$TMPDIR
306+
IMPLEMENTATION_TO_TEST=./bin/printable-binary-node.js bash ./test/test
307+
'';
308+
installPhase = "mkdir -p $out && touch $out/passed";
309+
};
310+
311+
# Guard against a stale generated C header: regenerating from
312+
# character_map.txt must reproduce the committed character_map_embedded.h.
313+
test-embedded-map-sync = pkgs.stdenv.mkDerivation {
314+
name = "test-embedded-map-sync";
315+
src = ./.;
316+
nativeBuildInputs = with pkgs; [ luajit ];
317+
buildPhase = ''
318+
cp character_map_embedded.h committed.h
319+
luajit utils/generate_embedded_map.lua
320+
if ! diff -q committed.h character_map_embedded.h; then
321+
echo "character_map_embedded.h is stale; run: luajit utils/generate_embedded_map.lua" >&2
322+
exit 1
323+
fi
324+
'';
325+
installPhase = "mkdir -p $out && touch $out/passed";
326+
};
299327
} // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
300328
test-ape = pkgs.stdenvNoCC.mkDerivation {
301329
name = "test-ape";

0 commit comments

Comments
 (0)