File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,9 +100,11 @@ 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+ # TODO: run with system includes
107+ VALGRIND_TOOL=memcheck ./selfcheck.sh
106108
107109 - name : Run with libstdc++ debug mode
108110 if : matrix.os == 'ubuntu-24.04' && matrix.compiler == 'g++'
@@ -146,7 +148,8 @@ jobs:
146148 tar xvf 1.5.1.tar.gz
147149 make clean
148150 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)
151+ # TODO: run with system includes enabled
152+ VALGRIND_CMD=callgrind SIMPLECPP_PATH=simplecpp-1.5.1 ./selfcheck.sh 2>callgrind.log || (cat callgrind.log && false)
150153 cat callgrind.log
151154 callgrind_annotate --auto=no > callgrind.annotated.log
152155 head -50 callgrind.annotated.log
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