Commit Graph

208 Commits

Author SHA1 Message Date
Daniel Marjamäki 3458692cc7 Travis: Remove Precise job because they are decommisioning that environment :-( 2019-07-25 22:30:44 +02:00
Sebastian 8f92c43567
.travis.yml: Check more Python scripts with pylint (#2019)
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.
2019-07-24 21:09:53 +02:00
amai2012 453de18101
Run pylint on addons providing a buld breaker on travis (#2011)
* 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.
2019-07-18 20:51:58 +02:00
Georgy Komarov 413a5a4865 MISRA: Fix rules suppression, add tests (#1996)
* 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
2019-07-16 22:32:41 +02:00
Daniel Marjamäki 7e3626c84e Travis: Check the naming conventions again 2019-07-15 20:58:07 +02:00
Daniel Marjamäki bafffa6cf2 Travis: Activate and speedup NONNEG syntax check 2019-07-15 13:01:58 +02:00
Daniel Marjamäki 2cfc2d25bb Travis: Temporarily disable the naming conventions check 2019-07-15 08:14:04 +02:00
Daniel Marjamäki 842f8c569b Travis: remove NONNEG syntax check to limit time 2019-07-15 07:50:02 +02:00
Daniel Marjamäki a9d47d4de2 Travis: Use -std=c++0x in NONNEG compile 2019-07-15 07:15:56 +02:00
Daniel Marjamäki aeefaf7004 Travis: Fix one more 'nonneg' issue 2019-07-14 22:49:37 +02:00
Daniel Marjamäki 593733f522 Travis; Try to fix Travis build. Limit self check of gui code 2019-07-14 22:27:22 +02:00
Daniel Marjamäki 33284be64a Try to fix Travis 2019-07-14 21:56:33 +02:00
Daniel Marjamäki 7be6fbf658 Travis: Reduce execution time 2019-07-14 20:46:50 +02:00
Daniel Marjamäki 0014fe880e Mark members and arguments with 'nonneg' 2019-07-14 12:22:33 +02:00
Daniel Marjamäki 1b4485a738 Makefile: Add one more flag 'MATCHCOMPILER=yes' 2019-06-23 13:43:09 +02:00
Daniel Marjamäki de9c999d79 Better handling of spaces in paths 2019-06-22 19:20:15 +02:00
Georgy Komarov e979b0652c misra.py: Fix up and improve load rules parser. (#1895)
* 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
2019-06-17 21:17:29 +02:00
Daniel Marjamäki 54ba9482c6 Travis: Tweak self checking. Only check normal source code folders. 2019-06-15 16:44:34 +02:00
Daniel Marjamäki 181991204a Travis: Improved Cppcheck self check 2019-06-15 14:34:46 +02:00
Daniel Marjamäki b3a46e72dc Fix and test syntaxError suppression 2019-05-01 11:54:13 +02:00
Daniel Marjamäki b0baf4f65b Travis: Fix the cppcheck self-check 2019-04-30 08:56:20 +02:00
Daniel Marjamäki ff8cf4fe25 gui/test: Add projectfile test 2019-04-20 19:07:14 +02:00
Daniel Marjamäki 5a14473963 Disable gui/test again 2019-04-19 14:55:10 +02:00
Daniel Marjamäki 91c000c09d Travis: Try to reactivate the gui/test tests 2019-04-19 11:57:52 +02:00
Daniel Marjamäki bb00435736 Travis: Temporarily disable gui/test until problems are fixed 2019-04-19 11:23:59 +02:00
Daniel Marjamäki 93b27b2022 cleanup gui/test 2019-04-19 09:41:58 +02:00
Daniel Marjamäki 17ec37b366 Run gui tests on Travis 2019-04-19 07:56:10 +02:00
Daniel Marjamäki 0c7d4eb91f Try to fix Travis 2019-04-17 09:04:51 +02:00
Daniel Marjamäki 65d18b3da9 test/cli: refactorings 2019-04-15 10:02:25 +02:00
Daniel Marjamäki 964c2a237a Travis: Try to run the cli testing on Travis 2019-04-14 12:49:43 +02:00
Daniel Marjamäki c47de235f7 Travis: Disable noisy Wshadow warnings 2019-04-10 19:10:05 +02:00
Sebastian 4735b6ca1b
addons/naming.py: Fix crash on unnamed arguments, add regex validation. (#1762)
Crash has been reported in the forum:
https://sourceforge.net/p/cppcheck/discussion/development/thread/138788ac6b/
A small test has been added to avoid regression.
2019-03-26 18:54:09 +01:00
Sebastian d204869d3d
.travis.yml: Add retries to the `apt-get` commands. (#1749)
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
2019-03-21 13:51:14 +01:00
Sebastian 597107ac9a
.travis.yml: update to xenial; add jobs for ubsan and asan (#1745)
As tested by @matthiaskrgr in the branch
https://github.com/matthiaskrgr/cppcheck/commits/travis_xenial
Add job to build Cppcheck on Ubuntu 14.04 trusty (same as for precise).
2019-03-20 15:30:01 +01:00
Sebastian 5728bd63af
.travis.yml: Minor fixes of addons execution / documentation (#1739) 2019-03-14 14:49:02 +01:00
Daniel Marjamäki e16d4f4353 Travis: output errors in gcc format in self-checks 2019-03-11 13:34:44 +01:00
Daniel Marjamäki 33a6e26535 Travis: Remove reduce check, tool has been removed. 2019-03-02 12:12:28 +01:00
Sebastian c10ddaef4a
donate-cpu-server.py: Replace syntax that is deprecated in Python 3. (#1712)
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.
2019-02-28 13:34:23 +01:00
Sebastian b2bb8daaca
.travis.yml: Check python syntax (version 2 and 3) (#1694)
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.
2019-02-25 16:11:14 +01:00
Sebastian c106dd2939
misra addon: Fix issue with unexpected encodings in loadRuleTexts() (trac 8946) (#1608)
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.
2019-01-18 21:30:08 +01:00
Daniel Marjamäki 0c08503b00 Travis: Enable missingOverride checker 2019-01-13 12:21:01 +01:00
Matthias Krüger d45e4287e6 travis: and job that builds on osx 2019-01-13 11:52:01 +01:00
Matthias Krüger 6eca26a4cf travis: add job making sure cppcheck builds on ubuntu precise (12.04) with gcc and clang 2019-01-12 21:09:04 +01:00
Daniel Marjamäki e6edd74099 Temporarily suppress Cppcheck false positives 2019-01-12 19:11:44 +01:00
Matthias Krüger c334d959ce travis: dmake job: don't redundatly install ubuntu packages 2019-01-12 13:22:54 +01:00
Sebastian 1042208c2c
triage: Fix warnings and Windows issues; some enhancements (#1591)
Changes:
- Fixed compiler warnings
- Add "*.*" to file open menu so files without suffix can be opened
- Make it work under Windows
- Make wget() and unpackArchive() methods so they can access the UI
- wget() and unpackArchive() use the new method runProcess() now that also does some error handling
- Errors are shown in the status bar for easier debugging / usage
- Add readme.txt
- Let travis build the triage tool
2019-01-12 09:16:43 +01:00
Matthias Krüger 63d9144f60 travis: refactor config, spawn llvm, clang and dmake jobs directly and remove env var hacks. (#1565)
* travis: refactor config, spawn llvm, clang and dmake jobs directly and remove env var hacks.
* travis: make sure cxxflags of travis match those in the makefile
* travis: move tests that run independant of CXXFLAGS into their own job
2019-01-09 09:54:46 +01:00
amai2012 cc4ca7525a
Clean up redundant actions in travis jobs (#1563)
* Clean up redundant actions in travis jobs.
* Drop validatePlatforms from Makefile target checkcfg
* Print out CPU count. Adjust parameters for parallel jobs to 2 - the current result.
2019-01-05 11:12:32 +01:00
amai2012 c10db6c73b
Try to run CMake (#1555) 2019-01-02 00:01:15 +01:00
Matthias Krüger b5e83d03fe travis: remove "sudo required" as it is being deprecated. 2018-11-24 12:51:33 +01:00