2022-08-22 19:00:00 -05:00
|
|
|
include ../tools.mk
|
2014-04-04 20:53:28 -05:00
|
|
|
|
2020-12-28 11:15:16 -06:00
|
|
|
# Modelled after ui/changing-crates.rs test, but this one puts
|
2014-04-04 20:53:28 -05:00
|
|
|
# more than one (mismatching) candidate crate into the search path,
|
2020-12-28 11:15:16 -06:00
|
|
|
# which did not appear directly expressible in UI testing infrastructure.
|
2014-04-04 20:53:28 -05:00
|
|
|
#
|
|
|
|
# Note that we move the built libraries into target direcrtories rather than
|
|
|
|
# use the `--out-dir` option because the `../tools.mk` file already bakes a
|
|
|
|
# use of `--out-dir` into the definition of $(RUSTC).
|
|
|
|
|
|
|
|
A1=$(TMPDIR)/a1
|
|
|
|
A2=$(TMPDIR)/a2
|
|
|
|
A3=$(TMPDIR)/a3
|
|
|
|
|
|
|
|
# A hack to match distinct lines of output from a single run.
|
|
|
|
LOG=$(TMPDIR)/log.txt
|
|
|
|
|
2015-03-14 18:09:26 -05:00
|
|
|
all:
|
2014-04-04 20:53:28 -05:00
|
|
|
mkdir -p $(A1) $(A2) $(A3)
|
|
|
|
$(RUSTC) --crate-type=rlib crateA1.rs
|
|
|
|
mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A1)
|
2014-08-08 13:03:48 -05:00
|
|
|
$(RUSTC) --crate-type=rlib -L $(A1) crateB.rs
|
2014-04-04 20:53:28 -05:00
|
|
|
$(RUSTC) --crate-type=rlib crateA2.rs
|
|
|
|
mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A2)
|
|
|
|
$(RUSTC) --crate-type=rlib crateA3.rs
|
|
|
|
mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A3)
|
|
|
|
# Ensure crateC fails to compile since A1 is "missing" and A2/A3 hashes do not match
|
2014-08-08 13:03:48 -05:00
|
|
|
$(RUSTC) -L $(A2) -L $(A3) crateC.rs >$(LOG) 2>&1 || true
|
2017-11-23 09:19:50 -06:00
|
|
|
$(CGREP) \
|
|
|
|
'found possibly newer version of crate `crateA` which `crateB` depends on' \
|
|
|
|
'note: perhaps that crate needs to be recompiled?' \
|
|
|
|
'crate `crateA`:' \
|
|
|
|
'crate `crateB`:' \
|
|
|
|
< $(LOG)
|
2020-12-28 11:15:16 -06:00
|
|
|
# the 'crate `crateA`' will match two entries.
|