Use cppcheck with WorkDir, master branch (2022.01.11.)
Taught WorkDir how to make use of cppcheck if it's available (in the $PATH
environment variable).
Note that this needs to wait until atlasexternals!915 (merged) is already in the nightly. Otherwise all build jobs will fail because of the broken cppcheck executable that's currently in the nightlies. (See ATLINFR-2654 for the technical details.)
The goal with this is to allow users to make use of cppcheck like:
[bash][atlas]:build > asetup Athena,master,latest
Using Athena/22.0.51 [cmake] with platform x86_64-centos7-gcc11-opt
at /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc11-opt/2022-01-10T2101
Unchanged: COOL_ORA_ENABLE_ADAPTIVE_OPT=Y
[bash][atlas]:build > lsetup "cppcheck testing"
************************************************************************
Requested: cppcheck ...
Setting up cppcheck 2.6-x86_64-centos7-gcc11 ...
>>>>>>>>>>>>>>>>>>>>>>>>> Information for user <<<<<<<<<<<<<<<<<<<<<<<<<
cppcheck:
To use cppcheck you need to setup a release or a nightly first
************************************************************************
[bash][atlas]:build > cmake -DATLAS_PACKAGE_FILTER_FILE=../package_filters.txt ../athena/Projects/WorkDir/
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/lcg/gcc/11.2.0-ad950/x86_64-centos7/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
...
-- Checking C files with: /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/cppcheck/2.6-x86_64-centos7-gcc11/cppcheck-2.6/bin/cppcheck;--quiet;--suppress=*:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc11-opt/sw/lcg/releases/*;--suppress=*:/cvmfs/atlas.cern.ch/repo/sw/tdaq/tdaq-common/tdaq-common-04-04-00/installed/include/*;--suppress=*:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc11-opt/2022-01-10T2101/AthenaExternals/22.0.51/InstallArea/x86_64-centos7-gcc11-opt/include/*
-- Checking C++ files with: /cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase/x86_64/cppcheck/2.6-x86_64-centos7-gcc11/cppcheck-2.6/bin/cppcheck;--quiet;--suppress=*:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc11-opt/sw/lcg/releases/*;--suppress=*:/cvmfs/atlas.cern.ch/repo/sw/tdaq/tdaq-common/tdaq-common-04-04-00/installed/include/*;--suppress=*:/cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc11-opt/2022-01-10T2101/AthenaExternals/22.0.51/InstallArea/x86_64-centos7-gcc11-opt/include/*
...
Edited by Attila Krasznahorkay