Skip to content

Commit ce55d84

Browse files
committed
test(e2e): 79 use portable newest-build.ninja (ls -t), not GNU find -printf
macOS BSD find lacks -printf → nj came back empty → false 'gtest-all not linked'. Functionality was fine (78 passed, build succeeded). Use find | xargs ls -t.
1 parent 1aaac85 commit ce55d84

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/e2e/79_gtest_regular_dep_feature_main.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ cd app
2525
"$MCPP" add gtest@1.15.2 > /dev/null
2626
grep -q '^\[dependencies\]' mcpp.toml || { echo "FAIL: add did not write [dependencies]"; cat mcpp.toml; exit 1; }
2727
"$MCPP" build > /dev/null || { echo "FAIL: #168 — build with regular-dep gtest failed"; exit 1; }
28-
nj=$(find target -name build.ninja -printf "%T@ %p\n" | sort -rn | head -1 | cut -d" " -f2)
28+
nj=$(find target -name build.ninja | xargs ls -t 2>/dev/null | head -1)
2929
if grep -q 'gtest_main' "$nj"; then
3030
echo "FAIL: gtest_main linked into app by default (would collide with main)"; exit 1
3131
fi
@@ -46,7 +46,7 @@ cat > src/main.cpp <<'EOF'
4646
TEST(App, ok) { EXPECT_EQ(1 + 1, 2); }
4747
EOF
4848
"$MCPP" build > /dev/null || { echo "FAIL: features=[main] build failed"; exit 1; }
49-
nj=$(find target -name build.ninja -printf "%T@ %p\n" | sort -rn | head -1 | cut -d" " -f2)
49+
nj=$(find target -name build.ninja | xargs ls -t 2>/dev/null | head -1)
5050
grep -q 'gtest_main' "$nj" || { echo "FAIL: features=[main] did not link gtest_main"; exit 1; }
5151

5252
# (3) `mcpp add --dev` routes to [dev-dependencies].

0 commit comments

Comments
 (0)