Add a simple test runner to zig-out/bin/
This commit is contained in:
parent
9159da5c8a
commit
03137a5817
@ -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 });
|
const test_dir = try fs.Dir.openIterableDir(fs.cwd(), test_path, .{ .no_follow = true });
|
||||||
fs.Dir.makePath(fs.cwd(), out_bin_path) catch {};
|
fs.Dir.makePath(fs.cwd(), out_bin_path) catch {};
|
||||||
const out_bin_dir = try fs.Dir.openDir(fs.cwd(), out_bin_path, .{});
|
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 allocator = heap.page_allocator;
|
||||||
var walker = try test_dir.walk(allocator);
|
var walker = try test_dir.walk(allocator);
|
||||||
while (try walker.next()) |entry| {
|
while (try walker.next()) |entry| {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
|
run.sh \
|
||||||
cmptest.h \
|
cmptest.h \
|
||||||
wasi-test-wrapper.sh \
|
wasi-test-wrapper.sh \
|
||||||
wintest.bat \
|
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