* cert.py: Add '--quiet' option and test
Main sentinel also was required.
* travis.yml: Install pytest with --user
To avoid possible conflicts with system packages later.
* Quickfix
* Update addons structure. Make Y2038 addon works.
All addons are now located in same directory, where cppcheck-gui is
looking for them.
Y2038 addon has been updated to latest cppcheck version. Output is same
as 303622f01c commit as it described in
README: 303622f01c/addons/y2038/README.
* Clean up .travis.yml
* Update travis.yml paths.
* misra.py: Bring back -P argument for backward compatibility
* Fix paths
* Normalize dumpfile paths tpo cppcheck format
* Fixup 3 test.
* Add arguments regression test.
* Fixing travis build
Use renamed pylintrc file that is only meant for Travis checks.
Check all Python scripts in 'addons', 'htmlreport' and 'tools'
Errors for `_socketobject` class are disabled, see
https://stackoverflow.com/questions/10300082/how-to-prevent-python-pylint-complaining-about-socket-class-sendall-method
Install imported modules `unittest2` and `pexpect` via pip.
Add "./addons" to search-path for modules because
"tools/compare-ast-clang-and-cppcheck.py" imports cppcheckdata.py from
addons. Pylint does not seem to evaluate
`sys.path.insert(0, '../addons')` in the script. So an `init-hook` is
necessary in pylintrc_travis.
* Run pylint (using a pylintrc file) on the addon Python scripts. It serves as a build breaker for severe issues.
* Skip y2038 addon for now until it's fixed.
* MISRA: Fix suppressed rules line numbers
Line numbers represented as strings in lxml ETree, but we use it in
integer comparison later.
* MISRA: Use standard library function instead file_prefix.
* MISRA: Use pytest's capsys for capturing, add suppressions tests.
* travis.yml: Update pytest version
* misra.py: Fixup load rules parser.
* misra.py: Report when rule text is missing in rule-texts file
* misra.py: Allow to skip misra checks not specified in rule-texts.
* misra.py: Remove top-level control flow.
Create separate class that stores settings, instead of global variables.
This is required to perform imports from misra.py for testing purposes.
* misra.py: Add simple pytest test for load rules.
* misra.py: Add document structure tests.
* misra.py: Exit after show rules table.
* misra.py: Add document structure tests.
* misra.py: Fixup import pitfall with python2
* misra.py: Minor fixes
Travis often fails to update / install the packages via `apt-get` and
jobs must be restarted manually. This should fix the problem or at least
reduce the frequency at which these failures occur.
Details about the problem and the `travis_retry` command can be found
here:
https://blog.travis-ci.com/2013-05-20-network-timeouts-build-retries
The function `iteritems()` of `dict`s is deprecated. The recommended
alternative is to use `items()`, this function also works with Python 2.
The next issue is that lambdas can no longer unpack tuple parameters
in Python 3. It would be possible to use some workaround and still use
a lambda, but using `operator.itemgetter(1)` instead is faster and the
recommended method in such a case.
The syntax is now compatible with Python 2 and 3 but the server script
still does not work with Python 3. For example `socket.recv()` returns
`bytes` in Python 3 and `str` in Python 2. Currently `str` is expected
so it does not work with Python 3.
As suggested by rikardfalkeborn here:
https://github.com/danmar/cppcheck/pull/1679#issuecomment-465927692
By compiling python scripts the syntax can be checked.
There are two compilations, one for Python 2 and one for Python 3 for
most scripts to make sure at least the syntax is valid for both
versions.
https://trac.cppcheck.net/ticket/8946
Add tests to travis script for verifying rule text loading.
Add dummy rule text files.
misra.py: Try to find a suitable codec for rule texts file.