Add a simple test runner to zig-out/bin/

This commit is contained in:
Frank Denis 2022-11-23 21:32:10 +01:00
parent 14e6867981
commit 3075417ef8
3 changed files with 11 additions and 0 deletions

View File

@ -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| {

View File

@ -1,5 +1,6 @@
EXTRA_DIST = \
run.sh \
cmptest.h \
wasi-test-wrapper.sh \
wintest.bat \

9
test/default/run.sh Executable file
View File

@ -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