File tree Expand file tree Collapse file tree 4 files changed +14
-12
lines changed Expand file tree Collapse file tree 4 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -451,7 +451,9 @@ impl Step for RustdocTheme {
451451 fn run ( self , builder : & Builder ) {
452452 let rustdoc = builder. rustdoc ( self . compiler . host ) ;
453453 let mut cmd = Command :: new ( builder. config . python . clone ( ) . expect ( "python not defined" ) ) ;
454- cmd. args ( & [ "src/tools/rustdoc-themes/test-themes.py" , rustdoc. to_str ( ) . unwrap ( ) ] ) ;
454+ cmd. args ( & [ builder. src . join ( "src/tools/rustdoc-themes/test-themes.py" ) . to_str ( ) . unwrap ( ) ,
455+ rustdoc. to_str ( ) . unwrap ( ) ,
456+ builder. src . join ( "src/librustdoc/html/static/themes" ) . to_str ( ) . unwrap ( ) ] ) ;
455457 cmd. env ( "RUSTC_STAGE" , self . compiler . stage . to_string ( ) )
456458 . env ( "RUSTC_SYSROOT" , builder. sysroot ( self . compiler ) )
457459 . env ( "RUSTDOC_LIBDIR" , builder. sysroot_libdir ( self . compiler , self . compiler . host ) )
Original file line number Diff line number Diff line change @@ -332,10 +332,10 @@ pub fn main_args(args: &[String]) -> isize {
332332 print ! ( " - Checking \" {}\" ..." , theme_file) ;
333333 let ( success, differences) = theme:: test_theme_against ( theme_file, & paths) ;
334334 if !differences. is_empty ( ) || !success {
335- eprintln ! ( " FAILED" ) ;
335+ println ! ( " FAILED" ) ;
336336 errors += 1 ;
337337 if !differences. is_empty ( ) {
338- eprintln ! ( "{}" , differences. join( "\n " ) ) ;
338+ println ! ( "{}" , differences. join( "\n " ) ) ;
339339 }
340340 } else {
341341 println ! ( " OK" ) ;
@@ -407,13 +407,13 @@ pub fn main_args(args: &[String]) -> isize {
407407 . iter ( )
408408 . map ( |s| ( PathBuf :: from ( & s) , s. to_owned ( ) ) ) {
409409 if !theme_file. is_file ( ) {
410- eprintln ! ( "rustdoc: option --themes arguments must all be files" ) ;
410+ println ! ( "rustdoc: option --themes arguments must all be files" ) ;
411411 return 1 ;
412412 }
413413 let ( success, ret) = theme:: test_theme_against ( & theme_file, & paths) ;
414414 if !success || !ret. is_empty ( ) {
415- eprintln ! ( "rustdoc: invalid theme: \" {}\" " , theme_s) ;
416- eprintln ! ( " Check what's wrong with the \" theme-checker\" option" ) ;
415+ println ! ( "rustdoc: invalid theme: \" {}\" " , theme_s) ;
416+ println ! ( " Check what's wrong with the \" theme-checker\" option" ) ;
417417 return 1 ;
418418 }
419419 themes. push ( theme_file) ;
Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ c // sdf
348348d {}
349349"# ;
350350 let paths = load_css_paths ( text. as_bytes ( ) ) ;
351- assert ! ( paths. children. get ( & CssPath :: new( "a b c d" . to_owned( ) ) ) . is_some ( ) ) ;
351+ assert ! ( paths. children. contains ( & CssPath :: new( "a b c d" . to_owned( ) ) ) ) ;
352352 }
353353
354354 #[ test]
Original file line number Diff line number Diff line change 1717import sys
1818
1919FILES_TO_IGNORE = ['main.css' ]
20- THEME_DIR_PATH = "src/librustdoc/html/static/themes"
2120
2221
2322def print_err (msg ):
@@ -31,14 +30,15 @@ def exec_command(command):
3130
3231
3332def main (argv ):
34- if len (argv ) < 1 :
33+ if len (argv ) < 2 :
3534 print_err ("Needs rustdoc binary path" )
3635 return 1
3736 rustdoc_bin = argv [0 ]
38- themes = [join (THEME_DIR_PATH , f ) for f in listdir (THEME_DIR_PATH )
39- if isfile (join (THEME_DIR_PATH , f )) and f not in FILES_TO_IGNORE ]
37+ themes_folder = argv [1 ]
38+ themes = [join (themes_folder , f ) for f in listdir (themes_folder )
39+ if isfile (join (themes_folder , f )) and f not in FILES_TO_IGNORE ]
4040 if len (themes ) < 1 :
41- print_err ('No theme found in "{}"...' .format (THEME_DIR_PATH ))
41+ print_err ('No theme found in "{}"...' .format (themes_folder ))
4242 return 1
4343 args = [rustdoc_bin , '-Z' , 'unstable-options' , '--theme-checker' ]
4444 args .extend (themes )
You can’t perform that action at this time.
0 commit comments