RE: CppCheck(XML parsing) with Warning-Next-Generation plugins

2020-04-03 Thread Jérôme Godbout
Hi,
maybe not what you are looking for, but I do run my cppcheck with the following 
command (bat or sh):

def RunCppCheck(scriptConfig, outputXml, otherOptions = "") {
String cmd = “cppcheck --project=${scriptConfig} --xml --xml-version=2 
${otherOptions} 2> ${outputXml}”;
if(isUnix()) {
  sh(cmd);
} else {
 bat(cmd);
 }
}

Then I parse the output xml file like any unit tests results or you can use 
warning parsings regex. By the way the command line doesn’t support the gui 
project file (the command line into cppcheck are trash big time. They clearly 
added command line aside of the gui and this lead to ugly command line.


From: 'Christoph Fetzer' via Jenkins Users 
Sent: April 3, 2020 3:08 AM
To: Jenkins Users 
Subject: Re: CppCheck(XML parsing) with Warning-Next-Generation plugins

For me that looks like an issue of your shell command and not of the plugin. 
Can you try to store the actual file to your workspace and make the plugin 
parse that?
For me the warnings.ng.plugin is just working in conjunction with cppcheck.

What I am doing looks like this:

The cppcheck-call:


cppcheck --xml --output-file="cppcheck-result.xml"  --library=D:\cppcheck.cfg 
--platform=win32A --template="{file},{line},{severity},{id},{message}" .

and the plugin-part:
  stage('Static Analysis') {
steps {
// call cppcheck as part of a Makefile target
recordIssues sourceCodeEncoding: 'ISO-8859-1', tools: 
[cppCheck(pattern:'**/cppcheck-result.xml')]
}
}


Am Donnerstag, 2. April 2020 20:45:02 UTC+2 schrieb Ahmed Rafiq:
Thanks for your reply.
I've used the example xml from the given link, and getting error -


Started by user unknown or anonymous

Running as SYSTEM

Building in workspace 
/media/persistent_storage/home/jenkins-warnings/work/workspace/test

[test] $ /bin/sh -xe /tmp/jenkins918250917560153069.sh

+ echo '



  

  

/tmp/jenkins918250917560153069.sh: line 7: syntax error near unexpected token 
`newline'

  



  

  

  https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/resources/io/jenkins/plugins/analysis/warnings/cppcheck.xml)
 generates error and didn't produces any formatted string.

Any help in this regards is highly appreciated.


When you don’t show error messages or log messages we cannot help. Just writing 
that it does not work is not enough information.


Regards,


--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkins...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4ef79c27-73bf-4062-a240-65f9b38f9341%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/4ef79c27-73bf-4062-a240-65f9b38f9341%40googlegroups.com?utm_medium=email_source=footer>.

--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkins...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0A40A6D1-60D0-477B-B000-430235D6808E%40gmail.com<https://groups.google.com/d/msgid/jenkinsci-users/0A40A6D1-60D0-477B-B000-430235D6808E%40gmail.com?utm_medium=email_source=footer>.
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a976054d-bd91-4643-96fe-927270bf5019%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/a976054d-bd91-4643-96fe-927270bf5019%40googlegroups.com?utm_medium=email_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/YQXPR01MB322257559A4D151CC7BD472ECDC70%40YQXPR01MB3222.CANPRD01.PROD.OUTLOOK.COM.


Re: CppCheck(XML parsing) with Warning-Next-Generation plugins

2020-04-03 Thread Ahmed Rafiq
Thanks for the reply.
What I've done is, put this,

echo '

  
  
  

  
  
'

inside *execute shell command*, under *Build*. Set Tools *CPPCheck* and
*Build*.
I was waiting that the ** would produce *new** line* where used. But
they didn't.

On Fri, Apr 3, 2020 at 10:14 AM Ullrich Hafner 
wrote:

>
>
> Am 03.04.2020 um 09:07 schrieb 'Christoph Fetzer' via Jenkins Users <
> jenkinsci-users@googlegroups.com>:
>
> For me that looks like an issue of your shell command and not of the
> plugin.
>
>
> Exactly!
>
> [CPPCheck] Skipping execution of recorder since overall result is 'FAILURE'
>> Finished: FAILURE
>>
>>
>>
> The log indicates that my plugin does not even run since the build already
> failed. (You can change that behavior but I think it makes more sense to
> correct your build.)
>
> If you want to test the plugin I can recommend the plugin
> https://github.com/jenkinsci/file-operations-plugin
> I’m using that in my testing courses to create manual integration tests
> that use fake input files for my warning plugin.
> With this plugin you can create an example file for cppcheck in the
> workspace.
>
>
>> On Thu, Apr 2, 2020 at 8:19 PM Ullrich Hafner 
>> wrote:
>>
>>>
>>>
>>> Am 02.04.2020 um 13:06 schrieb Hakan Rafik :
>>>
>>> I'm using the next generation plugins to represent the CppCheck warnings
>>> and errors.
>>> But the plugins is not parsing* Carriage return*:  or *Line feed*:
>>> .
>>> I've tried to feed the plugins with the given example (
>>> https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/resources/io/jenkins/plugins/analysis/warnings/cppcheck.xml)
>>> generates error and didn't produces any formatted string.
>>>
>>> Any help in this regards is highly appreciated.
>>>
>>>
>>> When you don’t show error messages or log messages we cannot help. Just
>>> writing that it does not work is not enough information.
>>>
>>> Regards,
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkins...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/4ef79c27-73bf-4062-a240-65f9b38f9341%40googlegroups.com
>>> 
>>> .
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkins...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/0A40A6D1-60D0-477B-B000-430235D6808E%40gmail.com
>>> 
>>> .
>>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/a976054d-bd91-4643-96fe-927270bf5019%40googlegroups.com
> 
> .
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/E593C47E-EAF9-40A2-9E7D-11B2D4BA7F9A%40gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAOxCx6nrcUsn3_X6ACqH-FMHyLpa7poe%2B0TKYi%2B3Pckmn3k32g%40mail.gmail.com.


Re: CppCheck(XML parsing) with Warning-Next-Generation plugins

2020-04-03 Thread Ullrich Hafner


> Am 03.04.2020 um 09:07 schrieb 'Christoph Fetzer' via Jenkins Users 
> :
> 
> For me that looks like an issue of your shell command and not of the plugin. 

Exactly!

> [CPPCheck] Skipping execution of recorder since overall result is 'FAILURE'
> Finished: FAILURE
> 

The log indicates that my plugin does not even run since the build already 
failed. (You can change that behavior but I think it makes more sense to 
correct your build.) 

If you want to test the plugin I can recommend the plugin 
https://github.com/jenkinsci/file-operations-plugin 

I’m using that in my testing courses to create manual integration tests that 
use fake input files for my warning plugin.
With this plugin you can create an example file for cppcheck in the workspace.

> 
> On Thu, Apr 2, 2020 at 8:19 PM Ullrich Hafner gmail.com 
> > wrote:
> 
> 
>> Am 02.04.2020 um 13:06 schrieb Hakan Rafik gmail.com 
>> >:
>> 
>> I'm using the next generation plugins to represent the CppCheck warnings and 
>> errors. 
>> But the plugins is not parsing Carriage return:  or Line feed: . 
>> I've tried to feed the plugins with the given example 
>> (https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/resources/io/jenkins/plugins/analysis/warnings/cppcheck.xml
>>  
>> )
>>  generates error and didn't produces any formatted string.
>> 
>> Any help in this regards is highly appreciated. 
>> 
> 
> When you don’t show error messages or log messages we cannot help. Just 
> writing that it does not work is not enough information.
> 
>> Regards,
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkins...@ <>googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/4ef79c27-73bf-4062-a240-65f9b38f9341%40googlegroups.com
>>  
>> .
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkins...@ <>googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/0A40A6D1-60D0-477B-B000-430235D6808E%40gmail.com
>  
> .
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-users+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/a976054d-bd91-4643-96fe-927270bf5019%40googlegroups.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/E593C47E-EAF9-40A2-9E7D-11B2D4BA7F9A%40gmail.com.


Re: CppCheck(XML parsing) with Warning-Next-Generation plugins

2020-04-03 Thread 'Christoph Fetzer' via Jenkins Users
For me that looks like an issue of your shell command and not of the 
plugin. Can you try to store the actual file to your workspace and make the 
plugin parse that?
For me the warnings.ng.plugin is just working in conjunction with cppcheck.

What I am doing looks like this:

The cppcheck-call:

cppcheck --xml --output-file="cppcheck-result.xml"  --library=D:\cppcheck.cfg 
--platform=win32A --template="{file},{line},{severity},{id},{message}" .


and the plugin-part:
  stage('Static Analysis') {
steps {
// call cppcheck as part of a Makefile target
recordIssues sourceCodeEncoding: 'ISO-8859-1', tools
: [cppCheck(pattern:'**/cppcheck-result.xml')]
}
}



Am Donnerstag, 2. April 2020 20:45:02 UTC+2 schrieb Ahmed Rafiq:
>
> Thanks for your reply.
> I've used the example xml from the given link, and getting error -
>
> Started by user unknown or anonymous
> Running as SYSTEM
> Building in workspace 
> /media/persistent_storage/home/jenkins-warnings/work/workspace/test
> [test] $ /bin/sh -xe /tmp/jenkins918250917560153069.sh
> + echo '
> 
>   
>   
> /tmp/jenkins918250917560153069.sh: line 7: syntax error near unexpected token 
> `newline'
>   
> 
>   
>   
>   https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/resources/io/jenkins/plugins/analysis/warnings/cppcheck.xml)
>>  
>> generates error and didn't produces any formatted string.
>>
>> Any help in this regards is highly appreciated. 
>>
>>
>> When you don’t show error messages or log messages we cannot help. Just 
>> writing that it does not work is not enough information.
>>
>> Regards,
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkins...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/4ef79c27-73bf-4062-a240-65f9b38f9341%40googlegroups.com
>>  
>> 
>> .
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkins...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/0A40A6D1-60D0-477B-B000-430235D6808E%40gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a976054d-bd91-4643-96fe-927270bf5019%40googlegroups.com.


Re: CppCheck(XML parsing) with Warning-Next-Generation plugins

2020-04-02 Thread Ahmed Rafiq
Thanks for your reply.
I've used the example xml from the given link, and getting error -

Started by user unknown or anonymous
Running as SYSTEM
Building in workspace
/media/persistent_storage/home/jenkins-warnings/work/workspace/test
[test] $ /bin/sh -xe /tmp/jenkins918250917560153069.sh
+ echo '

  
  
/tmp/jenkins918250917560153069.sh: line 7: syntax error near
unexpected token `newline'
  

  
  
  https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/resources/io/jenkins/plugins/analysis/warnings/cppcheck.xml)
> generates error and didn't produces any formatted string.
>
> Any help in this regards is highly appreciated.
>
>
> When you don’t show error messages or log messages we cannot help. Just
> writing that it does not work is not enough information.
>
> Regards,
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/4ef79c27-73bf-4062-a240-65f9b38f9341%40googlegroups.com
> 
> .
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/0A40A6D1-60D0-477B-B000-430235D6808E%40gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAOxCx6%3D1Xs5dsfuK7Fs8xpTG2VUCXPfjisOs6KWyFbPERrpc%2BQ%40mail.gmail.com.


Re: CppCheck(XML parsing) with Warning-Next-Generation plugins

2020-04-02 Thread Ullrich Hafner


> Am 02.04.2020 um 13:06 schrieb Hakan Rafik :
> 
> I'm using the next generation plugins to represent the CppCheck warnings and 
> errors. 
> But the plugins is not parsing Carriage return:  or Line feed: . 
> I've tried to feed the plugins with the given example 
> (https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/resources/io/jenkins/plugins/analysis/warnings/cppcheck.xml)
>  generates error and didn't produces any formatted string.
> 
> Any help in this regards is highly appreciated. 
> 

When you don’t show error messages or log messages we cannot help. Just writing 
that it does not work is not enough information.

> Regards,
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-users+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/4ef79c27-73bf-4062-a240-65f9b38f9341%40googlegroups.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0A40A6D1-60D0-477B-B000-430235D6808E%40gmail.com.