94 Commits

Author SHA1 Message Date
Mark VanderVoord f368744ca5 Updates for the new year 2026-01-23 11:19:02 -05:00
Roland Stahn f60fe4b808 Add option 'create_error_stubs'
Proposal for issue #507
2025-06-02 11:44:37 +02:00
Mark VanderVoord a60383ec34 Update licenses to new standards... plus New Years bump 2025-01-01 12:05:55 -05:00
Mark VanderVoord d5e938e4b1 - refactor to match coding standards.
- test against Ruby 3.3 also.
2024-10-23 16:01:48 -04:00
Mark VanderVoord 7d6ec0354a If a short-path cannot be created, fallback to absolute path, even though it's more verbose. 2024-10-23 15:35:37 -04:00
Mark VanderVoord 43618c8c78 🐛 Fix problem if unity helper path is specified as relative path starting with .. 2024-10-03 10:03:33 -04:00
Mark VanderVoord 001bbeca51 🪲 :fail_on_unexpected_calls options now insists on required :ignore plugin (#376) 2024-03-22 21:41:45 -04:00
Mark VanderVoord a642b1fe49 Update to latest Unity and therefore newer Rubocop standards. Tweaked scripts to match latest standards. 2023-11-22 17:40:07 -05:00
Mark VanderVoord 6cf8fb9b71 Fix to incorrect handling of static inlines.
Fix to Ruby deprecated interfaces.
Fix to keep up with new C standards.
2023-11-13 22:33:16 -05:00
Mark VanderVoord bbfaf0425f Handle yaml.load in a way that is ruby version agnostic. 2023-02-06 16:46:48 -05:00
Mark VanderVoord a58808d424 Fixed bug #402, getting confused with __attribute__ directives with spacing. 2023-01-11 15:43:48 -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
Jean Rubillon 4ae268dbbe Changed has_setjmp_h option to exclude_setjmp_h 2021-01-27 18:56:02 +00: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
mvandervoord 9b393ad4fb Further style changes to match standard.
Pull in latest Unity.
Update testing parameters to include Ruby 2.7
2020-03-19 10:00:12 -04:00
mvandervoord 67858837d1 Update coding style to match our own official coding guidelines 2020-03-18 19:16:58 -04:00
mvandervoord 3cfa437460 Make skeleton path configurable 2020-03-12 17:08:51 -04:00
mvandervoord f5abf20f4b Add ability to generate skeleton from header. woo! 2020-03-12 12:20:33 -04:00
laurens 9bc3f25281 Remove internal regex for inline functions and make them fully user-defined
- We set the defaults but the user is free to add his own.
  This will overwrite our defaults but they will be added to the
  documentation as reference for the user
2019-11-13 13:33:16 +01:00
laurens 21e37780fa Add :inline_function_patterns configuration option 2019-11-13 12:08:52 +01:00
Mark VanderVoord d403eb88c8 Merge pull request #258 from jlindgren90/master
Fix compile error when :unity_helper_path is relative.
2019-11-11 08:38:14 -05:00
laurens 27e89dd05e Rename treat_inline to treat_inlines 2019-11-10 18:39:35 +01:00
laurensmiers dbb2f4964c Add treat_inline configuration option 2019-11-10 18:39:20 +01:00
John Lindgren 2817da62db Fix compile error when :unity_helper_path is relative.
Including :unity_helper_path directly doesn't work if the path is
relative and :mock_path is not the same as the working directory.
2019-11-05 15:39:32 -05:00
John Lindgren 277dc34fa1 Fix typo (unity_gelper -> unity_helper). 2019-10-30 12:45:19 -04:00
mvandervoord cda809765e Protect again memory overruns.
Get rid of warnings.
2019-10-23 17:12:18 -04:00
Mark VanderVoord 7761b3fb3f automatically pull in unity helper into tests when specified in both example and cmock's includes. 2019-07-09 10:50:29 -04:00
Mark VanderVoord 347dfc181a Merge branch 'master' into array-typedefs 2019-07-07 15:06:49 -04:00
John Lindgren 789c5852b5 Add treat_as_array configuration option. 2018-12-04 18:18:43 -05:00
Aurelien CHAPPUIS e8c7ad9706 Try to find 'array pair' in parameters following this pattern : <type> * <name>, <@array_size_type> <@array_size_name>
When such a pattern is used, the second parameter is used as the array size in _Expect method.
2018-09-18 12:06:40 +02:00
John Lindgren 3b123fb533 Don't assume that pointer-to-constant types have "const" removed.
1. Update treat_as table to include pointer-to-constant types.
2. Remove unnecessary casts in assignments and return statements.
3. Improve logic for adding "const" to types of function arguments.
4. It's no longer necessary to prepend "const" to function return type.
2017-09-12 15:54:47 -04:00
Mark VanderVoord 43fa31380d - Renamed :strict_mock_calling option to :fail_on_unexpected_calls for clarity. 2017-09-08 14:54:55 -04:00
laurensmiers 9c9f08c48b Add 'strict_mock_calling' option
- By default set to true to maintain the default behaviour of CMock
  - When mocked function is called and no Except/Ignor called,
    test will fail
- When set to false:
  - if test calls mocked function,
    and user did not specify Except/Ignore/...
    test will not fail because of this,
    all calls to mocked functions are ignored
2017-09-06 00:28:37 +02:00
Mark VanderVoord c5ea034965 Merge pull request #80 from austinglaser/master
cmock handles multiple helper headers
2016-10-27 10:17:56 -04:00
Stein Heselmans c910393cca More configuration options for weak symbols 2016-10-14 14:46:33 +02:00
Stein Heselmans 6c8054dc34 Add config option that allows for weak mocked functions 2016-10-14 13:43:02 +02:00
Austin Glaser 6545913260 arrayify helper path within cmock 2016-04-21 17:31:26 -06:00
Austin Glaser 02b0838086 cmock handles multiple helper headers 2016-04-21 16:12:11 -06:00
Stein Heselmans 9e36dc07b1 add mock_suffix configuration option
Same as mock_prefix configuration option. A suffix is easier to work with, if
cmock generation is done from an external GNU makefile.
2016-03-01 16:18:22 +01:00
Mark VanderVoord 2ac0ccb27b fixed white space 2016-01-04 20:00:32 -05:00
Mark VanderVoord 1fdfb61891 Support void* arguments as arrays of bytes by default instead of pointers. 2015-08-18 13:28:29 -04:00
Eivind Tagseth 2b89990106 Add support for subdirs (ref issue #1)
New option :subdir has been added.  Creating a mock for
e.g. sys/types.h using cmock_generator.rb with this option
set in config file, or more likely, command line parameter
--subdir=sys makes cmock create the files
:cmock_path/:subdir/:cmock_prefix+"types.[ch]"

The generated mock file will include the original header
file using #include <sys/types.h> as expected.

Only the generating code has been changed, the example
code with scripts for creating makefiles/creating mocks
using rake was too much work for me, and I didn't need any
of it.
2015-04-10 22:31:32 +02:00
Jocelyn Le Sage 472daea243 Adjusted orig_header_include_fmt configuration item to offer a more flexible way to include the original header file. 2014-11-06 09:25:02 -05:00
Jocelyn Le Sage e3e443f274 Added configuration item to specify how to include the original header file.
This is useful when mocking a header file that is not local.  For example, if the header file to mock is accessible from <mymodule/myfile.h>, one could set the include format to '<mymodule/%s>'.
The default format is '"%s"', which keep the previous behavior.
2014-05-23 07:28:54 -04:00
Mark VanderVoord 85fa655023 - cmock now accepts any combo of yaml and command line options, applying them in the order they appear on the command line (thanks kylebhamilton for the suggestion!) 2014-05-21 15:26:43 -04:00
Mark VanderVoord 4f2dd38b6c Merge branch 'master' of https://github.com/ThrowTheSwitch/CMock
Conflicts:
	lib/cmock_config.rb
	lib/cmock_generator_utils.rb
2014-03-17 10:52:13 -04:00
Mark VanderVoord 26b3f6ef65 Fix encoding issues for anyone using a somewhat modern Ruby (1.9 or greater) 2014-03-17 10:43:19 -04:00
Mark VanderVoord 86594eea25 * split :args_only feature from :ignore plugin to be its own :expect_any_args plugin
* made :expect_any_args work with intermixed expects the way you would think it should work.
2014-03-03 19:28:50 -05:00
Mark VanderVoord 85ce6b2513 Fix encoding issues for anyone using a somewhat modern Ruby (1.9 or greater) 2014-02-28 10:58:57 -05:00