Further corrections to the Makefile rules covering failing tests.

This commit is contained in:
Graydon Hoare 2011-01-10 14:53:20 -08:00
parent 9e5f6d3977
commit e96414a6f0
9 changed files with 27 additions and 8 deletions

View File

@ -642,6 +642,7 @@ test/run-fail/%.out.tmp: test/run-fail/%$(CFG_EXE_SUFFIX) \
$(CFG_RUNTIME)
$(CFG_QUIET)rm -f $<.tmp
@$(call CFG_ECHO, run: $<)
$(CFG_QUIET)grep -q error-pattern test/run-fail/$(basename $*).rs
$(CFG_QUIET)rm -f $@
$(CFG_QUIET)$(call CFG_RUN_TARG, $<) >$@ 2>&1 ; X=$$? ; \
if [ $$X -eq 0 ] ; then exit 1 ; else exit 0 ; fi
@ -652,15 +653,17 @@ test/run-fail/%.out.tmp: test/run-fail/%$(CFG_EXE_SUFFIX) \
test/compile-fail/%.boot.out.tmp: test/compile-fail/%.rs $(BREQ)
@$(call CFG_ECHO, compile [boot]: $<)
$(CFG_QUIET)grep -q error-pattern $<
$(CFG_QUIET)rm -f $@
$(BOOT) -o $(@:.out=$(CFG_EXE_SUFFIX)) $< >$@ 2>&1 || true
$(BOOT) -o $(@:.out=$(CFG_EXE_SUFFIX)) $< >$@ 2>&1; test $$? -ne 0
$(CFG_QUIET)grep --text --quiet \
"`awk -F: '/error-pattern/ { print $$2 }' $< | tr -d '\n\r'`" $@
test/compile-fail/%.rustc.out.tmp: test/compile-fail/%.rs $(SREQ)
@$(call CFG_ECHO, compile [rustc]: $<)
$(CFG_QUIET)grep -q error-pattern $<
$(CFG_QUIET)rm -f $@
$(RUSTC) -o $(@:.out=$(CFG_EXE_SUFFIX)) $< >$@ 2>&1 || true
$(RUSTC) -o $(@:.out=$(CFG_EXE_SUFFIX)) $< >$@ 2>&1; test $$? -ne 0
$(CFG_QUIET)grep --text --quiet \
"`awk -F: '/error-pattern/ { print $$2 }' $< | tr -d '\n\r'`" $@

View File

@ -1,17 +1,19 @@
// -*- rust -*-
type color = tag(
rgb(int, int, int),
rgba(int, int, int, int)
);
// error-pattern: unresolved
tag color {
rgb(int, int, int);
rgba(int, int, int, int);
}
fn main() -> () {
let color red = rgb(255, 0, 0);
alt (red) {
case (rgb(int r, int g, int b)) {
case (rgb(?r, ?g, ?b)) {
log "rgb";
}
case (hsl(int h, int s, int l)) {
case (hsl(?h, ?s, ?l)) {
log "hsl";
}
}

View File

@ -1,5 +1,7 @@
// -*- rust -*-
// error-pattern: dead
fn f(str caller) {
log caller;
}

View File

@ -1,5 +1,7 @@
// -*- rust -*-
// error-pattern: dead
fn f(str caller) {
log caller;
}

View File

@ -1,5 +1,7 @@
// -*- rust -*-
// error-pattern: record
type point = rec(int x, int y);
fn main() {

View File

@ -1,5 +1,7 @@
// -*- rust -*-
// error-pattern: precondition
type point = rec(int x, int y);
fn main() {

View File

@ -1,5 +1,7 @@
// -*- rust -*-
// error-pattern: name
mod foo {
fn bar[T](T f) -> int { ret 17; }
type bar[U, T] = tup(int, U, T);

View File

@ -1,5 +1,7 @@
// -*- rust -*-
// error-pattern: mismatched types
// Issue #51.
type point = rec(int x, int y);

View File

@ -1,5 +1,7 @@
// -*- rust -*-
// error-pattern: token
/*
* This is an un-balanced /* multi-line comment.
*/