test: Move some test outputs into $(TMPDIR)

Don't want to pollute the source tree!
This commit is contained in:
Alex Crichton 2016-03-07 14:39:37 -08:00
parent 3dd8b3ec9b
commit 9a623f3378
2 changed files with 12 additions and 8 deletions

View File

@ -1,16 +1,18 @@
-include ../tools.mk
OUT := $(TMPDIR)/out
ifndef IS_WINDOWS
all: time
time: libc
mkdir -p out/time out/time/deps
ln -sf out/libc/liblibc.rlib out/time/deps/
$(RUSTC) in/time/lib.rs -Ldependency=out/time/deps/
mkdir -p $(OUT)/time $(OUT)/time/deps
ln -sf $(OUT)/libc/liblibc.rlib $(OUT)/time/deps/
$(RUSTC) in/time/lib.rs -Ldependency=$(OUT)/time/deps/
libc:
mkdir -p out/libc
$(RUSTC) in/libc/lib.rs --crate-name=libc -o out/libc/liblibc.rlib
mkdir -p $(OUT)/libc
$(RUSTC) in/libc/lib.rs --crate-name=libc -o $(OUT)/libc/liblibc.rlib
else
all:
endif

View File

@ -1,8 +1,10 @@
-include ../tools.mk
LOG := $(TMPDIR)/foo.log
all:
cp foo.rs $(TMPDIR)
cd $(TMPDIR)
-$(RUSTC) -Z unstable-options --error-format=json foo.rs 2>foo.log
grep -q '{"message":"unresolved name `y`","code":{"code":"E0425","explanation":"\\nAn unresolved name was used. Example of erroneous codes.*"},"level":"error","spans":\[{"file_name":"foo.rs","byte_start":496,"byte_end":497,"line_start":12,"line_end":12,"column_start":18,"column_end":19}\],"children":\[\]}' foo.log
grep -q '{"message":".*","code":{"code":"E0277","explanation":"\\nYou tried.*"},"level":"error","spans":\[{.*}\],"children":\[{"message":"the .*","code":null,"level":"help","spans":\[{"file_name":"foo.rs","byte_start":504,"byte_end":516,"line_start":14,"line_end":14,"column_start":0,"column_end":0}\],"children":\[\]},{"message":" <u8 as core::ops::Add>","code":null,"level":"help",' foo.log
-$(RUSTC) -Z unstable-options --error-format=json foo.rs 2>$(LOG)
grep -q '{"message":"unresolved name `y`","code":{"code":"E0425","explanation":"\\nAn unresolved name was used. Example of erroneous codes.*"},"level":"error","spans":\[{"file_name":"foo.rs","byte_start":496,"byte_end":497,"line_start":12,"line_end":12,"column_start":18,"column_end":19}\],"children":\[\]}' $(LOG)
grep -q '{"message":".*","code":{"code":"E0277","explanation":"\\nYou tried.*"},"level":"error","spans":\[{.*}\],"children":\[{"message":"the .*","code":null,"level":"help","spans":\[{"file_name":"foo.rs","byte_start":504,"byte_end":516,"line_start":14,"line_end":14,"column_start":0,"column_end":0}\],"children":\[\]},{"message":" <u8 as core::ops::Add>","code":null,"level":"help",' $(LOG)