Add a simple test runner to zig-out/bin/
This commit is contained in:
parent
14e6867981
commit
3075417ef8
@ -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| {
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
EXTRA_DIST = \
|
||||
run.sh \
|
||||
cmptest.h \
|
||||
wasi-test-wrapper.sh \
|
||||
wintest.bat \
|
||||
|
9
test/default/run.sh
Executable file
9
test/default/run.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user