| ... | @@ -218,6 +218,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -218,6 +218,7 @@ pub fn build(b: *Builder) !void { |
| 218 | const is_wine_enabled = b.option(bool, "enable-wine", "Use Wine to run cross compiled Windows tests") orelse false; | 218 | const is_wine_enabled = b.option(bool, "enable-wine", "Use Wine to run cross compiled Windows tests") orelse false; |
| 219 | const is_qemu_enabled = b.option(bool, "enable-qemu", "Use QEMU to run cross compiled foreign architecture tests") orelse false; | 219 | const is_qemu_enabled = b.option(bool, "enable-qemu", "Use QEMU to run cross compiled foreign architecture tests") orelse false; |
| 220 | const is_wasmtime_enabled = b.option(bool, "enable-wasmtime", "Use Wasmtime to enable and run WASI libstd tests") orelse false; | 220 | const is_wasmtime_enabled = b.option(bool, "enable-wasmtime", "Use Wasmtime to enable and run WASI libstd tests") orelse false; |
| | 221 | const is_darling_enabled = b.option(bool, "enable-darling", "[Experimental] Use Darling to run cross compiled macOS tests") orelse false; |
| 221 | const glibc_multi_dir = b.option([]const u8, "enable-foreign-glibc", "Provide directory with glibc installations to run cross compiled tests that link glibc"); | 222 | const glibc_multi_dir = b.option([]const u8, "enable-foreign-glibc", "Provide directory with glibc installations to run cross compiled tests that link glibc"); |
| 222 | | 223 | |
| 223 | test_stage2.addBuildOption(bool, "skip_non_native", skip_non_native); | 224 | test_stage2.addBuildOption(bool, "skip_non_native", skip_non_native); |
| ... | @@ -227,6 +228,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -227,6 +228,7 @@ pub fn build(b: *Builder) !void { |
| 227 | test_stage2.addBuildOption(bool, "enable_qemu", is_qemu_enabled); | 228 | test_stage2.addBuildOption(bool, "enable_qemu", is_qemu_enabled); |
| 228 | test_stage2.addBuildOption(bool, "enable_wine", is_wine_enabled); | 229 | test_stage2.addBuildOption(bool, "enable_wine", is_wine_enabled); |
| 229 | test_stage2.addBuildOption(bool, "enable_wasmtime", is_wasmtime_enabled); | 230 | test_stage2.addBuildOption(bool, "enable_wasmtime", is_wasmtime_enabled); |
| | 231 | test_stage2.addBuildOption(bool, "enable_darling", is_darling_enabled); |
| 230 | test_stage2.addBuildOption(?[]const u8, "glibc_multi_install_dir", glibc_multi_dir); | 232 | test_stage2.addBuildOption(?[]const u8, "glibc_multi_install_dir", glibc_multi_dir); |
| 231 | test_stage2.addBuildOption([]const u8, "version", version); | 233 | test_stage2.addBuildOption([]const u8, "version", version); |
| 232 | | 234 | |
| ... | @@ -261,11 +263,56 @@ pub fn build(b: *Builder) !void { | ... | @@ -261,11 +263,56 @@ pub fn build(b: *Builder) !void { |
| 261 | const fmt_step = b.step("test-fmt", "Run zig fmt against build.zig to make sure it works"); | 263 | const fmt_step = b.step("test-fmt", "Run zig fmt against build.zig to make sure it works"); |
| 262 | fmt_step.dependOn(&fmt_build_zig.step); | 264 | fmt_step.dependOn(&fmt_build_zig.step); |
| 263 | | 265 | |
| 264 | // TODO for the moment, skip wasm32-wasi until bugs are sorted out. | 266 | toolchain_step.dependOn(tests.addPkgTests( |
| 265 | toolchain_step.dependOn(tests.addPkgTests(b, test_filter, "test/stage1/behavior.zig", "behavior", "Run the behavior tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir)); | 267 | b, |
| 266 | | 268 | test_filter, |
| 267 | toolchain_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/special/compiler_rt.zig", "compiler-rt", "Run the compiler_rt tests", modes, true, skip_non_native, true, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir)); | 269 | "test/stage1/behavior.zig", |
| 268 | toolchain_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/special/c.zig", "minilibc", "Run the mini libc tests", modes, true, skip_non_native, true, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir)); | 270 | "behavior", |
| | 271 | "Run the behavior tests", |
| | 272 | modes, |
| | 273 | false, |
| | 274 | skip_non_native, |
| | 275 | skip_libc, |
| | 276 | is_wine_enabled, |
| | 277 | is_qemu_enabled, |
| | 278 | is_wasmtime_enabled, |
| | 279 | is_darling_enabled, |
| | 280 | glibc_multi_dir, |
| | 281 | )); |
| | 282 | |
| | 283 | toolchain_step.dependOn(tests.addPkgTests( |
| | 284 | b, |
| | 285 | test_filter, |
| | 286 | "lib/std/special/compiler_rt.zig", |
| | 287 | "compiler-rt", |
| | 288 | "Run the compiler_rt tests", |
| | 289 | modes, |
| | 290 | true, |
| | 291 | skip_non_native, |
| | 292 | true, |
| | 293 | is_wine_enabled, |
| | 294 | is_qemu_enabled, |
| | 295 | is_wasmtime_enabled, |
| | 296 | is_darling_enabled, |
| | 297 | glibc_multi_dir, |
| | 298 | )); |
| | 299 | |
| | 300 | toolchain_step.dependOn(tests.addPkgTests( |
| | 301 | b, |
| | 302 | test_filter, |
| | 303 | "lib/std/special/c.zig", |
| | 304 | "minilibc", |
| | 305 | "Run the mini libc tests", |
| | 306 | modes, |
| | 307 | true, |
| | 308 | skip_non_native, |
| | 309 | true, |
| | 310 | is_wine_enabled, |
| | 311 | is_qemu_enabled, |
| | 312 | is_wasmtime_enabled, |
| | 313 | is_darling_enabled, |
| | 314 | glibc_multi_dir, |
| | 315 | )); |
| 269 | | 316 | |
| 270 | toolchain_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes)); | 317 | toolchain_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes)); |
| 271 | toolchain_step.dependOn(tests.addStandaloneTests(b, test_filter, modes)); | 318 | toolchain_step.dependOn(tests.addStandaloneTests(b, test_filter, modes)); |
| ... | @@ -283,7 +330,22 @@ pub fn build(b: *Builder) !void { | ... | @@ -283,7 +330,22 @@ pub fn build(b: *Builder) !void { |
| 283 | toolchain_step.dependOn(tests.addCompileErrorTests(b, test_filter, modes)); | 330 | toolchain_step.dependOn(tests.addCompileErrorTests(b, test_filter, modes)); |
| 284 | } | 331 | } |
| 285 | | 332 | |
| 286 | const std_step = tests.addPkgTests(b, test_filter, "lib/std/std.zig", "std", "Run the standard library tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir); | 333 | const std_step = tests.addPkgTests( |
| | 334 | b, |
| | 335 | test_filter, |
| | 336 | "lib/std/std.zig", |
| | 337 | "std", |
| | 338 | "Run the standard library tests", |
| | 339 | modes, |
| | 340 | false, |
| | 341 | skip_non_native, |
| | 342 | skip_libc, |
| | 343 | is_wine_enabled, |
| | 344 | is_qemu_enabled, |
| | 345 | is_wasmtime_enabled, |
| | 346 | is_darling_enabled, |
| | 347 | glibc_multi_dir, |
| | 348 | ); |
| 287 | | 349 | |
| 288 | const test_step = b.step("test", "Run all the tests"); | 350 | const test_step = b.step("test", "Run all the tests"); |
| 289 | test_step.dependOn(toolchain_step); | 351 | test_step.dependOn(toolchain_step); |