summary refs log tree commit diff
path: root/tests/run-make/incremental-session-fail
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /tests/run-make/incremental-session-fail
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'tests/run-make/incremental-session-fail')
-rw-r--r--tests/run-make/incremental-session-fail/Makefile14
-rw-r--r--tests/run-make/incremental-session-fail/foo.rs1
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/run-make/incremental-session-fail/Makefile b/tests/run-make/incremental-session-fail/Makefile
new file mode 100644
index 00000000000..0461bb926e7
--- /dev/null
+++ b/tests/run-make/incremental-session-fail/Makefile
@@ -0,0 +1,14 @@
+include ../../run-make-fulldeps/tools.mk
+
+SESSION_DIR := $(TMPDIR)/session
+OUTPUT_FILE := $(TMPDIR)/build-output
+
+all:
+	echo $(TMPDIR)
+	# Make it so that rustc will fail to create a session directory.
+	touch $(SESSION_DIR)
+	# Check exit code is 1 for an error, and not 101 for ICE.
+	$(RUSTC) foo.rs --crate-type=rlib -C incremental=$(SESSION_DIR) > $(OUTPUT_FILE) 2>&1; [ $$? -eq 1 ]
+	$(CGREP) "Could not create incremental compilation crate directory" < $(OUTPUT_FILE)
+	# -v tests are fragile, hopefully this text won't change
+	$(CGREP) -v "internal compiler error" < $(OUTPUT_FILE)
diff --git a/tests/run-make/incremental-session-fail/foo.rs b/tests/run-make/incremental-session-fail/foo.rs
new file mode 100644
index 00000000000..d11c69f812a
--- /dev/null
+++ b/tests/run-make/incremental-session-fail/foo.rs
@@ -0,0 +1 @@
+// intentionally empty