Skip to content

Commit fc733a6

Browse files
committed
Port run-make/libtest-junit to rmake
1 parent c4aa7a7 commit fc733a6

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

Diff for: src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ run-make/incr-add-rust-src-component/Makefile
99
run-make/issue-84395-lto-embed-bitcode/Makefile
1010
run-make/jobserver-error/Makefile
1111
run-make/libs-through-symlinks/Makefile
12-
run-make/libtest-junit/Makefile
1312
run-make/libtest-thread-limit/Makefile
1413
run-make/macos-deployment-target/Makefile
1514
run-make/min-global-align/Makefile

Diff for: tests/run-make/libtest-junit/Makefile

-20
This file was deleted.

Diff for: tests/run-make/libtest-junit/rmake.rs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Check libtest's JUnit (XML) output against snapshots.
2+
3+
//@ ignore-cross-compile
4+
//@ needs-unwind (test file contains #[should_panic] test)
5+
6+
use run_make_support::{cmd, diff, python_command, rustc};
7+
8+
fn main() {
9+
rustc().arg("--test").input("f.rs").run();
10+
11+
run_tests(&[], "output-default.xml");
12+
run_tests(&["--show-output"], "output-stdout-success.xml");
13+
}
14+
15+
#[track_caller]
16+
fn run_tests(extra_args: &[&str], expected_file: &str) {
17+
let cmd_out = cmd("./f")
18+
.env("RUST_BACKTRACE", "0")
19+
.args(&["-Zunstable-options", "--test-threads=1", "--format=junit"])
20+
.args(extra_args)
21+
.run_fail();
22+
let test_stdout = &cmd_out.stdout_utf8();
23+
24+
python_command().arg("validate_junit.py").stdin(test_stdout).run();
25+
26+
diff()
27+
.expected_file(expected_file)
28+
.actual_text("stdout", test_stdout)
29+
.normalize(r#"\btime="[0-9.]+""#, r#"time="$$TIME""#)
30+
.run();
31+
}

0 commit comments

Comments
 (0)