Commit Graph

409 Commits

Author SHA1 Message Date
Mark VanderVoord 902b6c8b3d Fix bug in parenthetical statements being misinterpreted as functions. (Issue #414) 2023-01-10 15:35:54 -05:00
Mark VanderVoord 91bb49c4a8 Fix same bug as PR #354, but as one line. 2023-01-09 14:50:56 -05:00
Mark VanderVoord 5838025996 rubocop fix. 2023-01-09 14:30:01 -05:00
Mark VanderVoord 16d12416fd Force ourselves to test with Ruby 3.
Fix some issues that have been lurking.
2023-01-09 14:16:30 -05:00
Mark VanderVoord db946f2239 Merge pull request #359 from lukzeg/feature/358_cmock_speed_up_generation
Switch places in the extern C regex to speed up mock generation
2023-01-05 15:53:48 -05:00
Mark VanderVoord b3f78b4259 Merge pull request #374 from Melirius/Calling-conventions-in-function-pointers-fix
Fix parsing of calling conventions in function pointers
2023-01-05 15:52:13 -05:00
Mark VanderVoord 5551437ea8 Merge pull request #378 from danimartin82/master
Fix skeleton file creation
2023-01-05 15:50:32 -05:00
Yago Fontoura Do Rosario 5eebd713ba Added extern "C" to cmock generated headers 2022-09-07 21:16:28 +02:00
Müller, Jan bb85af5567 Fix runaway regex
Multiple nested greedy quantifiers can cause to increase complexity of
the regular expression so that the matching in the cmock_header_parser
would take multiple minutes.
Fixed by removing one of the quantifiers that seems not to be needed.
2022-02-21 13:47:09 +01:00
Dani Martin 202721e561 Fix skeleton file creation 2021-12-17 13:18:19 +01:00
Ivan Siutsou 8b2e897d35 The same output witout convention 2021-11-07 23:04:44 +02:00
Ivan Siutsou 7100ef0e62 Fix parsing of calling conventions in function pointers 2021-11-07 21:47:51 +02:00
Lukasz Zeglinski 50de50d239 Switch places in the extern C regex to speed up mock generation 2021-05-09 22:12:06 +02:00
Mark VanderVoord 27bca0c3c4 style cleanup 2021-02-05 15:53:43 -05:00
Mark VanderVoord 9bb250ea4a Update so only config is shared. Everything else about the current job is passed. 2021-02-05 15:15:14 -05:00
Mark VanderVoord 325b6b333a Revert "Revert "CMock can now compile without setjmp.h present on the platform""
This reverts commit 3eccb8e3d4.
2021-01-29 10:06:08 -05:00
Mark VanderVoord 3eccb8e3d4 Revert "CMock can now compile without setjmp.h present on the platform" 2021-01-28 08:15:10 -05:00
Mark VanderVoord 1f939c9005 Merge pull request #329 from jmrubillon/master
CMock can now compile without setjmp.h present on the platform
2021-01-28 08:04:40 -05:00
Jean Rubillon 9e1c6c068d Fix missed has_setjmp_h convert to exclude_setjmp_h 2021-01-28 12:57:02 +00:00
Jean Rubillon 4ae268dbbe Changed has_setjmp_h option to exclude_setjmp_h 2021-01-27 18:56:02 +00:00
Mark VanderVoord dcde998087 cleanup style 2021-01-16 22:20:16 -05:00
Mark VanderVoord 4dd557f2df Merge pull request #311 from andred/master
allow compilation with stricter warnings
2021-01-07 18:02:24 -05:00
Mark VanderVoord af1818a652 Merge pull request #327 from Hannes103/feature/sub-folder-supprt
add optional folder argument to create_mock()
2021-01-07 17:59:10 -05:00
Mark VanderVoord e352bb8c3b Merge pull request #340 from CezaryGapinski/fix-static-variables-for-enabled-inline-funcs-mocks
Fix static variables detection in headers for enabled inline function mocks
2021-01-07 17:57:36 -05:00
Mark VanderVoord 63f5e2f962 Merge pull request #341 from laurensmiers/master
Remove comments before start of inline-function-parsing
2021-01-07 17:57:17 -05:00
Cezary Gapinski 5eec2510b1 Change inline function detection to leave code not related to functions
static keyword can be used for variable in headers, like in issue #313 or ThrowTheSwitch/Ceedling#541
2020-12-15 21:10:45 +01:00
ollehu 70d5750659 Merge branch 'master' into master 2020-11-12 16:01:43 +01:00
Iñigo Huguet 334f46781a Allow parsing empty values for options in CLI arguments
If an option is passed via CLI, it cannot be passed with an
empty value because the Regex makes it to match 1 or more
characters.

For example, arguments `--mock_prefix=""` and `--mock_prefix=`
are invalid, because they don't match the regex and are not
recognized as options, so they're treated as files to mock.

Changing the regex to match 0 or more characters for the option
value, instead of 1 or more, solves the problem.
2020-11-04 09:42:36 +01:00
Olle Hynén Ulfsjöö ea061bbb50 Improve the regexps for parsing parameters to cmock.rb
Also, conform to the standard 80 character limit

Change-Id: I7830ddd5d65ccc06c96884c1c3d4575241f99e6d
2020-10-23 16:26:36 +02:00
Jean Rubillon 21d181380f Signal that cexception needs setjmp to be supported. 2020-09-08 21:11:54 +01:00
Jean Rubillon 72b356b97d Added option to remove setjmp.h from generated mock files as not supported on all embedded systems 2020-09-08 20:50:48 +01:00
Hannes Bachl 22a7228bbc add optional folder argument to create_mock() 2020-09-01 10:17:54 +02:00
cloudsftp 44f126878b remove trailing whitespace 2020-08-19 13:15:21 +02:00
cloudsftp 1987138e81 resolve ruby offenses found by CI 2020-08-19 12:40:35 +02:00
cloudsftp d304ff273a add StopIgnore to new plugin 2020-08-19 11:25:27 +02:00
cloudsftp 61ed5cc7f8 add more tests for the new plugin 2020-08-19 10:17:05 +02:00
cloudsftp 94ca645061 add first simple test and remove warning "unused parameter" 2020-08-18 16:31:45 +02:00
cloudsftp b735d09603 add plugin :ignore_stateless that solves ThrowTheSwitch/CMock#307 2020-08-18 15:25:55 +02:00
laurens 541e7034ad Remove comments before start of inline-function-parsing 2020-06-13 12:49:33 +02:00
André Draszik ec6fa2c516 Revert "drop unnecessary prototype (immediately before definition)"
This reverts commit 7fbeb40965.

This causes compilation warnings / errors when a project uses
-Wmissing-prototypes compilation flags for safety reasons:

.../test/mocks/mock_logMessages.c:685:6: warning: no previous prototype for ‘CMockExpectParameters_log_message’ [-Wmissing-prototypes]
  685 | void CMockExpectParameters_log_message(CMOCK_log_message_CALL_INSTANCE* cmock_call_instance, const char* logMessage, int messageID, severity_t severityIn)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

etc.

Signed-off-by: André Draszik <git@andred.net>
2020-05-25 16:35:54 +01:00
André Draszik 2568a3657f return_thru_ptr: fix Wsign-conversion warning
Compiling a source base / test with Wsign-conversion enabled, gives
the following warning:

build/test/mocks/mock_logMessages.c: In function ‘countLogMessages’:
build/test/mocks/mock_logMessages.c:749:26: warning: conversion to ‘size_t’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
  749 |       cmock_call_instance->ReturnThruPtr_fileIn_Size);
      |       ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

The ReturnThruPtr_XXX_Size is used as argument to a call to memcpy(),
which expects size_t (unsigned) for a good reason. The size leading
to this call is being determined using sizeof(), so there appears
no reason to ever convert this to (signed) int.

Stop converting size_t to int, and thereby fix the compiler
warning.

Signed-off-by: André Draszik <git@andred.net>
2020-05-25 07:45:34 +01:00
Mark VanderVoord 6259630f00 Merge pull request #301 from booz-allen-hamilton/cpp-static-min
add support for mocking C++ static class member methods
2020-05-03 13:57:14 -04:00
Mark VanderVoord a262194af8 Submit some style cleanup.
Bump Unity Version.
2020-05-03 09:05:39 -04:00
Mark VanderVoord fb8f48a10d Fix tests that were left behind. 2020-05-03 08:53:51 -04:00
Mark VanderVoord b30c22780e Fixed previous error with extra junk and bumped subproject versions 2020-05-03 08:31:23 -04:00
pwatt01 3c3dad1eb2 Remove trailing whitespace 2020-04-27 12:21:41 +09:30
pwatt01 7bfa02cd23 Fix whitespace errors, minimize unnecessary branching 2020-04-24 21:49:16 +09:30
pwatt01 1f16f4b5a3 Fix Ignore declaration missing, fix StopIgnore to handle returns 2020-04-24 14:09:02 +09:30
pwatt01 d0214e4e9d add <function>_StopIgnore() function 2020-04-22 15:34:01 +09:30
Tuc-An e06540f3d7 add support for mocking C++ static class member methods 2020-04-06 11:20:15 -04:00