From 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:39 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/run-make/dep-info/Makefile | 25 +++++++++++++++++++++++++ tests/run-make/dep-info/Makefile.foo | 7 +++++++ tests/run-make/dep-info/bar.rs | 1 + tests/run-make/dep-info/foo.rs | 1 + tests/run-make/dep-info/lib.rs | 4 ++++ tests/run-make/dep-info/lib2.rs | 3 +++ 6 files changed, 41 insertions(+) create mode 100644 tests/run-make/dep-info/Makefile create mode 100644 tests/run-make/dep-info/Makefile.foo create mode 100644 tests/run-make/dep-info/bar.rs create mode 100644 tests/run-make/dep-info/foo.rs create mode 100644 tests/run-make/dep-info/lib.rs create mode 100644 tests/run-make/dep-info/lib2.rs (limited to 'tests/run-make/dep-info') diff --git a/tests/run-make/dep-info/Makefile b/tests/run-make/dep-info/Makefile new file mode 100644 index 000000000..c76f43a8e --- /dev/null +++ b/tests/run-make/dep-info/Makefile @@ -0,0 +1,25 @@ +include ../tools.mk + +# ignore-windows +# ignore-freebsd +# FIXME: on windows `rustc --dep-info` produces Makefile dependency with +# windows native paths (e.g. `c:\path\to\libfoo.a`) +# but msys make seems to fail to recognize such paths, so test fails. + +all: + cp *.rs $(TMPDIR) + $(RUSTC) --emit dep-info,link --crate-type=lib $(TMPDIR)/lib.rs + sleep 2 + touch $(TMPDIR)/foo.rs + -rm -f $(TMPDIR)/done + $(MAKE) -drf Makefile.foo + sleep 2 + rm $(TMPDIR)/done + pwd + $(MAKE) -drf Makefile.foo + rm $(TMPDIR)/done && exit 1 || exit 0 + + # When a source file is deleted `make` should still work + rm $(TMPDIR)/bar.rs + cp $(TMPDIR)/lib2.rs $(TMPDIR)/lib.rs + $(MAKE) -drf Makefile.foo diff --git a/tests/run-make/dep-info/Makefile.foo b/tests/run-make/dep-info/Makefile.foo new file mode 100644 index 000000000..e5df31f88 --- /dev/null +++ b/tests/run-make/dep-info/Makefile.foo @@ -0,0 +1,7 @@ +LIB := $(shell $(RUSTC) --print file-names --crate-type=lib lib.rs) + +$(TMPDIR)/$(LIB): + $(RUSTC) --emit dep-info,link --crate-type=lib lib.rs + touch $(TMPDIR)/done + +-include $(TMPDIR)/foo.d diff --git a/tests/run-make/dep-info/bar.rs b/tests/run-make/dep-info/bar.rs new file mode 100644 index 000000000..c5c0bc606 --- /dev/null +++ b/tests/run-make/dep-info/bar.rs @@ -0,0 +1 @@ +pub fn bar() {} diff --git a/tests/run-make/dep-info/foo.rs b/tests/run-make/dep-info/foo.rs new file mode 100644 index 000000000..b76b4321d --- /dev/null +++ b/tests/run-make/dep-info/foo.rs @@ -0,0 +1 @@ +pub fn foo() {} diff --git a/tests/run-make/dep-info/lib.rs b/tests/run-make/dep-info/lib.rs new file mode 100644 index 000000000..eb8631259 --- /dev/null +++ b/tests/run-make/dep-info/lib.rs @@ -0,0 +1,4 @@ +#![crate_name = "foo"] + +pub mod foo; +pub mod bar; diff --git a/tests/run-make/dep-info/lib2.rs b/tests/run-make/dep-info/lib2.rs new file mode 100644 index 000000000..f4fda9c93 --- /dev/null +++ b/tests/run-make/dep-info/lib2.rs @@ -0,0 +1,3 @@ +#![crate_name = "foo"] + +pub mod foo; -- cgit v1.2.3