]>
Commit | Line | Data |
---|---|---|
f2b60f7d | 1 | include ../tools.mk |
1a4d82fc | 2 | |
5869c6ff | 3 | # Modelled after ui/changing-crates.rs test, but this one puts |
1a4d82fc | 4 | # more than one (mismatching) candidate crate into the search path, |
5869c6ff | 5 | # which did not appear directly expressible in UI testing infrastructure. |
1a4d82fc JJ |
6 | # |
7 | # Note that we move the built libraries into target direcrtories rather than | |
8 | # use the `--out-dir` option because the `../tools.mk` file already bakes a | |
9 | # use of `--out-dir` into the definition of $(RUSTC). | |
10 | ||
11 | A1=$(TMPDIR)/a1 | |
12 | A2=$(TMPDIR)/a2 | |
13 | A3=$(TMPDIR)/a3 | |
14 | ||
15 | # A hack to match distinct lines of output from a single run. | |
16 | LOG=$(TMPDIR)/log.txt | |
17 | ||
c34b1796 | 18 | all: |
1a4d82fc JJ |
19 | mkdir -p $(A1) $(A2) $(A3) |
20 | $(RUSTC) --crate-type=rlib crateA1.rs | |
21 | mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A1) | |
22 | $(RUSTC) --crate-type=rlib -L $(A1) crateB.rs | |
23 | $(RUSTC) --crate-type=rlib crateA2.rs | |
24 | mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A2) | |
25 | $(RUSTC) --crate-type=rlib crateA3.rs | |
26 | mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A3) | |
27 | # Ensure crateC fails to compile since A1 is "missing" and A2/A3 hashes do not match | |
28 | $(RUSTC) -L $(A2) -L $(A3) crateC.rs >$(LOG) 2>&1 || true | |
ff7c6d11 XL |
29 | $(CGREP) \ |
30 | 'found possibly newer version of crate `crateA` which `crateB` depends on' \ | |
31 | 'note: perhaps that crate needs to be recompiled?' \ | |
32 | 'crate `crateA`:' \ | |
33 | 'crate `crateB`:' \ | |
34 | < $(LOG) | |
5869c6ff | 35 | # the 'crate `crateA`' will match two entries. |