File tree 2 files changed +31
-20
lines changed
tests/run-make/libtest-junit
2 files changed +31
-20
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments