Skip to content

Commit 2f7bc90

Browse files
committed
Add a stdtest crate to hold the standard library tests
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
1 parent b06ccb4 commit 2f7bc90

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ for i in \
182182
dl stage0 stage1 stage2 stage3 \
183183
stage0/lib stage1/lib stage2/lib stage3/lib \
184184
test/run-pass test/run-fail test/compile-fail \
185-
test/bench/99-bottles test/bench/shootout
185+
test/bench/99-bottles test/bench/shootout \
186+
test/stdtest
186187
do
187188
make_dir $i
188189
done

mk/tests.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,10 @@ test/compile-fail/%.stage2.out.tmp: test/compile-fail/%.rc $(SREQ2)
337337
$(STAGE2) -c -o $(@:.o=$(X)) $< >$@ 2>&1; test $$? -ne 0
338338
$(Q)grep --text --quiet \
339339
"$$(grep error-pattern $< | cut -d : -f 2- | tr -d '\n\r')" $@
340+
341+
STDTEST_CRATE := $(S)src/test/stdtest/stdtest.rc
342+
STDTEST_INPUTS := $(wildcard $(S)src/test/stdtest/*rs)
343+
344+
test/stdtest/stdtest.stage1$(X): $(STDTEST_CRATE) $(STDTEST_INPUTS) $(SREQ1)
345+
@$(call E, compile_and_link: $@)
346+
$(STAGE1) -o $@ $< --test

src/test/stdtest/stdtest.rc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use std;
2+
3+
// Local Variables:
4+
// mode: rust
5+
// fill-column: 78;
6+
// indent-tabs-mode: nil
7+
// c-basic-offset: 4
8+
// buffer-file-coding-system: utf-8-unix
9+
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
10+
// End:

0 commit comments

Comments
 (0)