Skip to content

Commit e833d65

Browse files
committed
test(e2e): derive the fast-path binary names from what the build produced
Windows links `fastpath.exe`; the new fast-path section hardcoded the POSIX spelling and failed at the baseline check before reaching the assertion it exists for (e2e 2/2 windows). The suffix is a host constant, so take it off the artifact `find` actually returned rather than branching on the platform.
1 parent e1f9fb7 commit e833d65

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

tests/e2e/211_configure_only_cdb.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,29 @@ printf 'int main() { return 0; }\n' > "$TMP/fastpath/src/main.cpp"
122122
printf 'int main() { return 0; }\n' > "$TMP/fastpath/tests/smoke.cpp"
123123
cd "$TMP/fastpath"
124124
"$MCPP" build > build-1.log 2>&1 || { cat build-1.log; exit 1; }
125-
bindir=$(dirname "$(find target -type f -path '*/bin/fastpath' -print -quit)")
126-
[[ -n "$bindir" && -f "$bindir/fastpath" ]] || { echo "baseline build produced no binary"; exit 1; }
125+
# Windows links `fastpath.exe`; the suffix is a host constant, so derive the
126+
# whole path from what the build actually produced instead of assuming either.
127+
target_bin=$(find target -type f \( -path '*/bin/fastpath' -o -path '*/bin/fastpath.exe' \) \
128+
-print -quit)
129+
[[ -n "$target_bin" ]] || {
130+
echo "baseline build produced no binary"; find target -type f -path '*/bin/*'; exit 1; }
131+
bindir=$(dirname "$target_bin")
132+
exe_suffix=""
133+
[[ "$target_bin" == *.exe ]] && exe_suffix=".exe"
134+
test_bin="$bindir/smoke$exe_suffix"
127135

128136
"$MCPP" build --configure-only > configure-fastpath.log 2>&1 || {
129137
cat configure-fastpath.log; exit 1; }
130-
[[ ! -e "$bindir/smoke" ]] || { echo "configure-only linked a test binary"; exit 1; }
138+
[[ ! -e "$test_bin" ]] || { echo "configure-only linked a test binary"; exit 1; }
131139

132140
"$MCPP" build > build-2.log 2>&1 || { cat build-2.log; exit 1; }
133-
[[ ! -e "$bindir/smoke" ]] || {
141+
[[ ! -e "$test_bin" ]] || {
134142
echo "build after configure-only replayed the configure graph and linked the tests"
135143
cat build-2.log
136144
ls -la "$bindir"
137145
exit 1
138146
}
139-
[[ -f "$bindir/fastpath" ]] || {
147+
[[ -f "$target_bin" ]] || {
140148
echo "build after configure-only lost the package target"
141149
cat build-2.log
142150
exit 1

0 commit comments

Comments
 (0)