Skip to content

Commit 9a10d09

Browse files
committed
fixed #14383 - clear PATH in selfchecks and explicitly provide executable locations
1 parent a47e007 commit 9a10d09

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

selfcheck.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,27 @@
33
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,information --exception-handling --debug-warnings --check-level=exhaustive"
44
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
55
gui_options="-DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=68 -DQT_CHARTS_LIB -DQT_MOC_HAS_STRINGDATA --library=qt"
6-
ec=0
6+
naming_options="--addon-python=$(command -v python) --addon=naming.json"
77

88
if [ -n "$1" ]; then
99
selfcheck_options="$selfcheck_options $1"
1010
fi
1111

12+
# clear PATH to prevent unintentional process invocations
13+
export PATH=
14+
15+
ec=0
16+
1217
# self check externals
1318
./cppcheck $selfcheck_options externals || ec=1
1419
# self check lib/cli
1520
mkdir b1
16-
./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json frontend || ec=1
17-
./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json -Ifrontend cli || ec=1
18-
./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 --addon=naming.json --enable=internal lib || ec=1
21+
./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 $naming_options frontend || ec=1
22+
./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 $naming_options -Ifrontend cli || ec=1
23+
./cppcheck $selfcheck_options $cppcheck_options --cppcheck-build-dir=b1 $naming_options --enable=internal lib || ec=1
1924
# check gui with qt settings
2025
mkdir b2
21-
./cppcheck $selfcheck_options $cppcheck_options $gui_options --cppcheck-build-dir=b2 --addon=naming.json -Icmake.output/gui -Ifrontend -Igui gui/*.cpp cmake.output/gui || ec=1
26+
./cppcheck $selfcheck_options $cppcheck_options $gui_options --cppcheck-build-dir=b2 $naming_options -Icmake.output/gui -Ifrontend -Igui gui/*.cpp cmake.output/gui || ec=1
2227
# self check test and tools
2328
./cppcheck $selfcheck_options $cppcheck_options -Ifrontend -Icli test/*.cpp || ec=1
2429
./cppcheck $selfcheck_options $cppcheck_options -Icli tools/dmake/*.cpp || ec=1

selfcheck_san.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppchec
99
qt_options="--library=qt -DQT_VERSION=0x060000 -DQ_MOC_OUTPUT_REVISION=69 -DQT_MOC_HAS_STRINGDATA"
1010
qt_options="$qt_options --suppress=autoNoType:*/moc_*.cpp --suppress=symbolDatabaseWarning:*/moc_*.cpp"
1111

12+
# clear PATH to prevent unintentional process invocations
13+
export PATH=
14+
1215
ec=0
1316

1417
$cmake_output/bin/cppcheck $selfcheck_options \

0 commit comments

Comments
 (0)