Skip to content

Commit 6824f13

Browse files
committed
Add pfail targets for parse-fail tests
1 parent 5550beb commit 6824f13

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ do
10561056
make_dir $h/test/run-pass-fulldeps
10571057
make_dir $h/test/run-fail
10581058
make_dir $h/test/compile-fail
1059+
make_dir $h/test/parse-fail
10591060
make_dir $h/test/compile-fail-fulldeps
10601061
make_dir $h/test/bench
10611062
make_dir $h/test/perf

mk/tests.mk

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ check-notidy: cleantmptestlogs cleantestlibs all check-stage2
173173
check-lite: cleantestlibs cleantmptestlogs \
174174
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
175175
check-stage2-rpass check-stage2-rpass-valgrind \
176-
check-stage2-rfail check-stage2-cfail check-stage2-rmake
176+
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
177177
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
178178

179179
# Only check the 'reference' tests: rpass/cfail/rfail/rmake.
180180
check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
181-
check-stage2-rfail check-stage2-cfail check-stage2-rmake
181+
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
182182
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
183183

184184
# Only check the docs.
@@ -290,6 +290,7 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
290290
check-stage$(1)-T-$(2)-H-$(3)-rpass-exec \
291291
check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
292292
check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
293+
check-stage$(1)-T-$(2)-H-$(3)-pfail-exec \
293294
check-stage$(1)-T-$(2)-H-$(3)-rpass-valgrind-exec \
294295
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
295296
check-stage$(1)-T-$(2)-H-$(3)-cfail-full-exec \
@@ -469,7 +470,8 @@ RPASS_VALGRIND_TESTS := $(RPASS_VALGRIND_RS)
469470
RPASS_FULL_TESTS := $(RPASS_FULL_RS)
470471
CFAIL_FULL_TESTS := $(CFAIL_FULL_RS)
471472
RFAIL_TESTS := $(RFAIL_RS)
472-
CFAIL_TESTS := $(CFAIL_RS) $(PFAIL_RS)
473+
CFAIL_TESTS := $(CFAIL_RS)
474+
PFAIL_TESTS := $(PFAIL_RS)
473475
BENCH_TESTS := $(BENCH_RS)
474476
PERF_TESTS := $(PERF_RS)
475477
PRETTY_TESTS := $(PRETTY_RS)
@@ -507,6 +509,11 @@ CTEST_BUILD_BASE_cfail = compile-fail
507509
CTEST_MODE_cfail = compile-fail
508510
CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)
509511

512+
CTEST_SRC_BASE_pfail = parse-fail
513+
CTEST_BUILD_BASE_pfail = parse-fail
514+
CTEST_MODE_pfail = parse-fail
515+
CTEST_RUNTOOL_pfail = $(CTEST_RUNTOOL)
516+
510517
CTEST_SRC_BASE_bench = bench
511518
CTEST_BUILD_BASE_bench = bench
512519
CTEST_MODE_bench = run-pass
@@ -629,6 +636,7 @@ CTEST_DEPS_rpass-full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(CSREQ$(1)_T_$
629636
CTEST_DEPS_cfail-full_$(1)-T-$(2)-H-$(3) = $$(CFAIL_FULL_TESTS) $$(CSREQ$(1)_T_$(3)_H_$(3)) $$(SREQ$(1)_T_$(2)_H_$(3))
630637
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
631638
CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
639+
CTEST_DEPS_pfail_$(1)-T-$(2)-H-$(3) = $$(PFAIL_TESTS)
632640
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3) = $$(BENCH_TESTS)
633641
CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3) = $$(PERF_TESTS)
634642
CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3) = $$(DEBUGINFO_GDB_TESTS)
@@ -697,7 +705,7 @@ endif
697705

698706
endef
699707

700-
CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail bench perf debuginfo-gdb debuginfo-lldb codegen
708+
CTEST_NAMES = rpass rpass-valgrind rpass-full cfail-full rfail cfail pfail bench perf debuginfo-gdb debuginfo-lldb codegen
701709

702710
$(foreach host,$(CFG_HOST), \
703711
$(eval $(foreach target,$(CFG_TARGET), \
@@ -856,6 +864,7 @@ TEST_GROUPS = \
856864
cfail-full \
857865
rfail \
858866
cfail \
867+
pfail \
859868
bench \
860869
perf \
861870
rmake \

src/compiletest/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use std::str::FromStr;
1515
#[derive(Clone, Copy, PartialEq, Debug)]
1616
pub enum Mode {
1717
CompileFail,
18+
ParseFail,
1819
RunFail,
1920
RunPass,
2021
RunPassValgrind,
@@ -29,6 +30,7 @@ impl FromStr for Mode {
2930
fn from_str(s: &str) -> Result<Mode, ()> {
3031
match s {
3132
"compile-fail" => Ok(CompileFail),
33+
"parse-fail" => Ok(ParseFail),
3234
"run-fail" => Ok(RunFail),
3335
"run-pass" => Ok(RunPass),
3436
"run-pass-valgrind" => Ok(RunPassValgrind),
@@ -45,6 +47,7 @@ impl fmt::Display for Mode {
4547
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4648
fmt::Display::fmt(match *self {
4749
CompileFail => "compile-fail",
50+
ParseFail => "parse-fail",
4851
RunFail => "run-fail",
4952
RunPass => "run-pass",
5053
RunPassValgrind => "run-pass-valgrind",

src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
7272
reqopt("", "aux-base", "directory to find auxiliary test files", "PATH"),
7373
reqopt("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
7474
reqopt("", "mode", "which sort of compile tests to run",
75-
"(compile-fail|run-fail|run-pass|run-pass-valgrind|pretty|debug-info)"),
75+
"(compile-fail|parse-fail|run-fail|run-pass|run-pass-valgrind|pretty|debug-info)"),
7676
optflag("", "ignored", "run tests marked as ignored"),
7777
optopt("", "runtool", "supervisor program to run tests under \
7878
(eg. emulator, valgrind)", "PROGRAM"),

src/compiletest/runtest.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use self::TargetLocation::*;
1212

1313
use common::Config;
14-
use common::{CompileFail, Pretty, RunFail, RunPass, RunPassValgrind, DebugInfoGdb};
14+
use common::{CompileFail, ParseFail, Pretty, RunFail, RunPass, RunPassValgrind, DebugInfoGdb};
1515
use common::{Codegen, DebugInfoLldb};
1616
use errors;
1717
use header::TestProps;
@@ -66,6 +66,7 @@ pub fn run_metrics(config: Config, testfile: String, mm: &mut MetricMap) {
6666
debug!("loaded props");
6767
match config.mode {
6868
CompileFail => run_cfail_test(&config, &props, &testfile),
69+
ParseFail => run_cfail_test(&config, &props, &testfile),
6970
RunFail => run_rfail_test(&config, &props, &testfile),
7071
RunPass => run_rpass_test(&config, &props, &testfile),
7172
RunPassValgrind => run_valgrind_test(&config, &props, &testfile),
@@ -88,7 +89,7 @@ fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
8889
let proc_res = compile_test(config, props, testfile);
8990

9091
if proc_res.status.success() {
91-
fatal_proc_rec("compile-fail test compiled successfully!",
92+
fatal_proc_rec(&format!("{} test compiled successfully!", config.mode)[],
9293
&proc_res);
9394
}
9495

0 commit comments

Comments
 (0)