aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-03-09 22:54:32 -0800
committerAndrew Kelley <andrew@ziglang.org>2023-03-15 10:48:14 -0700
commit097bcca069c5c7abdf77f321182eb4a0c54b3a93 (patch)
tree75676c682c001e28ed6ec350aa33e212681598c2 /test
parentbf73620cbdb4b9ae6088d44bb88daa4a7d84ed70 (diff)
downloadzig-097bcca069c5c7abdf77f321182eb4a0c54b3a93.tar.gz
zig-097bcca069c5c7abdf77f321182eb4a0c54b3a93.zip
build.zig: fix how test-cases marked is_test=1 are handled
Diffstat (limited to 'test')
-rw-r--r--test/src/Cases.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/src/Cases.zig b/test/src/Cases.zig
index 27b0cf6b21..5007939b14 100644
--- a/test/src/Cases.zig
+++ b/test/src/Cases.zig
@@ -485,7 +485,12 @@ pub fn lowerToBuildSteps(
}
const root_source_file = writefiles.getFileSource(update.files.items[0].path).?;
- const artifact = switch (case.output_mode) {
+ const artifact = if (case.is_test) b.addTest(.{
+ .root_source_file = root_source_file,
+ .name = case.name,
+ .target = case.target,
+ .optimize = case.optimize_mode,
+ }) else switch (case.output_mode) {
.Obj => b.addObject(.{
.root_source_file = root_source_file,
.name = case.name,
@@ -498,12 +503,7 @@ pub fn lowerToBuildSteps(
.target = case.target,
.optimize = case.optimize_mode,
}),
- .Exe => if (case.is_test) b.addTest(.{
- .root_source_file = root_source_file,
- .name = case.name,
- .target = case.target,
- .optimize = case.optimize_mode,
- }) else b.addExecutable(.{
+ .Exe => b.addExecutable(.{
.root_source_file = root_source_file,
.name = case.name,
.target = case.target,