@@ -103,6 +103,8 @@ crate struct Options {
103
103
crate should_test : bool ,
104
104
/// List of arguments to pass to the test harness, if running tests.
105
105
crate test_args : Vec < String > ,
106
+ /// The working directory in which to run tests.
107
+ crate test_run_directory : Option < PathBuf > ,
106
108
/// Optional path to persist the doctest executables to, defaults to a
107
109
/// temporary directory if not set.
108
110
crate persist_doctests : Option < PathBuf > ,
@@ -175,6 +177,7 @@ impl fmt::Debug for Options {
175
177
. field ( "lint_cap" , & self . lint_cap )
176
178
. field ( "should_test" , & self . should_test )
177
179
. field ( "test_args" , & self . test_args )
180
+ . field ( "test_run_directory" , & self . test_run_directory )
178
181
. field ( "persist_doctests" , & self . persist_doctests )
179
182
. field ( "default_passes" , & self . default_passes )
180
183
. field ( "manual_passes" , & self . manual_passes )
@@ -572,6 +575,7 @@ impl Options {
572
575
let enable_index_page = matches. opt_present ( "enable-index-page" ) || index_page. is_some ( ) ;
573
576
let static_root_path = matches. opt_str ( "static-root-path" ) ;
574
577
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) ;
575
579
let persist_doctests = matches. opt_str ( "persist-doctests" ) . map ( PathBuf :: from) ;
576
580
let test_builder = matches. opt_str ( "test-builder" ) . map ( PathBuf :: from) ;
577
581
let codegen_options_strs = matches. opt_strs ( "C" ) ;
@@ -613,6 +617,7 @@ impl Options {
613
617
display_warnings,
614
618
show_coverage,
615
619
crate_version,
620
+ test_run_directory,
616
621
persist_doctests,
617
622
runtool,
618
623
runtool_args,
0 commit comments