aboutsummaryrefslogtreecommitdiff
path: root/test/tests.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-07-29 23:57:52 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-07-30 11:19:32 -0700
commit38840e2e586d71f2b38ed825ea02529f615c5f0c (patch)
tree5c31180307056823d2fc8a5aab73f094ad4d729d /test/tests.zig
parentf8386de7ae12fca1e50e7920964fd7c47301fc05 (diff)
downloadzig-38840e2e586d71f2b38ed825ea02529f615c5f0c.tar.gz
zig-38840e2e586d71f2b38ed825ea02529f615c5f0c.zip
build system: follow-up enhancements regarding LazyPath
* introduce LazyPath.cwd_relative variant and use it for --zig-lib-dir. closes #12685 * move overrideZigLibDir and setMainPkgPath to options fields set once and then never mutated. * avoid introducing Build/util.zig * use doc comments for deprecation notices so that they show up in generated documentation. * introduce InstallArtifact.Options, accept it as a parameter to addInstallArtifact, and move override_dest_dir into it. Instead of configuring the installation via Compile step, configure the installation via the InstallArtifact step. In retrospect this is obvious. * remove calls to pushInstalledFile in InstallArtifact. See #14943 * rewrite InstallArtifact to not incorrectly observe whether a Compile step has any generated outputs. InstallArtifact is meant to trigger output generation. * fix child process evaluation code handling of `-fno-emit-bin`. * don't store out_h_filename, out_ll_filename, etc., pointlessly. these are all just simple extensions appended to the root name. * make emit_directory optional. It's possible to have nothing outputted, for example, if you're just type-checking. * avoid passing -femit-foo/-fno-emit-foo when it is the default * rename ConfigHeader.getTemplate to getOutput * deprecate addOptionArtifact * update the random number seed of Options step caching. * avoid using `inline for` pointlessly * avoid using `override_Dest_dir` pointlessly * avoid emitting an executable pointlessly in test cases Removes forceBuild and forceEmit. Let's consider these additions separately. Nearly all of the usage sites were suspicious.
Diffstat (limited to 'test/tests.zig')
-rw-r--r--test/tests.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/tests.zig b/test/tests.zig
index 4174fc0147..d42344cb88 100644
--- a/test/tests.zig
+++ b/test/tests.zig
@@ -588,7 +588,7 @@ pub fn addStandaloneTests(
});
if (case.link_libc) exe.linkLibC();
- exe.forceBuild();
+ _ = exe.getEmittedBin();
step.dependOn(&exe.step);
}
@@ -1008,6 +1008,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
.single_threaded = test_target.single_threaded,
.use_llvm = test_target.use_llvm,
.use_lld = test_target.use_lld,
+ .zig_lib_dir = .{ .path = "lib" },
});
const single_threaded_suffix = if (test_target.single_threaded == true) "-single" else "";
const backend_suffix = if (test_target.use_llvm == true)
@@ -1019,7 +1020,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
else
"";
- these_tests.overrideZigLibDir(.{ .path = "lib" });
these_tests.addIncludePath(.{ .path = "test" });
const qualified_name = b.fmt("{s}-{s}-{s}{s}{s}{s}", .{
@@ -1039,8 +1039,8 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
.name = qualified_name,
.link_libc = test_target.link_libc,
.target = altered_target,
+ .zig_lib_dir = .{ .path = "lib" },
});
- compile_c.overrideZigLibDir(.{ .path = "lib" });
compile_c.addCSourceFile(.{
.file = these_tests.getEmittedBin(),
.flags = &.{