fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.6 KiB49 linesraw
1include ../tools.mk
2
3# This test makes sure that changes to files referenced via #[debugger_visualizer]
4# are picked up when compiling incrementally.
5
6# We have to copy the source to $(TMPDIR) because Github CI mounts the source
7# directory as readonly. We need to apply modifications to some of the source
8# file.
9SRC_DIR := $(TMPDIR)/src
10INCR_CACHE_DIR := $(TMPDIR)/incremental
11
12all:
13	rm -rf $(TMPDIR)/*
14	mkdir $(SRC_DIR)
15	cp ./foo.rs $(SRC_DIR)
16	echo "GDB script v1" > $(SRC_DIR)/foo.py
17	echo "Natvis v1" > $(SRC_DIR)/foo.natvis
18	$(RUSTC) $(SRC_DIR)/foo.rs \
19	  --crate-type=rlib \
20	  --emit metadata \
21	  -C incremental=$(INCR_CACHE_DIR) \
22	  -Z incremental-verify-ich
23	$(CGREP) "GDB script v1" < $(TMPDIR)/libfoo.rmeta
24	$(CGREP) "Natvis v1" < $(TMPDIR)/libfoo.rmeta
25
26	# Change only the GDB script and check that the change has been picked up
27	echo "GDB script v2" > $(SRC_DIR)/foo.py
28	$(RUSTC) $(SRC_DIR)/foo.rs \
29	  --crate-type=rlib \
30	  --emit metadata \
31	  -C incremental=$(INCR_CACHE_DIR) \
32	  -Z incremental-verify-ich
33
34	$(CGREP) "GDB script v2" < $(TMPDIR)/libfoo.rmeta
35	$(CGREP) -v "GDB script v1" < $(TMPDIR)/libfoo.rmeta
36	$(CGREP) "Natvis v1" < $(TMPDIR)/libfoo.rmeta
37
38	# Now change the Natvis version and check that the change has been picked up
39	echo "Natvis v2" > $(SRC_DIR)/foo.natvis
40	$(RUSTC) $(SRC_DIR)/foo.rs \
41	  --crate-type=rlib \
42	  --emit metadata \
43	  -C incremental=$(INCR_CACHE_DIR) \
44	  -Z incremental-verify-ich
45
46	$(CGREP) "GDB script v2" < $(TMPDIR)/libfoo.rmeta
47	$(CGREP) -v "GDB script v1" < $(TMPDIR)/libfoo.rmeta
48	$(CGREP) "Natvis v2" < $(TMPDIR)/libfoo.rmeta
49	$(CGREP) -v "Natvis v1" < $(TMPDIR)/libfoo.rmeta