diff options
| author | Graydon Hoare <[email protected]> | 2011-01-10 14:53:20 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-01-10 14:53:20 -0800 |
| commit | e96414a6f045465cc261d6f9ea823e9e60291886 (patch) | |
| tree | 2caa9bd248897ad17e6d60ff3edf4c16400472bf /src | |
| parent | Cleanup circular_buffer (diff) | |
| download | rust-e96414a6f045465cc261d6f9ea823e9e60291886.tar.xz rust-e96414a6f045465cc261d6f9ea823e9e60291886.zip | |
Further corrections to the Makefile rules covering failing tests.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 7 | ||||
| -rw-r--r-- | src/test/compile-fail/bogus-tag.rs | 14 | ||||
| -rw-r--r-- | src/test/compile-fail/dead-code-be.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/dead-code-ret.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/fru-extra-field.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/fru-typestate.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/item-name-overload.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/rec-missing-fields.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/unbalanced-comment.rs | 2 |
9 files changed, 27 insertions, 8 deletions
diff --git a/src/Makefile b/src/Makefile index 4d290b10..7127e4b1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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'`" $@ diff --git a/src/test/compile-fail/bogus-tag.rs b/src/test/compile-fail/bogus-tag.rs index 35c5736c..9e5564df 100644 --- a/src/test/compile-fail/bogus-tag.rs +++ b/src/test/compile-fail/bogus-tag.rs @@ -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"; } } diff --git a/src/test/compile-fail/dead-code-be.rs b/src/test/compile-fail/dead-code-be.rs index 060b466a..af1456a4 100644 --- a/src/test/compile-fail/dead-code-be.rs +++ b/src/test/compile-fail/dead-code-be.rs @@ -1,5 +1,7 @@ // -*- rust -*- +// error-pattern: dead + fn f(str caller) { log caller; } diff --git a/src/test/compile-fail/dead-code-ret.rs b/src/test/compile-fail/dead-code-ret.rs index 7fbdcb0e..4c52fcaa 100644 --- a/src/test/compile-fail/dead-code-ret.rs +++ b/src/test/compile-fail/dead-code-ret.rs @@ -1,5 +1,7 @@ // -*- rust -*- +// error-pattern: dead + fn f(str caller) { log caller; } diff --git a/src/test/compile-fail/fru-extra-field.rs b/src/test/compile-fail/fru-extra-field.rs index 2762b54f..601aca26 100644 --- a/src/test/compile-fail/fru-extra-field.rs +++ b/src/test/compile-fail/fru-extra-field.rs @@ -1,5 +1,7 @@ // -*- rust -*- +// error-pattern: record + type point = rec(int x, int y); fn main() { diff --git a/src/test/compile-fail/fru-typestate.rs b/src/test/compile-fail/fru-typestate.rs index c15683c8..86c68e5b 100644 --- a/src/test/compile-fail/fru-typestate.rs +++ b/src/test/compile-fail/fru-typestate.rs @@ -1,5 +1,7 @@ // -*- rust -*- +// error-pattern: precondition + type point = rec(int x, int y); fn main() { diff --git a/src/test/compile-fail/item-name-overload.rs b/src/test/compile-fail/item-name-overload.rs index 06429c76..f0f585f5 100644 --- a/src/test/compile-fail/item-name-overload.rs +++ b/src/test/compile-fail/item-name-overload.rs @@ -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); diff --git a/src/test/compile-fail/rec-missing-fields.rs b/src/test/compile-fail/rec-missing-fields.rs index 83736d5e..5b7dd4d8 100644 --- a/src/test/compile-fail/rec-missing-fields.rs +++ b/src/test/compile-fail/rec-missing-fields.rs @@ -1,5 +1,7 @@ // -*- rust -*- +// error-pattern: mismatched types + // Issue #51. type point = rec(int x, int y); diff --git a/src/test/compile-fail/unbalanced-comment.rs b/src/test/compile-fail/unbalanced-comment.rs index c22df4ec..a1916fdc 100644 --- a/src/test/compile-fail/unbalanced-comment.rs +++ b/src/test/compile-fail/unbalanced-comment.rs @@ -1,5 +1,7 @@ // -*- rust -*- +// error-pattern: token + /* * This is an un-balanced /* multi-line comment. */ |