rust/tests/run-make/remap-path-prefix/Makefile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
1.3 KiB
Makefile
Raw Normal View History

include ../tools.mk
2021-08-24 07:21:27 -05:00
# ignore-windows
ifeq ($(UNAME),Darwin)
DEBUGINFOOPTS := -Csplit-debuginfo=off
else
DEBUGINFOOPTS :=
endif
all: remap remap-with-scope
# Checks if remapping works if the remap-from string contains path to the working directory plus more
remap:
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux --crate-type=lib --emit=metadata auxiliary/lib.rs
2021-08-19 13:04:46 -05:00
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
remap-with-scope:
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=object $(DEBUGINFOOPTS) --crate-type=lib --emit=metadata auxiliary/lib.rs
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=macro $(DEBUGINFOOPTS) --crate-type=lib --emit=metadata auxiliary/lib.rs
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=diagnostics,object $(DEBUGINFOOPTS) --crate-type=lib --emit=metadata auxiliary/lib.rs
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1