Skip to content

Commit ab29338

Browse files
committed
tests: skip rustdoc test-builder success path when cross-compiling
Signed-off-by: Osama Abdelkader <[email protected]>
1 parent 09385f9 commit ab29338

File tree

1 file changed

+8
-0
lines changed
  • tests/run-make/rustdoc-test-builder

1 file changed

+8
-0
lines changed

tests/run-make/rustdoc-test-builder/rmake.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ fn main() {
2323
// ... and that we didn't panic.
2424
output.assert_not_ice();
2525

26+
// Some cross targets (e.g. wasm) cannot execute doctests directly even with a runner,
27+
// so only exercise the success path when building for the host.
28+
let host = std::env::var("HOST").expect("HOST must be set");
29+
let target = std::env::var("TARGET").expect("TARGET must be set");
30+
if host != target {
31+
return;
32+
}
33+
2634
// Test 2: Verify that a valid test-builder is invoked with correct arguments
2735
// Build a custom test-builder that logs its arguments and forwards to rustc.
2836
// Use `bare_rustc` so we compile for the host architecture even in cross builds.

0 commit comments

Comments
 (0)