Skip to content

Commit 9a623f3

Browse files
committed
test: Move some test outputs into $(TMPDIR)
Don't want to pollute the source tree!
1 parent 3dd8b3e commit 9a623f3

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
-include ../tools.mk
22

3+
OUT := $(TMPDIR)/out
4+
35
ifndef IS_WINDOWS
46
all: time
57

68
time: libc
7-
mkdir -p out/time out/time/deps
8-
ln -sf out/libc/liblibc.rlib out/time/deps/
9-
$(RUSTC) in/time/lib.rs -Ldependency=out/time/deps/
9+
mkdir -p $(OUT)/time $(OUT)/time/deps
10+
ln -sf $(OUT)/libc/liblibc.rlib $(OUT)/time/deps/
11+
$(RUSTC) in/time/lib.rs -Ldependency=$(OUT)/time/deps/
1012

1113
libc:
12-
mkdir -p out/libc
13-
$(RUSTC) in/libc/lib.rs --crate-name=libc -o out/libc/liblibc.rlib
14+
mkdir -p $(OUT)/libc
15+
$(RUSTC) in/libc/lib.rs --crate-name=libc -o $(OUT)/libc/liblibc.rlib
1416
else
1517
all:
1618
endif
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
-include ../tools.mk
22

3+
LOG := $(TMPDIR)/foo.log
4+
35
all:
46
cp foo.rs $(TMPDIR)
57
cd $(TMPDIR)
6-
-$(RUSTC) -Z unstable-options --error-format=json foo.rs 2>foo.log
7-
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
8-
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
8+
-$(RUSTC) -Z unstable-options --error-format=json foo.rs 2>$(LOG)
9+
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)
10+
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)

0 commit comments

Comments
 (0)