Commit Graph

75 Commits

Author SHA1 Message Date
PKEuS dc439f65f8 Added some unit tests to improve test coverage in cmdlineparser 2013-08-15 11:09:40 +02:00
Daniel Marjamäki 3032dbabce astyle formatting 2013-08-08 15:50:45 +02:00
PKEuS 298a33211f Use static CmdLineParser instance where possible in testcmdlineparser.cpp, fixed wrong unit test. 2013-08-07 18:24:18 +02:00
PKEuS a9a5dc0354 Updated to AStyle 2.03, require this version 2013-08-07 16:27:37 +02:00
PKEuS 7596282cba Improved test coverage: Ensure that passing multiple <id> to --enable works. Check settings.isEnabled("warning"). 2013-04-01 04:15:05 -07:00
PKEuS fbe997ca80 Use global Settings instance in TestCmdlineParser, since most tests just need it to pass something to CmdlineParser class.
This change implies that we do not rely on any default state of the Settings class - as it should be, since CmdlineParser is tested, not Settings.
2013-04-01 04:12:56 -07:00
Andrew C. Martin bd0d9b9639 fix misspellings & gcc v3.4.6 warnings
1.  fix typos / misspellings
 - Fix misspelling within comments, variable/function names, stdout messages
 - changes the name of an error code: ```stlBoundries``` changed to ```stlBoundaries```.  Alias old name (```stlBoundries```) to the new one.

2.  fix gcc v3.4.6 32bit & 64bit warnings

 - fixes gcc v3.4.6 warnings, except for those in tinyxml and "-Wmissing-declarations" makefile warnings
 - in Preprocessor::handleIncludes(), replace a ```vector <bool>``` with ```stack<bool>``` (see ```vector<bool>``` warning below).
   - this is the only ```vector<bool>``` in the codebase
 - ```vector <bool>``` is actually a case of template specialization, and is not recommended, according to the following links:

http://stackoverflow.com/q/6461487
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2160.html
http://stackoverflow.com/q/670308

 - in the codebase before and after this change, testrunner SEGVs in a number of places on gcc v3.4.6, including ```Check::~Check()```, among others
   - fc42fc95 fixes this particular runtime issue for DJGPP & __sun
2013-02-09 23:43:09 -07:00
Reijo Tomperi 5d5f7085bf Updating year 2012 -> 2013 to .cpp and .h files and man page. 2013-01-01 18:29:08 +02:00
Daniel Marjamäki 1e024a9abc cleanup more java/c# code. Thanks amai for telling me about this. 2012-10-03 19:19:49 +02:00
Daniel Marjamäki 3e58472cd3 Fixed #4013 (Several test failures in testcmdlineparser.cpp) 2012-09-14 06:58:14 +02:00
PKEuS 50f9dd52ab Used enum instead of string in implementation for '--language='. 2012-09-11 08:53:27 +02:00
PKEuS 87131f6105 Added new cmdline option --language= (alias of GCC-like -x) to enforce a specific language. Valid values: c, c++, java, c#. (#3994) 2012-09-10 18:51:32 +02:00
Daniel Marjamäki f127728582 Enable --std=c11 and --std=c++11 by default 2012-08-25 21:57:45 +02:00
PKEuS 7b25c48f9f Partially reverted my last commit, since some of the tests were already commented out below. 2012-08-01 11:35:20 -07:00
PKEuS 78bc4ddbad Fixed unusedFunctions warnings emmitted by cppcheck:
- Several tests in testcmdlineparser.cpp were never executed (failing tests commented)
- Unnecessary function in testmemleak.cpp removed.
2012-08-01 11:18:03 -07:00
Daniel Marjamäki 7122aeff58 Fixed #3617 (CLI: '-DMACRO' should be considered as '-DMACRO=1') 2012-07-05 19:35:41 +02:00
PKEuS 25167b58a9 Implemented #2990: Print relative paths if -rp or --relative-paths is given 2012-04-06 10:49:21 +02:00
Reijo Tomperi da09adc583 Fix #3510 (Improve error message for --suppressions-list)
http://sourceforge.net/apps/trac/cppcheck/ticket/3510
Print additional info to error message if we suspect that multiple files were given.
2012-01-12 22:21:51 +02:00
Daniel Marjamäki 112873e876 Revert "Fixed #3450 (CLI --report-progress is currently useless)"
This reverts commit e769fe6294.
2012-01-02 07:42:39 +01:00
Daniel Marjamäki e769fe6294 Fixed #3450 (CLI --report-progress is currently useless) 2012-01-02 07:27:45 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
makulik 1e8fc71f8e Solution for ticket #3353 'Allow explicit undef's for configuration'
Signed-off-by: makulik <g-makulik@t-online.de>
2011-11-30 20:24:01 +01:00
Edoardo Prezioso 0bb1ad8782 Little improvements with cli messages and added new '--template' mode: 'edit'.
This option makes it possible opening correctly some editors like 'gedit' or 'vim' by copy-pasting the filename and the line to the command sequence.
2011-10-29 23:50:09 +02:00
Thomas Jarosch ad40586e96 Disable internal checks if NDEBUG is defined (release build) 2011-10-29 12:47:12 +02:00
Thomas Jarosch f6e68914ea Add check for cppcheck's internal API usage (#3263)
First checks:
- Simple pattern used inside Token::Match()
- Complex pattern used inside Token::simpleMatch()

The checks get enabled by passing "--enable=internal".
It's not included in "--enable=all".

If you see something that needs further tweaking, just go for it!
2011-10-28 22:46:07 +02:00
Daniel Marjamäki 65380d16d6 Test: Fixed testing 2011-10-23 10:22:10 +02:00
Daniel Marjamäki 8579270582 astyle formatting 2011-10-23 10:11:43 +02:00
unknown 597a37cc32 #3244 'Get include pathes from file'
Signed-off-by: Günther Makulik <g-makulik@t-online.de>
2011-10-22 21:24:23 +02:00
Daniel Marjamäki a9d2d45fbc astyle formatting 2011-10-22 11:11:54 +02:00
Daniel Marjamäki ab827e3631 Merge pull request #40 from joshbeck/master
Added option to set #ifdef configuration check limit
2011-10-22 00:51:05 -07:00
Marek Zmysłowski b332ea8222 Fixed #3204 (Refactor standards support in Settings) 2011-10-22 09:45:48 +02:00
Joshua Beck 56561835f8 Add option to set #ifdef configuration check limit 2011-10-18 19:52:55 -05:00
PKEuS f8074b71d2 Fixed #2470 (False negative: Possible null pointer dereference (C++0x keyword 'nullptr')) 2011-10-16 12:54:58 +02:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Marek Zmysłowski 307dd00efb Fixed #3072 (improve check: deprecated function alloca) 2011-10-06 08:10:51 +02:00
Kimmo Varis 70b153cc1e Disable fileListStdin test from testcmdlineparser.
That test hangs the test run.
2011-09-30 08:35:23 +03:00
Robert Reif 4d12372b65 run astyle 2011-09-29 19:23:30 -04:00
Joshua Beck 9583394eba Fix test and add info to -h output. 2011-09-27 01:02:58 -05:00
Joshua Beck 87cff36f9d Updated manual and added test for reading file list from stdin. 2011-09-26 20:43:39 -05:00
Simon Martin ba2591b002 Take into account kimmov's review comments 2011-09-17 16:55:59 +02:00
Simon Martin 21a4999c1b Make the build warning clean with clang++ 2011-09-17 14:40:17 +02:00
Kimmo Varis 288efd832c Tests: Add more commandlineparser tests.
Add commandlineparser tests for giving two suppressions. Giving
two suppressions in one parameter is not yet supported so it is
todo-test.
2011-09-13 17:55:00 +03:00
Kimmo Varis 0c42f46717 Tests: Add tests for new --enable flags.
Adding tests for new --enable flafgs (performance, portability)
to CommandLineParser tests.
2011-09-04 21:45:52 +03:00
Daniel Marjamäki afed93d7d6 Command line: Added --std option. Right now only --std=posix is possible but other options might be added later. 2011-08-17 20:08:55 +02:00
Daniel Marjamäki 01b9c0707d Settings: Removed the --enable=posix option. Ticket: #2949 2011-08-14 09:45:53 +02:00
Kimmo Varis cfcfa3f000 Use "enabled" list for the style checking.
Settings-class currently enables style checking via dedicated
boolean attribute. All other CLI's enable-options are handled
through the enable-list. This commit moves style-check enabling
to use the enable-list.

Main advantage is the consistency how options are handled/stored
in the Settings class. Which also unifies using them for the other
code. You need to enable certain type of checks? Use the
addEnabled()-method. You want to check if certain type of checks
are enabled? Use the isEnabled()-method.
2011-08-07 10:28:52 +03:00
Kimmo Varis babfba53fb Tests: Disable tests for CLI -i option.
The tests use non-existing relative paths. Currently the code
checks if the paths added to -i exist and hence these tests
fail.
2011-08-06 19:18:20 +03:00
Kimmo Varis f4950ea836 CLI: Rename --posix to --enable=posix.
Ticket: #2949 (new check: (style) finding non-reentrant functions)
Ticket: #2952 (CLI option --posix is wrong)
2011-08-03 10:28:36 +03:00
Kimmo Varis 335b52653e Tests: add semicolons after TEST_CASE() 2011-07-29 22:00:24 +03:00
Kimmo Varis a50f75ef86 Add --posix CLI option.
Part of ticket #2949 (new check: (style) finding non-reentrant functions)
2011-07-29 20:17:02 +03:00