diff options
author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2023-05-15 00:06:15 +0200 |
---|---|---|
committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2023-05-15 00:06:15 +0200 |
commit | c3a73b8e2b3a276dd87ee27528a1dd52db77e3b8 (patch) | |
tree | cc0237541ad510bcbf467a63ec6734ba27c61243 /test/tests.zig | |
parent | 4c6b6b94e4e40ec9e02a64b97aec34ee4605ae6e (diff) |
Added testing exercise.
Diffstat (limited to 'test/tests.zig')
-rw-r--r-- | test/tests.zig | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/tests.zig b/test/tests.zig index f5c3960..b25b29c 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -93,7 +93,7 @@ pub fn addCliTests(b: *std.Build, exercises: []const Exercise) *Step { const case_step = createCase(b, "case-3"); for (exercises[0 .. exercises.len - 1]) |ex| { - if (ex.skip) continue; + if (ex.skip or ex.run_test) continue; if (ex.hint) |hint| { const n = ex.number(); @@ -249,6 +249,21 @@ fn check_output(step: *Step, exercise: Exercise, reader: Reader) !void { return; } + if (exercise.run_test) { + { + const actual = try readLine(reader, &buf) orelse "EOF"; + const expect = b.fmt("Testing {s}...", .{exercise.main_file}); + try check(step, exercise, expect, actual); + } + + { + const actual = try readLine(reader, &buf) orelse "EOF"; + try check(step, exercise, "", actual); + } + + return; + } + { const actual = try readLine(reader, &buf) orelse "EOF"; const expect = b.fmt("Compiling {s}...", .{exercise.main_file}); |