File tree 4 files changed +14
-12
lines changed
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 {
451
451
fn run ( self , builder : & Builder ) {
452
452
let rustdoc = builder. rustdoc ( self . compiler . host ) ;
453
453
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 ( ) ] ) ;
455
457
cmd. env ( "RUSTC_STAGE" , self . compiler . stage . to_string ( ) )
456
458
. env ( "RUSTC_SYSROOT" , builder. sysroot ( self . compiler ) )
457
459
. 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 {
332
332
print ! ( " - Checking \" {}\" ..." , theme_file) ;
333
333
let ( success, differences) = theme:: test_theme_against ( theme_file, & paths) ;
334
334
if !differences. is_empty ( ) || !success {
335
- eprintln ! ( " FAILED" ) ;
335
+ println ! ( " FAILED" ) ;
336
336
errors += 1 ;
337
337
if !differences. is_empty ( ) {
338
- eprintln ! ( "{}" , differences. join( "\n " ) ) ;
338
+ println ! ( "{}" , differences. join( "\n " ) ) ;
339
339
}
340
340
} else {
341
341
println ! ( " OK" ) ;
@@ -407,13 +407,13 @@ pub fn main_args(args: &[String]) -> isize {
407
407
. iter ( )
408
408
. map ( |s| ( PathBuf :: from ( & s) , s. to_owned ( ) ) ) {
409
409
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" ) ;
411
411
return 1 ;
412
412
}
413
413
let ( success, ret) = theme:: test_theme_against ( & theme_file, & paths) ;
414
414
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" ) ;
417
417
return 1 ;
418
418
}
419
419
themes. push ( theme_file) ;
Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ c // sdf
348
348
d {}
349
349
"# ;
350
350
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( ) ) ) ) ;
352
352
}
353
353
354
354
#[ test]
Original file line number Diff line number Diff line change 17
17
import sys
18
18
19
19
FILES_TO_IGNORE = ['main.css' ]
20
- THEME_DIR_PATH = "src/librustdoc/html/static/themes"
21
20
22
21
23
22
def print_err (msg ):
@@ -31,14 +30,15 @@ def exec_command(command):
31
30
32
31
33
32
def main (argv ):
34
- if len (argv ) < 1 :
33
+ if len (argv ) < 2 :
35
34
print_err ("Needs rustdoc binary path" )
36
35
return 1
37
36
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 ]
40
40
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 ))
42
42
return 1
43
43
args = [rustdoc_bin , '-Z' , 'unstable-options' , '--theme-checker' ]
44
44
args .extend (themes )
You can’t perform that action at this time.
0 commit comments