Skip to content

Commit f585767

Browse files
committed
Revert "Teach compiletest to use multiple --src-base's"
This reverts commit 8a07f57.
1 parent fdcc415 commit f585767

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

src/compiletest/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct config {
3636
llvm_bin_path: Option<Path>,
3737

3838
// The directory containing the tests to run
39-
src_base: ~[Path],
39+
src_base: Path,
4040

4141
// The directory where programs should be built
4242
build_base: Path,

src/compiletest/compiletest.rs

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::os;
1919
use std::f64;
2020

2121
use extra::getopts;
22-
use extra::getopts::groups::{optopt, optflag, reqopt, optmulti};
22+
use extra::getopts::groups::{optopt, optflag, reqopt};
2323
use extra::test;
2424

2525
use common::config;
@@ -49,19 +49,19 @@ pub fn main() {
4949
pub fn parse_config(args: ~[~str]) -> config {
5050

5151
let groups : ~[getopts::groups::OptGroup] =
52-
~[reqopt ("", "compile-lib-path", "path to host shared libraries", "PATH"),
53-
reqopt ("", "run-lib-path", "path to target shared libraries", "PATH"),
54-
reqopt ("", "rustc-path", "path to rustc to use for compiling", "PATH"),
55-
optopt ("", "clang-path", "path to executable for codegen tests", "PATH"),
56-
optopt ("", "llvm-bin-path", "path to directory holding llvm binaries", "DIR"),
57-
optmulti ("", "src-base", "directory to scan for test files", "PATH"),
58-
reqopt ("", "build-base", "directory to deposit test outputs", "PATH"),
59-
reqopt ("", "aux-base", "directory to find auxiliary test files", "PATH"),
60-
reqopt ("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
61-
reqopt ("", "mode", "which sort of compile tests to run",
62-
" (compile-fail|run-fail|run-pass|pretty|debug-info)"),
63-
optflag ("", "ignored", "run tests marked as ignored / xfailed"),
64-
optopt ("", "runtool", "supervisor program to run tests under \
52+
~[reqopt("", "compile-lib-path", "path to host shared libraries", "PATH"),
53+
reqopt("", "run-lib-path", "path to target shared libraries", "PATH"),
54+
reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH"),
55+
optopt("", "clang-path", "path to executable for codegen tests", "PATH"),
56+
optopt("", "llvm-bin-path", "path to directory holding llvm binaries", "DIR"),
57+
reqopt("", "src-base", "directory to scan for test files", "PATH"),
58+
reqopt("", "build-base", "directory to deposit test outputs", "PATH"),
59+
reqopt("", "aux-base", "directory to find auxiliary test files", "PATH"),
60+
reqopt("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
61+
reqopt("", "mode", "which sort of compile tests to run",
62+
"(compile-fail|run-fail|run-pass|pretty|debug-info)"),
63+
optflag("", "ignored", "run tests marked as ignored / xfailed"),
64+
optopt("", "runtool", "supervisor program to run tests under \
6565
(eg. emulator, valgrind)", "PROGRAM"),
6666
optopt("", "rustcflags", "flags to pass to rustc", "FLAGS"),
6767
optflag("", "verbose", "run tests verbosely, showing all output"),
@@ -105,16 +105,14 @@ pub fn parse_config(args: ~[~str]) -> config {
105105
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
106106
Path(getopts::opt_str(m, nm))
107107
}
108-
109-
let src_base = getopts::opt_strs(matches, "src-base");
110108

111109
config {
112110
compile_lib_path: getopts::opt_str(matches, "compile-lib-path"),
113111
run_lib_path: getopts::opt_str(matches, "run-lib-path"),
114112
rustc_path: opt_path(matches, "rustc-path"),
115113
clang_path: getopts::opt_maybe_str(matches, "clang-path").map_move(|s| Path(s)),
116114
llvm_bin_path: getopts::opt_maybe_str(matches, "llvm-bin-path").map_move(|s| Path(s)),
117-
src_base: src_base.iter().map(|x| Path(x.clone())).collect(),
115+
src_base: opt_path(matches, "src-base"),
118116
build_base: opt_path(matches, "build-base"),
119117
aux_base: opt_path(matches, "aux-base"),
120118
stage_id: getopts::opt_str(matches, "stage-id"),
@@ -250,7 +248,7 @@ pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
250248
debug!("making tests from %s",
251249
config.src_base.to_str());
252250
let mut tests = ~[];
253-
let dirs = config.src_base.iter().flat_map(|x| os::list_dir_path(x).move_iter()).to_owned_vec();
251+
let dirs = os::list_dir_path(&config.src_base);
254252
for file in dirs.iter() {
255253
let file = file.clone();
256254
debug!("inspecting file %s", file.to_str());

0 commit comments

Comments
 (0)