0

I am trying to launch cppcheck for my tepp project under jenkins environment, system is win7-x64:

  • I installed cppcheck.exe under C:\Program Files (x86)\Jenkins\cppcheck
  • Jenkins config, shell exec path is : C:\Windows\system32\cmd.exe
  • As documentation suggested, jenkins launches cppcheck analysis as following :
    • I add an "execute shell script" task
    • "C:\Program Files (x86)\Jenkins\cppcheck\cppcheck.exe" -j 8 --enable=all --inconclusive --xml --xml-version=2 tepp 2> tepp/tepp-cppcheck.xml

The ouput is :

[tepp] $ C:\Windows\system32\cmd.exe -xe
C:\Windows\TEMP\hudson3799822801570258901.sh
Microsoft Windows [version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Tous droits r‚serv‚s.

C:\Program Files (x86)\Jenkins\workspace\tepp>Finished: SUCCESS

No xml output file, nothing in logs, quiet failed.

When I execute this command line under a cmd windows, it works fine : bunch of logs, big xml file generated ...

Did I missed something ?

norisknofun
  • 859
  • 1
  • 8
  • 24

2 Answers2

1

Cppcheck must be invoked via "windows batch" and not "execute shell script".

I thought "shell script" is interpreted via some bash/sh jenkins under linux and via cmd under windows. It isn't !

norisknofun
  • 859
  • 1
  • 8
  • 24
0

Did you already tested the cppcheck plugin ? https://wiki.jenkins-ci.org/display/JENKINS/Cppcheck+Plugin

My team created it .. and the cppcheck team is using it now.

Jerome Vacher
  • 314
  • 1
  • 7