]> git.lizzy.rs Git - rust.git/commitdiff
Add a stdtest crate to hold the standard library tests
authorBrian Anderson <banderson@mozilla.com>
Wed, 6 Jul 2011 21:33:36 +0000 (14:33 -0700)
committerBrian Anderson <banderson@mozilla.com>
Wed, 6 Jul 2011 21:39:40 +0000 (14:39 -0700)
This will link to std and compile with the --test flag. Eventually the
run-pass/lib* tests will move here.

We could also put the std tests directly into the library and compile both a
library version and a test version, but I think this way will make for faster
builds.

Issue #428

configure
mk/tests.mk
src/test/stdtest/stdtest.rc [new file with mode: 0644]

index f14c92de399c92c9ea9ba4aac29cd5262a2d4e31..94f00d1c8843b8e26c4f59b07014ac04a319d089 100755 (executable)
--- a/configure
+++ b/configure
@@ -182,7 +182,8 @@ for i in \
     dl stage0 stage1 stage2 stage3 \
     stage0/lib stage1/lib stage2/lib stage3/lib \
     test/run-pass test/run-fail test/compile-fail \
-    test/bench/99-bottles test/bench/shootout
+    test/bench/99-bottles test/bench/shootout \
+    test/stdtest
 do
     make_dir $i
 done
index 2511c3ceccd0a15db82e67e972fea69d58d29534..d7205c3fc53815c73c6dbf80d9250803309995e1 100644 (file)
@@ -337,3 +337,10 @@ test/compile-fail/%.stage2.out.tmp: test/compile-fail/%.rc $(SREQ2)
        $(STAGE2) -c -o $(@:.o=$(X)) $< >$@ 2>&1; test $$? -ne 0
        $(Q)grep --text --quiet \
       "$$(grep error-pattern $< | cut -d : -f 2- | tr -d '\n\r')" $@
+
+STDTEST_CRATE := $(S)src/test/stdtest/stdtest.rc
+STDTEST_INPUTS := $(wildcard $(S)src/test/stdtest/*rs)
+
+test/stdtest/stdtest.stage1$(X): $(STDTEST_CRATE) $(STDTEST_INPUTS) $(SREQ1)
+       @$(call E, compile_and_link: $@)
+       $(STAGE1) -o $@ $< --test
diff --git a/src/test/stdtest/stdtest.rc b/src/test/stdtest/stdtest.rc
new file mode 100644 (file)
index 0000000..07dd277
--- /dev/null
@@ -0,0 +1,10 @@
+use std;
+
+// Local Variables:
+// mode: rust
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
+// End: