diff options
| author | Brian Anderson <[email protected]> | 2011-03-06 18:35:07 -0500 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-03-14 15:52:48 -0700 |
| commit | 8438eca45cf20b4949450aaf2a3bd5212877d337 (patch) | |
| tree | d7ec1601effc334f3f98a4aac176d19047cc321a /src | |
| parent | Reorganize makefile targets (diff) | |
| download | rust-8438eca45cf20b4949450aaf2a3bd5212877d337.tar.xz rust-8438eca45cf20b4949450aaf2a3bd5212877d337.zip | |
Integrate shootout benchmarks into testsuite
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 15 | ||||
| -rw-r--r-- | src/test/bench/shootout/binary-trees.rs | 10 |
2 files changed, 17 insertions, 8 deletions
diff --git a/src/Makefile b/src/Makefile index 6627a90d..e2f2957c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -574,7 +574,8 @@ TEST_XFAILS_RUSTC := $(addprefix test/run-pass/, \ while-type-error.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 @@ -586,8 +587,10 @@ TEST_XFAILS_BOOT += test/run-pass/native-mod.rc TEST_XFAILS_RUSTC += test/run-pass/native-mod.rc endif -RPASS_RC := $(wildcard test/run-pass/*.rc) -RPASS_RS := $(wildcard test/run-pass/*.rs) +BENCH_RC := $(wildcard test/bench/shootout/*rc) +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_RS := $(wildcard test/run-fail/*.rs) 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: $<) $(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) \ $(CFG_RUNTIME) $(CFG_QUIET)rm -f $<.tmp diff --git a/src/test/bench/shootout/binary-trees.rs b/src/test/bench/shootout/binary-trees.rs index 669cd809..5f879434 100644 --- a/src/test/bench/shootout/binary-trees.rs +++ b/src/test/bench/shootout/binary-trees.rs @@ -1,14 +1,14 @@ tag tree { - nil(); + nil; node(@tree, @tree, int); } -fn item_check(&tree t) -> int { - alt (t) { - case (nil()) { +fn item_check(@tree t) -> int { + alt (*t) { + case (nil) { ret 0; } - case (node(@tree left, @tree right, int item)) { + case (node(?left, ?right, ?item)) { ret item + item_check(left) - item_check(right); } } |