File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 11const std = @import ("std" );
22
3+ const test_targets = [_ ]std.Target.Query {
4+ .{}, // native
5+ .{
6+ .cpu_arch = .x86_64 ,
7+ .os_tag = .linux ,
8+ },
9+ .{
10+ .cpu_arch = .aarch64 ,
11+ .os_tag = .macos ,
12+ },
13+ };
14+
315pub fn build (b : * std.Build ) void {
416 const target = b .standardTargetOptions (.{});
517 const optimize = b .standardOptimizeOption (.{});
@@ -29,9 +41,14 @@ pub fn build(b: *std.Build) void {
2941 });
3042 b .installArtifact (exe );
3143
32- const getopt_lib_unit_tests = b .addTest (.{ .root_module = getopt_lib_mod });
33- const run_tests = b .addRunArtifact (getopt_lib_unit_tests );
34-
3544 const test_step = b .step ("test" , "Run tests" );
36- test_step .dependOn (& run_tests .step );
45+ for (test_targets ) | test_target | {
46+ const unit_tests = b .addTest (.{
47+ .root_module = getopt_lib_mod ,
48+ .target = b .resolveTargetQuery (test_target ),
49+ });
50+
51+ const run_unit_tests = b .addRunArtifact (unit_tests );
52+ test_step .dependOn (& run_unit_tests .step );
53+ }
3754}
You can’t perform that action at this time.
0 commit comments