aboutsummaryrefslogtreecommitdiff
path: root/test/tests.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-04-26 19:17:05 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-04-26 19:17:05 -0400
commit7b0542d08b7e8e5ccbe81f495d641305b3b8a264 (patch)
tree67060c5620c5a36700abfa9c44d3ce31e35f9da4 /test/tests.zig
parent09bc4d6ba366c1a642b3c92c7ec554e95a369053 (diff)
downloadzig-7b0542d08b7e8e5ccbe81f495d641305b3b8a264.tar.gz
zig-7b0542d08b7e8e5ccbe81f495d641305b3b8a264.zip
build system: consolidate duplicate code and more
* add ability to add assembly files when building an exe, obj, or lib * add implicit cast from `[N]T` to `?[]const T` (closes #343) * remove link_exe and link_lib in favor of allowing build_exe and build_lib support no root zig source file
Diffstat (limited to 'test/tests.zig')
-rw-r--r--test/tests.zig10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/tests.zig b/test/tests.zig
index d115ed037a..b89a47eff7 100644
--- a/test/tests.zig
+++ b/test/tests.zig
@@ -355,18 +355,16 @@ pub const CompareOutputContext = struct {
return;
}
- const assembly = b.addAssemble("test", root_src);
+ const exe = b.addExecutable("test", null);
+ exe.addAssemblyFile(root_src);
+ exe.setOutputPath(exe_path);
for (case.sources.toSliceConst()) |src_file| {
const expanded_src_path = %%os.path.join(b.allocator, "test_artifacts", src_file.filename);
const write_src = b.addWriteFile(expanded_src_path, src_file.source);
- assembly.step.dependOn(&write_src.step);
+ exe.step.dependOn(&write_src.step);
}
- const exe = b.addLinkExecutable("test");
- exe.addAssembly(assembly);
- exe.setOutputPath(exe_path);
-
const run_and_cmp_output = RunCompareOutputStep.create(self, exe_path, annotated_case_name,
case.expected_output);
run_and_cmp_output.step.dependOn(&exe.step);