Skip to content

Commit 7bc8d47

Browse files
committed
test: host-spelled fixture path in 772, build-directory words excluded from 765 (c), cmd.exe quoting in 775
1 parent fff80dc commit 7bc8d47

3 files changed

Lines changed: 20 additions & 3 deletions

‎tests/e2e/765_a_consumer_include_directory_stays_in_the_consumer.sh‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,14 @@ def words(root):
159159
for e in entries(root):
160160
f = norm(e["file"]).split("/")[-1]
161161
if f not in ("dep.cpp", "dep_c.c"): continue
162+
# A word naming the root's own build directory (clang's
163+
# `-fprebuilt-module-path=`, MSVC's `/ifcSearchDir`) is where that
164+
# project keeps its BMIs, not an input the dependency is compiled
165+
# against, and it differs between two projects by construction.
166+
own = f"/{root}/target/"
162167
out[f] = sorted(norm(x) for x in args(e)
163-
if x.startswith(("-I", "-D", "-f", "-idirafter", "/I", "/D")))
168+
if x.startswith(("-I", "-D", "-f", "-idirafter", "/I", "/D"))
169+
and own not in norm(x))
164170
return out
165171
w1, w2 = words("app"), words("app2")
166172
if not w1 or w1 != w2:

‎tests/e2e/772_a_published_member_is_self_contained.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ TMP=$(mktemp -d)
3030
trap "rm -rf $TMP" EXIT
3131
export MCPP_HOME="$TMP/mcpp-home"
3232
source "$(dirname "$0")/_inherit_toolchain.sh"
33+
source "$(dirname "$0")/_host_path.sh"
34+
TMP_HOST="$(host_path "$TMP")"
3335

3436
fail() { echo "FAIL: $*"; exit 1; }
3537

@@ -132,7 +134,7 @@ name = "app"
132134
version = "0.1.0"
133135
134136
[dependencies]
135-
"probe.util" = { path = "$TMP/unpacked/util-0.3.0" }
137+
"probe.util" = { path = "$TMP_HOST/unpacked/util-0.3.0" }
136138
137139
[targets.app]
138140
kind = "bin"

‎tests/e2e/775_a_host_tool_merges_its_conditional_sections_once.sh‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ int main() {
6565
if (!tool || !*tool) return 1;
6666
std::string out = std::string(mcpp::out_dir()) + "/gen.cpp";
6767
std::string cmd = std::string("\"") + tool + "\" \"" + out + "\"";
68+
#ifdef _WIN32
69+
// cmd.exe removes the first and the last quote of a command that starts
70+
// with one; the outer pair keeps both inner pairs intact.
71+
cmd = "\"" + cmd + "\"";
72+
#endif
6873
if (std::system(cmd.c_str()) != 0) return 1;
6974
mcpp::generated(out.c_str());
7075
}
@@ -73,7 +78,11 @@ EOF
7378
( cd "$TMP/toolpkg" && "$MCPP" build > "$TMP/direct.log" 2>&1 ) \
7479
|| fail "control: the tool package does not build on its own" "$TMP/direct.log"
7580
cd "$TMP/app"
76-
"$MCPP" build > build.log 2>&1 || fail "the host tool received a conditional entry twice" build.log
81+
"$MCPP" build > build.log 2>&1 || {
82+
grep -q "redefinition" build.log \
83+
&& fail "the host tool received a conditional entry twice" build.log
84+
fail "the consumer did not build" build.log
85+
}
7786
"$MCPP" run > run.log 2>&1 || fail "the program did not run" run.log
7887
grep -q '^ANSWER=41' run.log || fail "wrong answer" run.log
7988
echo "PASS: 775_a_host_tool_merges_its_conditional_sections_once"

0 commit comments

Comments
 (0)