File tree Expand file tree Collapse file tree 2 files changed +33
-7
lines changed Expand file tree Collapse file tree 2 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,10 @@ jobs:
100100 if : matrix.os == 'ubuntu-24.04'
101101 run : |
102102 make clean
103- make -j$(nproc)
103+ make -j$(nproc) CXXOPTS="-O1"
104104 valgrind --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --error-exitcode=42 ./testrunner
105- valgrind --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --error-exitcode=42 ./simplecpp simplecpp.cpp -e
105+ # TODO: run Python tests with valgrind
106+ VALGRIND_TOOL=memcheck ./selfcheck.sh
106107
107108 - name : Run with libstdc++ debug mode
108109 if : matrix.os == 'ubuntu-24.04' && matrix.compiler == 'g++'
@@ -146,10 +147,13 @@ jobs:
146147 tar xvf 1.5.1.tar.gz
147148 make clean
148149 make -j$(nproc) CXXOPTS="-O2 -g3"
149- valgrind --tool =callgrind ./ simplecpp -e simplecpp- 1.5.1/simplecpp.cpp 2 >callgrind.log || (cat callgrind.log && false)
150+ VALGRIND_TOOL =callgrind SIMPLECPP_PATH= simplecpp- 1.5.1 ./selfcheck.sh >callgrind.log || (cat callgrind.log && false)
150151 cat callgrind.log
151- callgrind_annotate --auto=no > callgrind.annotated.log
152- head -50 callgrind.annotated.log
152+ for f in callgrind.out.*;
153+ do
154+ callgrind_annotate --auto=no $f > $f.annotated.log
155+ head -50 $f.annotated.log
156+ done
153157
154158 - uses : actions/upload-artifact@v4
155159 if : matrix.os == 'ubuntu-24.04'
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- output=$( ./simplecpp simplecpp.cpp -e -f 2>&1 )
3+ if [ -z " $SIMPLECPP_PATH " ]; then
4+ SIMPLECPP_PATH=.
5+ fi
6+
7+ if [ -n " $VALGRIND_TOOL " ]; then
8+ if [ " $VALGRIND_TOOL " = " memcheck" ]; then
9+ VALGRIND_OPTS=" --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --error-exitcode=42"
10+ elif [ " $VALGRIND_TOOL " = " callgrind" ]; then
11+ VALGRIND_OPTS=" --tool=callgrind"
12+ else
13+ echo " unsupported valgrind tool '$VALGRIND_TOOL '"
14+ exit 1
15+ fi
16+ VALGRIND_CMD=" valgrind --tool=$VALGRIND_TOOL --log-fd=9 $VALGRIND_OPTS "
17+ VALGRIND_REDIRECT=" valgrind_$VALGRIND_TOOL .log"
18+ else
19+ VALGRIND_CMD=
20+ VALGRIND_REDIRECT=" /dev/null"
21+ fi
22+
23+ output=$( $VALGRIND_CMD ./simplecpp " $SIMPLECPP_PATH /simplecpp.cpp" -e -f 2>&1 9> " $VALGRIND_REDIRECT " )
424ec=$?
25+ cat " $VALGRIND_REDIRECT "
526errors=$( echo " $output " | grep -v ' Header not found: <' )
627if [ $ec -ne 0 ]; then
728 # only fail if we got errors which do not refer to missing system includes
104125fi
105126
106127# run with -std=gnuc++* so __has_include(...) is available
107- ./simplecpp simplecpp.cpp -e -f -std=gnu++11 $defs $inc
128+ $VALGRIND_CMD ./simplecpp " $SIMPLECPP_PATH / simplecpp.cpp" -e -f -std=gnu++11 $defs $inc 9> " $VALGRIND_REDIRECT "
108129ec=$?
130+ cat " $VALGRIND_REDIRECT "
109131if [ $ec -ne 0 ]; then
110132 exit $ec
111133fi
You can’t perform that action at this time.
0 commit comments