File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,8 +17,16 @@ cd hello
1717grep -q " import std" src/main.cpp || { echo " main.cpp missing 'import std'" ; exit 1; }
1818grep -q " std::println" src/main.cpp || { echo " main.cpp missing 'std::println'" ; exit 1; }
1919
20- # Build
21- " $MCPP " build > build.log 2>&1 || { cat build.log; echo " build failed" ; exit 1; }
20+ # Build (capture output, show on failure)
21+ set +e
22+ " $MCPP " build > build.log 2>&1
23+ build_rc=$?
24+ set -e
25+ if [[ $build_rc -ne 0 ]]; then
26+ cat build.log
27+ echo " build failed (rc=$build_rc )"
28+ exit 1
29+ fi
2230[[ -d target ]] || { cat build.log; echo " no target/ dir" ; exit 1; }
2331# On Windows (MINGW/MSYS) the binary has a .exe suffix
2432OS=" $( uname -s) "
@@ -27,7 +35,7 @@ if [[ "$OS" == MINGW* || "$OS" == MSYS* || "$OS" == CYGWIN* ]]; then
2735else
2836 binary=" $( find target -name hello -type f | head -1) "
2937fi
30- [[ -n " $binary " ]] || { echo " binary not produced" ; exit 1; }
38+ [[ -n " $binary " ]] || { echo " binary not produced" ; find target -type f 2> /dev/null | head -10 ; exit 1; }
3139[[ -x " $binary " ]] || { echo " binary not executable" ; exit 1; }
3240
3341# Run via mcpp
You can’t perform that action at this time.
0 commit comments