Skip to content

Commit 834ec68

Browse files
committed
Add test to check behavior when incremental session init fails.
1 parent 074d667 commit 834ec68

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
include ../../run-make-fulldeps/tools.mk
2+
3+
SESSION_DIR := $(TMPDIR)/session
4+
OUTPUT_FILE := $(TMPDIR)/build-output
5+
6+
all:
7+
echo $(TMPDIR)
8+
mkdir $(SESSION_DIR)
9+
# Make it so that rustc will fail to create a session directory.
10+
chmod a-w $(SESSION_DIR)
11+
# Check exit code is 1 for an error, and not 101 for ICE.
12+
$(RUSTC) foo.rs --crate-type=rlib -C incremental=$(SESSION_DIR) > $(OUTPUT_FILE) 2>&1; [ $$? -eq 1 ]
13+
$(CGREP) "Could not create incremental compilation crate directory" < $(OUTPUT_FILE)
14+
# -v tests are fragile, hopefully this text won't change
15+
$(CGREP) -v "internal compiler error" < $(OUTPUT_FILE)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// intentionally empty

0 commit comments

Comments
 (0)