@@ -103,6 +103,8 @@ crate struct Options {
103103 crate should_test : bool ,
104104 /// List of arguments to pass to the test harness, if running tests.
105105 crate test_args : Vec < String > ,
106+ /// The working directory in which to run tests.
107+ crate test_run_directory : Option < PathBuf > ,
106108 /// Optional path to persist the doctest executables to, defaults to a
107109 /// temporary directory if not set.
108110 crate persist_doctests : Option < PathBuf > ,
@@ -175,6 +177,7 @@ impl fmt::Debug for Options {
175177 . field ( "lint_cap" , & self . lint_cap )
176178 . field ( "should_test" , & self . should_test )
177179 . field ( "test_args" , & self . test_args )
180+ . field ( "test_run_directory" , & self . test_run_directory )
178181 . field ( "persist_doctests" , & self . persist_doctests )
179182 . field ( "default_passes" , & self . default_passes )
180183 . field ( "manual_passes" , & self . manual_passes )
@@ -572,6 +575,7 @@ impl Options {
572575 let enable_index_page = matches. opt_present ( "enable-index-page" ) || index_page. is_some ( ) ;
573576 let static_root_path = matches. opt_str ( "static-root-path" ) ;
574577 let generate_search_filter = !matches. opt_present ( "disable-per-crate-search" ) ;
578+ let test_run_directory = matches. opt_str ( "test-run-directory" ) . map ( PathBuf :: from) ;
575579 let persist_doctests = matches. opt_str ( "persist-doctests" ) . map ( PathBuf :: from) ;
576580 let test_builder = matches. opt_str ( "test-builder" ) . map ( PathBuf :: from) ;
577581 let codegen_options_strs = matches. opt_strs ( "C" ) ;
@@ -613,6 +617,7 @@ impl Options {
613617 display_warnings,
614618 show_coverage,
615619 crate_version,
620+ test_run_directory,
616621 persist_doctests,
617622 runtool,
618623 runtool_args,
0 commit comments