@@ -195,7 +195,7 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result {
195195 stripped_filtered_line ( l) . unwrap_or ( l)
196196 } ) . collect :: < Vec < & str > > ( ) . connect ( "\n " ) ;
197197 let krate = krate. as_ref ( ) . map ( |s| s. as_slice ( ) ) ;
198- let test = test:: maketest ( test. as_slice ( ) , krate, false ) ;
198+ let test = test:: maketest ( test. as_slice ( ) , krate, false , false ) ;
199199 s. push_str ( format ! ( "<span id='rust-example-raw-{}' \
200200 class='rusttest'>{}</span>",
201201 i, Escape ( test. as_slice( ) ) ) . as_slice ( ) ) ;
@@ -328,7 +328,7 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) {
328328 let text = lines. collect :: < Vec < & str > > ( ) . connect ( "\n " ) ;
329329 tests. add_test ( text. to_string ( ) ,
330330 block_info. should_fail , block_info. no_run ,
331- block_info. ignore ) ;
331+ block_info. ignore , block_info . test_harness ) ;
332332 } )
333333 }
334334 }
@@ -372,6 +372,7 @@ struct LangString {
372372 no_run : bool ,
373373 ignore : bool ,
374374 notrust : bool ,
375+ test_harness : bool ,
375376}
376377
377378impl LangString {
@@ -381,6 +382,7 @@ impl LangString {
381382 no_run : false ,
382383 ignore : false ,
383384 notrust : false ,
385+ test_harness : false ,
384386 }
385387 }
386388
@@ -401,6 +403,7 @@ impl LangString {
401403 "ignore" => { data. ignore = true ; seen_rust_tags = true ; } ,
402404 "notrust" => { data. notrust = true ; seen_rust_tags = true ; } ,
403405 "rust" => { data. notrust = false ; seen_rust_tags = true ; } ,
406+ "test_harness" => { data. test_harness = true ; seen_rust_tags = true ; }
404407 _ => { seen_other_tags = true }
405408 }
406409 }
@@ -446,24 +449,28 @@ mod tests {
446449
447450 #[ test]
448451 fn test_lang_string_parse ( ) {
449- fn t ( s : & str , should_fail : bool , no_run : bool , ignore : bool , notrust : bool ) {
452+ fn t ( s : & str ,
453+ should_fail : bool , no_run : bool , ignore : bool , notrust : bool , test_harness : bool ) {
450454 assert_eq ! ( LangString :: parse( s) , LangString {
451455 should_fail: should_fail,
452456 no_run: no_run,
453457 ignore: ignore,
454458 notrust: notrust,
459+ test_harness: test_harness,
455460 } )
456461 }
457462
458- t ( "" , false , false , false , false ) ;
459- t ( "rust" , false , false , false , false ) ;
460- t ( "sh" , false , false , false , true ) ;
461- t ( "notrust" , false , false , false , true ) ;
462- t ( "ignore" , false , false , true , false ) ;
463- t ( "should_fail" , true , false , false , false ) ;
464- t ( "no_run" , false , true , false , false ) ;
465- t ( "{.no_run .example}" , false , true , false , false ) ;
466- t ( "{.sh .should_fail}" , true , false , false , false ) ;
467- t ( "{.example .rust}" , false , false , false , false ) ;
463+ t ( "" , false , false , false , false , false ) ;
464+ t ( "rust" , false , false , false , false , false ) ;
465+ t ( "sh" , false , false , false , true , false ) ;
466+ t ( "notrust" , false , false , false , true , false ) ;
467+ t ( "ignore" , false , false , true , false , false ) ;
468+ t ( "should_fail" , true , false , false , false , false ) ;
469+ t ( "no_run" , false , true , false , false , false ) ;
470+ t ( "test_harness" , false , false , false , false , true ) ;
471+ t ( "{.no_run .example}" , false , true , false , false , false ) ;
472+ t ( "{.sh .should_fail}" , true , false , false , false , false ) ;
473+ t ( "{.example .rust}" , false , false , false , false , false ) ;
474+ t ( "{.test_harness .rust}" , false , false , false , false , true ) ;
468475 }
469476}
0 commit comments