@@ -1149,11 +1149,20 @@ fn compile_test(config: &Config, props: &TestProps,
11491149}
11501150
11511151fn document ( config : & Config , props : & TestProps ,
1152- testfile : & Path ) -> ( ProcRes , PathBuf ) {
1152+ testfile : & Path , out_dir : & Path ) -> ProcRes {
1153+ if props. build_aux_docs {
1154+ for rel_ab in & props. aux_builds {
1155+ let abs_ab = config. aux_base . join ( rel_ab) ;
1156+ let aux_props = header:: load_props ( & abs_ab) ;
1157+
1158+ let auxres = document ( config, & aux_props, & abs_ab, out_dir) ;
1159+ if !auxres. status . success ( ) {
1160+ return auxres;
1161+ }
1162+ }
1163+ }
1164+
11531165 let aux_dir = aux_output_dir_name ( config, testfile) ;
1154- let out_dir = output_base_name ( config, testfile) ;
1155- let _ = fs:: remove_dir_all ( & out_dir) ;
1156- ensure_dir ( & out_dir) ;
11571166 let mut args = vec ! [ "-L" . to_owned( ) ,
11581167 aux_dir. to_str( ) . unwrap( ) . to_owned( ) ,
11591168 "-o" . to_owned( ) ,
@@ -1164,7 +1173,7 @@ fn document(config: &Config, props: &TestProps,
11641173 prog : config. rustdoc_path . to_str ( ) . unwrap ( ) . to_owned ( ) ,
11651174 args : args,
11661175 } ;
1167- ( compose_and_run_compiler ( config, props, testfile, args, None ) , out_dir )
1176+ compose_and_run_compiler ( config, props, testfile, args, None )
11681177}
11691178
11701179fn exec_compiled_test ( config : & Config , props : & TestProps ,
@@ -1723,7 +1732,11 @@ fn charset() -> &'static str {
17231732}
17241733
17251734fn run_rustdoc_test ( config : & Config , props : & TestProps , testfile : & Path ) {
1726- let ( proc_res, out_dir) = document ( config, props, testfile) ;
1735+ let out_dir = output_base_name ( config, testfile) ;
1736+ let _ = fs:: remove_dir_all ( & out_dir) ;
1737+ ensure_dir ( & out_dir) ;
1738+
1739+ let proc_res = document ( config, props, testfile, & out_dir) ;
17271740 if !proc_res. status . success ( ) {
17281741 fatal_proc_rec ( "rustdoc failed!" , & proc_res) ;
17291742 }
0 commit comments