@@ -574,22 +574,22 @@ impl Step for RustdocTheme {
574
574
}
575
575
576
576
#[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
577
- pub struct RustdocJS {
577
+ pub struct RustdocJSStd {
578
578
pub host : Interned < String > ,
579
579
pub target : Interned < String > ,
580
580
}
581
581
582
- impl Step for RustdocJS {
582
+ impl Step for RustdocJSStd {
583
583
type Output = ( ) ;
584
584
const DEFAULT : bool = true ;
585
585
const ONLY_HOSTS : bool = true ;
586
586
587
587
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
588
- run. path ( "src/test/rustdoc-js" )
588
+ run. path ( "src/test/rustdoc-js-std " )
589
589
}
590
590
591
591
fn make_run ( run : RunConfig < ' _ > ) {
592
- run. builder . ensure ( RustdocJS {
592
+ run. builder . ensure ( RustdocJSStd {
593
593
host : run. host ,
594
594
target : run. target ,
595
595
} ) ;
@@ -598,12 +598,55 @@ impl Step for RustdocJS {
598
598
fn run ( self , builder : & Builder < ' _ > ) {
599
599
if let Some ( ref nodejs) = builder. config . nodejs {
600
600
let mut command = Command :: new ( nodejs) ;
601
- command. args ( & [ "src/tools/rustdoc-js/tester.js" , & * self . host ] ) ;
601
+ command. args ( & [ "src/tools/rustdoc-js-std /tester.js" , & * self . host ] ) ;
602
602
builder. ensure ( crate :: doc:: Std {
603
603
target : self . target ,
604
604
stage : builder. top_stage ,
605
605
} ) ;
606
606
builder. run ( & mut command) ;
607
+ } else {
608
+ builder. info (
609
+ "No nodejs found, skipping \" src/test/rustdoc-js-std\" tests"
610
+ ) ;
611
+ }
612
+ }
613
+ }
614
+
615
+ #[ derive( Debug , Copy , Clone , Hash , PartialEq , Eq ) ]
616
+ pub struct RustdocJSNotStd {
617
+ pub host : Interned < String > ,
618
+ pub target : Interned < String > ,
619
+ pub compiler : Compiler ,
620
+ }
621
+
622
+ impl Step for RustdocJSNotStd {
623
+ type Output = ( ) ;
624
+ const DEFAULT : bool = true ;
625
+ const ONLY_HOSTS : bool = true ;
626
+
627
+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
628
+ run. path ( "src/test/rustdoc-js" )
629
+ }
630
+
631
+ fn make_run ( run : RunConfig < ' _ > ) {
632
+ let compiler = run. builder . compiler ( run. builder . top_stage , run. host ) ;
633
+ run. builder . ensure ( RustdocJSNotStd {
634
+ host : run. host ,
635
+ target : run. target ,
636
+ compiler,
637
+ } ) ;
638
+ }
639
+
640
+ fn run ( self , builder : & Builder < ' _ > ) {
641
+ if builder. config . nodejs . is_some ( ) {
642
+ builder. ensure ( Compiletest {
643
+ compiler : self . compiler ,
644
+ target : self . target ,
645
+ mode : "js-doc-test" ,
646
+ suite : "rustdoc-js" ,
647
+ path : None ,
648
+ compare_mode : None ,
649
+ } ) ;
607
650
} else {
608
651
builder. info (
609
652
"No nodejs found, skipping \" src/test/rustdoc-js\" tests"
@@ -990,12 +1033,13 @@ impl Step for Compiletest {
990
1033
. arg ( builder. sysroot_libdir ( compiler, target) ) ;
991
1034
cmd. arg ( "--rustc-path" ) . arg ( builder. rustc ( compiler) ) ;
992
1035
993
- let is_rustdoc_ui = suite. ends_with ( "rustdoc-ui" ) ;
1036
+ let is_rustdoc = suite. ends_with ( "rustdoc-ui" ) || suite . ends_with ( "rustdoc-js ") ;
994
1037
995
1038
// Avoid depending on rustdoc when we don't need it.
996
1039
if mode == "rustdoc"
997
1040
|| ( mode == "run-make" && suite. ends_with ( "fulldeps" ) )
998
- || ( mode == "ui" && is_rustdoc_ui)
1041
+ || ( mode == "ui" && is_rustdoc)
1042
+ || mode == "js-doc-test"
999
1043
{
1000
1044
cmd. arg ( "--rustdoc-path" )
1001
1045
. arg ( builder. rustdoc ( compiler. host ) ) ;
@@ -1029,12 +1073,12 @@ impl Step for Compiletest {
1029
1073
cmd. arg ( "--nodejs" ) . arg ( nodejs) ;
1030
1074
}
1031
1075
1032
- let mut flags = if is_rustdoc_ui {
1076
+ let mut flags = if is_rustdoc {
1033
1077
Vec :: new ( )
1034
1078
} else {
1035
1079
vec ! [ "-Crpath" . to_string( ) ]
1036
1080
} ;
1037
- if !is_rustdoc_ui {
1081
+ if !is_rustdoc {
1038
1082
if builder. config . rust_optimize_tests {
1039
1083
flags. push ( "-O" . to_string ( ) ) ;
1040
1084
}
0 commit comments