Make src/test/run-pass/
act like an alternative ui
test suite.
This commit is contained in:
parent
1002e404e1
commit
ddb1a2afb7
1 changed files with 22 additions and 6 deletions
|
@ -247,7 +247,6 @@ impl<'test> TestCx<'test> {
|
||||||
match self.config.mode {
|
match self.config.mode {
|
||||||
CompileFail | ParseFail => self.run_cfail_test(),
|
CompileFail | ParseFail => self.run_cfail_test(),
|
||||||
RunFail => self.run_rfail_test(),
|
RunFail => self.run_rfail_test(),
|
||||||
RunPass => self.run_rpass_test(),
|
|
||||||
RunPassValgrind => self.run_valgrind_test(),
|
RunPassValgrind => self.run_valgrind_test(),
|
||||||
Pretty => self.run_pretty_test(),
|
Pretty => self.run_pretty_test(),
|
||||||
DebugInfoGdb => self.run_debuginfo_gdb_test(),
|
DebugInfoGdb => self.run_debuginfo_gdb_test(),
|
||||||
|
@ -257,13 +256,30 @@ impl<'test> TestCx<'test> {
|
||||||
CodegenUnits => self.run_codegen_units_test(),
|
CodegenUnits => self.run_codegen_units_test(),
|
||||||
Incremental => self.run_incremental_test(),
|
Incremental => self.run_incremental_test(),
|
||||||
RunMake => self.run_rmake_test(),
|
RunMake => self.run_rmake_test(),
|
||||||
Ui => self.run_ui_test(),
|
RunPass | Ui => self.run_ui_test(),
|
||||||
MirOpt => self.run_mir_opt_test(),
|
MirOpt => self.run_mir_opt_test(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn should_run_successfully(&self) -> bool {
|
||||||
|
match self.config.mode {
|
||||||
|
RunPass => true,
|
||||||
|
Ui => self.props.run_pass,
|
||||||
|
_ => unimplemented!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn should_compile_successfully(&self) -> bool {
|
||||||
|
match self.config.mode {
|
||||||
|
CompileFail => false,
|
||||||
|
RunPass => true,
|
||||||
|
Ui => self.props.compile_pass,
|
||||||
|
mode => panic!("unimplemented for mode {:?}", mode),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn check_if_test_should_compile(&self, proc_res: &ProcRes) {
|
fn check_if_test_should_compile(&self, proc_res: &ProcRes) {
|
||||||
if self.props.compile_pass {
|
if self.should_compile_successfully() {
|
||||||
if !proc_res.status.success() {
|
if !proc_res.status.success() {
|
||||||
self.fatal_proc_rec("test compilation failed although it shouldn't!", proc_res);
|
self.fatal_proc_rec("test compilation failed although it shouldn't!", proc_res);
|
||||||
}
|
}
|
||||||
|
@ -1677,7 +1693,7 @@ impl<'test> TestCx<'test> {
|
||||||
rustc.arg("-Zui-testing");
|
rustc.arg("-Zui-testing");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ui => {
|
RunPass | Ui => {
|
||||||
if !self
|
if !self
|
||||||
.props
|
.props
|
||||||
.compile_flags
|
.compile_flags
|
||||||
|
@ -1706,7 +1722,7 @@ impl<'test> TestCx<'test> {
|
||||||
|
|
||||||
rustc.arg(dir_opt);
|
rustc.arg(dir_opt);
|
||||||
}
|
}
|
||||||
RunPass | RunFail | RunPassValgrind | Pretty | DebugInfoGdb | DebugInfoLldb
|
RunFail | RunPassValgrind | Pretty | DebugInfoGdb | DebugInfoLldb
|
||||||
| Codegen | Rustdoc | RunMake | CodegenUnits => {
|
| Codegen | Rustdoc | RunMake | CodegenUnits => {
|
||||||
// do not use JSON output
|
// do not use JSON output
|
||||||
}
|
}
|
||||||
|
@ -2691,7 +2707,7 @@ impl<'test> TestCx<'test> {
|
||||||
|
|
||||||
let expected_errors = errors::load_errors(&self.testpaths.file, self.revision);
|
let expected_errors = errors::load_errors(&self.testpaths.file, self.revision);
|
||||||
|
|
||||||
if self.props.run_pass {
|
if self.should_run_successfully() {
|
||||||
let proc_res = self.exec_compiled_test();
|
let proc_res = self.exec_compiled_test();
|
||||||
|
|
||||||
if !proc_res.status.success() {
|
if !proc_res.status.success() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue