Skip to content

Commit 6a22595

Browse files
committed
auto merge of #8886 : cmr/rust/test-restructure, r=cmr
2 parents 116c034 + d7be86f commit 6a22595

37 files changed

+21
-24
lines changed

mk/tests.mk

+4-5
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,15 @@ RFAIL_RC := $(wildcard $(S)src/test/run-fail/*.rc)
476476
RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
477477
CFAIL_RC := $(wildcard $(S)src/test/compile-fail/*.rc)
478478
CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
479-
BENCH_RS := $(wildcard $(S)src/test/bench/rt/*.rs $(S)src/test/bench/shootout/*.rs $(S)src/test/bench/std/*.rs $(S)src/test/bench/*.rs)
479+
BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
480480
PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
481481
DEBUGINFO_RS := $(wildcard $(S)src/test/debug-info/*.rs)
482482
CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
483483
CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
484484

485485
# perf tests are the same as bench tests only they run under
486486
# a performance monitor.
487-
PERF_RS := $(BENCH_RS)
487+
PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
488488

489489
RPASS_TESTS := $(RPASS_RC) $(RPASS_RS)
490490
RPASS_FULL_TESTS := $(RPASS_FULL_RC) $(RPASS_FULL_RS)
@@ -516,7 +516,7 @@ CTEST_BUILD_BASE_cfail = compile-fail
516516
CTEST_MODE_cfail = compile-fail
517517
CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)
518518

519-
CTEST_SRC_BASE_bench = bench bench/rt bench/shootout bench/std
519+
CTEST_SRC_BASE_bench = bench
520520
CTEST_BUILD_BASE_bench = bench
521521
CTEST_MODE_bench = run-pass
522522
CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
@@ -610,8 +610,7 @@ define DEF_RUN_COMPILETEST
610610

611611
CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
612612
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
613-
$(foreach base,$$(CTEST_SRC_BASE_$(4)), \
614-
--src-base $$(S)src/test/$$(base))/ \
613+
--src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
615614
--build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
616615
--ratchet-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) \
617616
--mode $$(CTEST_MODE_$(4)) \

src/compiletest/common.rs

+1-1
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

+16-18
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,15 +105,13 @@ pub fn parse_config(args: ~[~str]) -> config {
105105
Path(getopts::opt_str(m, nm))
106106
}
107107

108-
let src_base = getopts::opt_strs(matches, "src-base");
109-
110108
config {
111109
compile_lib_path: getopts::opt_str(matches, "compile-lib-path"),
112110
run_lib_path: getopts::opt_str(matches, "run-lib-path"),
113111
rustc_path: opt_path(matches, "rustc-path"),
114112
clang_path: getopts::opt_maybe_str(matches, "clang-path").map_move(|s| Path(s)),
115113
llvm_bin_path: getopts::opt_maybe_str(matches, "llvm-bin-path").map_move(|s| Path(s)),
116-
src_base: src_base.iter().map(|x| Path(x.clone())).collect(),
114+
src_base: opt_path(matches, "src-base"),
117115
build_base: opt_path(matches, "build-base"),
118116
aux_base: opt_path(matches, "aux-base"),
119117
stage_id: getopts::opt_str(matches, "stage-id"),
@@ -247,7 +245,7 @@ pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
247245
debug!("making tests from %s",
248246
config.src_base.to_str());
249247
let mut tests = ~[];
250-
let dirs = config.src_base.iter().flat_map(|x| os::list_dir_path(x).move_iter()).to_owned_vec();
248+
let dirs = os::list_dir_path(&config.src_base);
251249
for file in dirs.iter() {
252250
let file = file.clone();
253251
debug!("inspecting file %s", file.to_str());
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)