diff --git a/build.zig b/build.zig index a1e819fe..9c621c53 100644 --- a/build.zig +++ b/build.zig @@ -99,6 +99,7 @@ pub fn build(b: *std.build.Builder) !void { const test_dir = try fs.Dir.openIterableDir(fs.cwd(), test_path, .{ .no_follow = true }); fs.Dir.makePath(fs.cwd(), out_bin_path) catch {}; const out_bin_dir = try fs.Dir.openDir(fs.cwd(), out_bin_path, .{}); + try test_dir.dir.copyFile("run.sh", out_bin_dir, "run.sh", .{}); var allocator = heap.page_allocator; var walker = try test_dir.walk(allocator); while (try walker.next()) |entry| { diff --git a/test/default/Makefile.am b/test/default/Makefile.am index 12aa7eb4..d319160d 100644 --- a/test/default/Makefile.am +++ b/test/default/Makefile.am @@ -1,5 +1,6 @@ EXTRA_DIST = \ + run.sh \ cmptest.h \ wasi-test-wrapper.sh \ wintest.bat \ diff --git a/test/default/run.sh b/test/default/run.sh new file mode 100755 index 00000000..9e792b50 --- /dev/null +++ b/test/default/run.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +find . -type f -perm +100 -print | grep -v run.sh | sort | while read -r x; do + echo "[$x]" + if ! "$x"; then + echo "*** [$x] FAILED" >&2 + exit 1 + fi +done