Coder Social home page Coder Social logo

cppcheck-junit's Introduction

GitHub stats

Top Langs

cppcheck-junit's People

Contributors

johnthagen avatar mjcaisse avatar nkr0 avatar pfannenhans avatar yamokosk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cppcheck-junit's Issues

Installation with pip in Python 3.9 - cppcheck_junit is not recognized as an internal or external command, operable program or batch file

Following on from #13 ..

I uninstalled cppcheck_junit from Python 2.7's pip, fixed my path to shuffle python versions, and reinstalled into Python 3.9's pip.

I now cannot run cppcheck_junit from the commandline.

The following output is from after some trouble shooting.. hence the "cppcheck_junit is already installed to Python 3.9" message:

E:\repos\Project>python --version
Python 3.9.0

E:\repos\Project>pip install cppcheck_junit --user
Requirement already satisfied: cppcheck_junit in c:\python39\lib\site-packages (2.1.0)
Requirement already satisfied: exitstatus>=1.0.0 in c:\python39\lib\site-packages (from cppcheck_junit) (2.1.0)
WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
You should consider upgrading via the 'c:\python39\python.exe -m pip install --upgrade pip' command.

E:\repos\Project>cppcheck_junit cppcheck-result.xml cppcheck-junit.xml
'cppcheck_junit' is not recognized as an internal or external command,
operable program or batch file.

E:\repos\Project>

Please advise any trouble shooting steps I can take.

Failing tests not showing up on bamboo.

I have added the following steps to my bamboo plan

  • cppcheck ... 2> cppcheck-result.xml
  • cppcheck_junit cppcheck-result.xml cppcheck-junit.xml
  • JUnit Parser

I can see a passing test on the dashboard if cppcheck reports no errrors. If there are errors, however, I can only see that JUnit parser failed. No further information is available.

Here are my logs:

build	16-Oct-2017 10:21:36	Running cppcheck:
cppcheck --xml --xml-version=2 --enable=all --
project=compile_commands.json 2> cppcheck-result.xml

cppcheck-result.xml:

<?xml version="1.0" encoding="UTF-8"?>
	<results version="2">
		<cppcheck version="1.80"/>
		<errors>
			<error id="missingInclude" severity="information" msg="Cppcheck cannot find all the include files (use --check-config for details)" verbose="Cppcheck cannot find all the include files. Cppcheck can check the code without the include files found. But the results will probably be more accurate if all the include files are found. Please check your project&apos;s include directories and add all of them as include directories for Cppcheck. To see what files Cppcheck cannot find use --check-config."/>
		</errors>
	</results>
build	16-Oct-2017 10:21:36	Running cppcheck_junit:
cppcheck_junit cppcheck-result.xml cppcheck-junit.xml

cppcheck-junit.xml:

<?xml version='1.0' encoding='utf-8'?>
	<testsuite errors="1" failures="0" hostname="XXX" name="Cppcheck errors" tests="1" time="1" timestamp="2017-10-16T10:21:36.514058">
		<testcase classname="" name="" time="1">
			<error file="" line="0" message="0: (information) Cppcheck cannot find all the include files (use --check-config for details)" type="" />
	</testcase>
</testsuite>
simple	16-Oct-2017 10:21:36	Finished task 'cppcheck' with result: Success
simple	16-Oct-2017 10:21:36	Starting task 'JUnit Parser' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.junit'
simple	16-Oct-2017 10:21:36	Parsing test results under <path>
simple	16-Oct-2017 10:21:36	Failing task since 1 failing test cases were found.
simple	16-Oct-2017 10:21:36	Finished task 'JUnit Parser' with result: Failed

No module named enum

Hi,

Just installed this module
E:\repos\TestProject>pip install cppcheck_junit

.. then updated pip because it told me to:
E:\repos\TestProject>python -m pip install --upgrade pip

Then I tried to convert a file as instructed in README.md, got this:

E:\repos\TestProject>cppcheck_junit cppcheck-result.xml cppcheck-junit.xml
Traceback (most recent call last):
  File "c:\python27amd64\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27amd64\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27amd64\Scripts\cppcheck_junit.exe\__main__.py", line 5, in <module>
  File "c:\python27amd64\lib\site-packages\cppcheck_junit.py", line 16, in <module>
    from exitstatus import ExitStatus
  File "c:\python27amd64\lib\site-packages\exitstatus.py", line 3, in <module>
    import enum
ImportError: No module named enum

E:\repos\TestProject>

I'm using Windows Terminal on Windows 10 Pro, probably Python 2.7.16 (blame googles various build toolings).

Failed to use in Bamboo

If no error in cppcheck no JUnit file generated.
So in that case bamboo JUnit parser marks build as failed.
Probably it is better to create "pseudo" testsuite which is marked as successfull?

Drop Python 3.6

Python 3.6 is EOL and support should be dropped.

@PfannenHans since you are a recent contributor, I wanted to check with you first that you do not need Python 3.6 support with your new feature.

Optional parameter to set exit code on test error

cppcheck-junit currently only sets a non-zero exit code when a parsing error occurred.

Similar to cppcheck's --error-exitcode parameter, it would be great if cppcheck-junit also had this.

Usage scenario:

  1. Call cppcheck without setting the exit code, so the script is not aborted and the junit converter can run afterwards
  2. Then run the junit conversion which (in case of an error) sets the error code and thus aborts the program. Useful for local scripts and CI

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.