authorgravatar for justus@klausecker.deJustus Klausecker <justus@klausecker.de> 2026-03-06 00:08:13+01:00
committergravatar for justus@klausecker.deJustus Klausecker <justus@klausecker.de> 2026-03-06 10:09:06+01:00
log933bfd4282f99e7f59ab025bbff53454c0ae2f5c
tree409b711873685e95a54ed5c7d1fe38f681482521
parent823f9039f1cad8093cd276cf003a42996d39b74a

tests: pass on `-Dsanitize-thread` to unit tests


2 files changed, 7 insertions(+), 0 deletions(-)

build.zig+5
...@@ -478,6 +478,7 @@ pub fn build(b: *std.Build) !void {...@@ -478,6 +478,7 @@ pub fn build(b: *std.Build) !void {
478 .desc = "Run the behavior tests",478 .desc = "Run the behavior tests",
479 .optimize_modes = optimization_modes,479 .optimize_modes = optimization_modes,
480 .include_paths = &.{},480 .include_paths = &.{},
481 .sanitize_thread = sanitize_thread,
481 .skip_single_threaded = skip_single_threaded,482 .skip_single_threaded = skip_single_threaded,
482 .skip_non_native = skip_non_native,483 .skip_non_native = skip_non_native,
483 .test_only = test_only,484 .test_only = test_only,
...@@ -503,6 +504,7 @@ pub fn build(b: *std.Build) !void {...@@ -503,6 +504,7 @@ pub fn build(b: *std.Build) !void {
503 .desc = "Run the compiler_rt tests",504 .desc = "Run the compiler_rt tests",
504 .optimize_modes = optimization_modes,505 .optimize_modes = optimization_modes,
505 .include_paths = &.{},506 .include_paths = &.{},
507 .sanitize_thread = sanitize_thread,
506 .skip_single_threaded = true,508 .skip_single_threaded = true,
507 .skip_non_native = skip_non_native,509 .skip_non_native = skip_non_native,
508 .test_only = test_only,510 .test_only = test_only,
...@@ -529,6 +531,7 @@ pub fn build(b: *std.Build) !void {...@@ -529,6 +531,7 @@ pub fn build(b: *std.Build) !void {
529 .desc = "Run the zig libc implementation unit tests",531 .desc = "Run the zig libc implementation unit tests",
530 .optimize_modes = optimization_modes,532 .optimize_modes = optimization_modes,
531 .include_paths = &.{},533 .include_paths = &.{},
534 .sanitize_thread = sanitize_thread,
532 .skip_single_threaded = true,535 .skip_single_threaded = true,
533 .skip_non_native = skip_non_native,536 .skip_non_native = skip_non_native,
534 .test_only = test_only,537 .test_only = test_only,
...@@ -555,6 +558,7 @@ pub fn build(b: *std.Build) !void {...@@ -555,6 +558,7 @@ pub fn build(b: *std.Build) !void {
555 .desc = "Run the standard library tests",558 .desc = "Run the standard library tests",
556 .optimize_modes = optimization_modes,559 .optimize_modes = optimization_modes,
557 .include_paths = &.{},560 .include_paths = &.{},
561 .sanitize_thread = sanitize_thread,
558 .skip_single_threaded = skip_single_threaded,562 .skip_single_threaded = skip_single_threaded,
559 .skip_non_native = skip_non_native,563 .skip_non_native = skip_non_native,
560 .test_only = test_only,564 .test_only = test_only,
...@@ -578,6 +582,7 @@ pub fn build(b: *std.Build) !void {...@@ -578,6 +582,7 @@ pub fn build(b: *std.Build) !void {
578 .root_module = addCompilerMod(b, .{582 .root_module = addCompilerMod(b, .{
579 .optimize = optimize,583 .optimize = optimize,
580 .target = target,584 .target = target,
585 .sanitize_thread = sanitize_thread,
581 .single_threaded = single_threaded,586 .single_threaded = single_threaded,
582 }),587 }),
583 .filters = test_filters,588 .filters = test_filters,
test/tests.zig+2
...@@ -2334,6 +2334,7 @@ pub const ModuleTestOptions = struct {...@@ -2334,6 +2334,7 @@ pub const ModuleTestOptions = struct {
2334 skip_libc: bool,2334 skip_libc: bool,
2335 max_rss: usize = 0,2335 max_rss: usize = 0,
2336 no_builtin: bool = false,2336 no_builtin: bool = false,
2337 sanitize_thread: ?bool = null,
2337 build_options: ?*Step.Options = null,2338 build_options: ?*Step.Options = null,
23382339
2339 pub const TestOnly = union(enum) {2340 pub const TestOnly = union(enum) {
...@@ -2462,6 +2463,7 @@ fn addOneModuleTest(...@@ -2462,6 +2463,7 @@ fn addOneModuleTest(
2462 .link_libc = test_target.link_libc,2463 .link_libc = test_target.link_libc,
2463 .pic = test_target.pic,2464 .pic = test_target.pic,
2464 .strip = test_target.strip,2465 .strip = test_target.strip,
2466 .sanitize_thread = options.sanitize_thread,
2465 .single_threaded = test_target.single_threaded,2467 .single_threaded = test_target.single_threaded,
2466 }),2468 }),
2467 .max_rss = max_rss,2469 .max_rss = max_rss,