diff options
author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2023-05-15 01:00:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 01:00:28 +0200 |
commit | 5cbaa0441f1a52532ac68899bb5b64d3595e5a06 (patch) | |
tree | db9710577e27321a7a69b9d8133dddf13c14f8de /test/tests.zig | |
parent | 76ee4eb043ae290102d3fb19375931990f2a9824 (diff) | |
parent | c3a73b8e2b3a276dd87ee27528a1dd52db77e3b8 (diff) |
Merge pull request #304 from chrboesch/testing_exercise
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}); |