Integrate shootout benchmarks into testsuite
This commit is contained in:
parent
242ecd0e96
commit
8438eca45c
2 changed files with 17 additions and 8 deletions
15
src/Makefile
15
src/Makefile
|
@ -574,7 +574,8 @@ TEST_XFAILS_RUSTC := $(addprefix test/run-pass/, \
|
||||||
while-type-error.rs \
|
while-type-error.rs \
|
||||||
wrong-ret-type.rs \
|
wrong-ret-type.rs \
|
||||||
), \
|
), \
|
||||||
$(wildcard test/*fail/*.rs test/*fail/*.rc))
|
$(wildcard test/*fail/*.rs test/*fail/*.rc)) \
|
||||||
|
test/bench/shootout/fasta.rs
|
||||||
|
|
||||||
|
|
||||||
ifdef MINGW_CROSS
|
ifdef MINGW_CROSS
|
||||||
|
@ -586,8 +587,10 @@ TEST_XFAILS_BOOT += test/run-pass/native-mod.rc
|
||||||
TEST_XFAILS_RUSTC += test/run-pass/native-mod.rc
|
TEST_XFAILS_RUSTC += test/run-pass/native-mod.rc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
RPASS_RC := $(wildcard test/run-pass/*.rc)
|
BENCH_RC := $(wildcard test/bench/shootout/*rc)
|
||||||
RPASS_RS := $(wildcard test/run-pass/*.rs)
|
BENCH_RS := $(wildcard test/bench/shootout/*rs)
|
||||||
|
RPASS_RC := $(wildcard test/run-pass/*.rc) $(BENCH_RC)
|
||||||
|
RPASS_RS := $(wildcard test/run-pass/*.rs) $(BENCH_RS)
|
||||||
RFAIL_RC := $(wildcard test/run-fail/*.rc)
|
RFAIL_RC := $(wildcard test/run-fail/*.rc)
|
||||||
RFAIL_RS := $(wildcard test/run-fail/*.rs)
|
RFAIL_RS := $(wildcard test/run-fail/*.rs)
|
||||||
CFAIL_RC := $(wildcard test/compile-fail/*.rc)
|
CFAIL_RC := $(wildcard test/compile-fail/*.rc)
|
||||||
|
@ -731,6 +734,12 @@ test/run-pass/%.out.tmp: test/run-pass/%$(CFG_EXE_SUFFIX) $(CFG_RUNTIME)
|
||||||
@$(call CFG_ECHO, run: $<)
|
@$(call CFG_ECHO, run: $<)
|
||||||
$(CFG_QUIET)$(call CFG_RUN_TARG, $<) > $@
|
$(CFG_QUIET)$(call CFG_RUN_TARG, $<) > $@
|
||||||
|
|
||||||
|
test/bench/shootout/%.out.tmp: test/bench/shootout/%$(CFG_EXE_SUFFIX) \
|
||||||
|
$(CFG_RUNTIME)
|
||||||
|
$(CFG_QUIET)rm -f $<.tmp
|
||||||
|
@$(call CFG_ECHO, run: $<)
|
||||||
|
$(CFG_QUIET)$(call CFG_RUN_TARG, $<) > $@
|
||||||
|
|
||||||
test/run-fail/%.out.tmp: test/run-fail/%$(CFG_EXE_SUFFIX) \
|
test/run-fail/%.out.tmp: test/run-fail/%$(CFG_EXE_SUFFIX) \
|
||||||
$(CFG_RUNTIME)
|
$(CFG_RUNTIME)
|
||||||
$(CFG_QUIET)rm -f $<.tmp
|
$(CFG_QUIET)rm -f $<.tmp
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
tag tree {
|
tag tree {
|
||||||
nil();
|
nil;
|
||||||
node(@tree, @tree, int);
|
node(@tree, @tree, int);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn item_check(&tree t) -> int {
|
fn item_check(@tree t) -> int {
|
||||||
alt (t) {
|
alt (*t) {
|
||||||
case (nil()) {
|
case (nil) {
|
||||||
ret 0;
|
ret 0;
|
||||||
}
|
}
|
||||||
case (node(@tree left, @tree right, int item)) {
|
case (node(?left, ?right, ?item)) {
|
||||||
ret item + item_check(left) - item_check(right);
|
ret item + item_check(left) - item_check(right);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue