aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-02-20 10:15:10 +0100
committerJacob Young <jacobly0@users.noreply.github.com>2024-02-20 18:44:43 +0100
commit2291560424b3cfa614cb0320d73e41aa1f5fa221 (patch)
treef3f131f6bb5baf8e7afb44df953c83070877cba7 /build.zig
parent556db2ca36afccd623d80b620139a1428c7b65fa (diff)
downloadzig-2291560424b3cfa614cb0320d73e41aa1f5fa221.tar.gz
zig-2291560424b3cfa614cb0320d73e41aa1f5fa221.zip
c_import: extract behavior tests that use `@cImport`
This introduces the new test step `test-c-import`, and removes the ability of the behavior tests to `@cImport` paths relative to `test`. This allows the behavior tests to be run without translate c.
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig17
1 files changed, 17 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index 5ca0e08d4e..98025dbb13 100644
--- a/build.zig
+++ b/build.zig
@@ -471,6 +471,7 @@ pub fn build(b: *std.Build) !void {
.name = "behavior",
.desc = "Run the behavior tests",
.optimize_modes = optimization_modes,
+ .include_paths = &.{},
.skip_single_threaded = skip_single_threaded,
.skip_non_native = skip_non_native,
.skip_cross_glibc = skip_cross_glibc,
@@ -480,10 +481,24 @@ pub fn build(b: *std.Build) !void {
test_step.dependOn(tests.addModuleTests(b, .{
.test_filter = test_filter,
+ .root_src = "test/c_import.zig",
+ .name = "c-import",
+ .desc = "Run the @cImport tests",
+ .optimize_modes = optimization_modes,
+ .include_paths = &.{"test/c_import"},
+ .skip_single_threaded = true,
+ .skip_non_native = skip_non_native,
+ .skip_cross_glibc = skip_cross_glibc,
+ .skip_libc = skip_libc,
+ }));
+
+ test_step.dependOn(tests.addModuleTests(b, .{
+ .test_filter = test_filter,
.root_src = "lib/compiler_rt.zig",
.name = "compiler-rt",
.desc = "Run the compiler_rt tests",
.optimize_modes = optimization_modes,
+ .include_paths = &.{},
.skip_single_threaded = true,
.skip_non_native = skip_non_native,
.skip_cross_glibc = skip_cross_glibc,
@@ -496,6 +511,7 @@ pub fn build(b: *std.Build) !void {
.name = "universal-libc",
.desc = "Run the universal libc tests",
.optimize_modes = optimization_modes,
+ .include_paths = &.{},
.skip_single_threaded = true,
.skip_non_native = skip_non_native,
.skip_cross_glibc = skip_cross_glibc,
@@ -527,6 +543,7 @@ pub fn build(b: *std.Build) !void {
.name = "std",
.desc = "Run the standard library tests",
.optimize_modes = optimization_modes,
+ .include_paths = &.{},
.skip_single_threaded = skip_single_threaded,
.skip_non_native = skip_non_native,
.skip_cross_glibc = skip_cross_glibc,