File tree 3 files changed +17
-9
lines changed
test/run-make/issue-22131
3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -418,8 +418,12 @@ impl Collector {
418
418
should_panic : bool , no_run : bool , should_ignore : bool ,
419
419
as_test_harness : bool , compile_fail : bool , error_codes : Vec < String > ,
420
420
line : usize , filename : String ) {
421
- let name = format ! ( "{} - line {}" , filename, line) ;
422
- self . cnt += 1 ;
421
+ let name = if self . use_headers {
422
+ let s = self . current_header . as_ref ( ) . map ( |s| & * * s) . unwrap_or ( "" ) ;
423
+ format ! ( "{} - {} (line {})" , filename, s, line)
424
+ } else {
425
+ format ! ( "{} - {} (line {})" , filename, self . names. join( "::" ) , line)
426
+ } ;
423
427
let cfgs = self . cfgs . clone ( ) ;
424
428
let libs = self . libs . clone ( ) ;
425
429
let externs = self . externs . clone ( ) ;
Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ all: foo.rs
4
4
$(RUSTC ) --cfg ' feature="bar"' --crate-type lib foo.rs
5
5
$(HOST_RPATH_ENV ) ' $(RUSTDOC)' --test --cfg ' feature="bar"' \
6
6
-L $(TMPDIR ) foo.rs | \
7
- grep -q ' foo.rs - line 11 ... ok'
7
+ grep -q ' foo.rs - foo ( line 11) ... ok'
Original file line number Diff line number Diff line change @@ -1998,16 +1998,20 @@ actual:\n\
1998
1998
for _ in res. stdout . split ( "\n " )
1999
1999
. filter ( |s| s. starts_with ( "test " ) )
2000
2000
. inspect ( |s| {
2001
- let tmp: Vec < & str > = s. split ( " - line " ) . collect ( ) ;
2001
+ let tmp: Vec < & str > = s. split ( " - " ) . collect ( ) ;
2002
2002
if tmp. len ( ) == 2 {
2003
2003
let path = tmp[ 0 ] . rsplit ( "test " ) . next ( ) . unwrap ( ) ;
2004
2004
if let Some ( ref mut v) = files. get_mut ( path) {
2005
2005
tested += 1 ;
2006
- let line = tmp[ 1 ] . split ( " ..." )
2007
- . next ( )
2008
- . unwrap_or ( "0" )
2009
- . parse ( )
2010
- . unwrap_or ( 0 ) ;
2006
+ let mut iter = tmp[ 1 ] . split ( "(line " ) ;
2007
+ iter. next ( ) ;
2008
+ let line = iter. next ( )
2009
+ . unwrap_or ( ")" )
2010
+ . split ( ")" )
2011
+ . next ( )
2012
+ . unwrap_or ( "0" )
2013
+ . parse ( )
2014
+ . unwrap_or ( 0 ) ;
2011
2015
if let Ok ( pos) = v. binary_search ( & line) {
2012
2016
v. remove ( pos) ;
2013
2017
} else {
You can’t perform that action at this time.
0 commit comments