144 Commits

Author SHA1 Message Date
6b657c6f17 Fix (most) Rubocop warnings. 2018-11-28 13:27:00 -05:00
9987824da7 Added support to inject "extern C" into runners when generated. 2018-08-09 08:48:08 -04:00
ceecf1fae8 Add support for :mock_suffix
Adds support for :mock_suffix when generating mock setup and teardown
functions. Also documents both prefix and suffix in the helper script
guide.
2018-06-07 10:06:43 +02:00
38e1ee872c Added some useful documentation which states the output formats that are parseable by this script. 2018-02-27 07:23:18 +01:00
1994bf9d68 Fixed unity fixture output and added methods for each of the different outputs. Added documentation.
Fixed some whitespaces.
Refactored class_name to class_name_idx (expressiveness).
Refactored the xml output to methods (extensibility).
2018-02-26 22:23:11 +01:00
7a43766586 - Fixed whitespaces and formatting
- Added more expressiveness to the code
- Fixed some of the rubocop hints
2018-02-22 21:47:21 +01:00
ea51e2b35c Refactored the os specific settings, it is now possible to convert both styles on every system (and even mixed) 2018-02-22 21:23:29 +01:00
0937bf728c - Removed member variable @test_flag
- Fixed stdout output if fixture is active
- Refactored the state manipulation of @test_suite and moved it completely into test_suite_verify()
2018-02-22 19:55:40 +01:00
4dfb512a27 Added ".to_s" to the test suite name (explicit type conversion) 2018-02-12 06:44:26 +01:00
dc9c7a7b4b Removed leading whitespace 2018-02-11 13:02:26 +01:00
0760230829 Some minor changes
- String split now works correctly for windows and unix (cross platform)
- Removed unnecessary whitespaces in the xml output (beautifies the output)
- Added support for TEST_IGNORE() (without message)
2018-01-29 21:00:46 +01:00
53f0f95ef8 Test runner generation: Wrap setjmp.h inclusion in ifdefs
Auto generated test runner should generate a code  which includes
setjmp.h only if UNITY_EXCLUDE_SETJMP_H is not defined
2017-11-20 09:46:30 +00:00
629b86d541 Merge unity_setup.h into unity.h. 2017-11-01 11:36:26 -04:00
df78aade4b Make weak symbol usage more portable:
- Enable support for Green Hills Software compiler
- Define weak implementations only once except on Windows
2017-10-09 11:39:48 -04:00
a7e8797e0c Fix link errors with MinGW.
MinGW supports a limited form of weak symbols, with the restriction
that weak/default implementations need to be defined in the same
translation unit they are called from.  Strong/overriding symbols
may of course be specified in a different translation unit.
2017-10-09 10:49:58 -04:00
2593c31bb7 Allow suiteSetUp() and suiteTearDown() to be provided as normal C functions.
This is simpler and more flexible than embedding C code in the Ruby options
(:suite_setup and :suite_teardown).  However, support for :suite_setup and
:suite_teardown is kept for backwards compatibility.

Several configurations are possible:
1. :suite_setup and :suite_teardown options provided and used.
2. :suite_setup and :suite_teardown options not provided (nil):
  2a. Weak symbols not supported; suiteSetUp() and suiteTearDown() are not called.
      It would be simpler to make user-provided functions mandatory in this case,
      but it could break some pre-existing test suites.
  2b. Weak symbols are supported and the stub implementations of suiteSetUp() and
      suiteTearDown() are called if there are no user-provided functions.
  2c. Weak symbols are supported but overridden by user-provided suiteSetUp() and
      suiteTearDown() functions.
2017-09-13 18:12:23 -04:00
f278c18fd9 Fix bug #288 - invalid line numbers on partial name matches 2017-09-11 15:39:17 -04:00
05daf95d4e Update to match Ruby style guide 2017-09-08 15:37:31 -04:00
c1bc32dc58 - Generator will not change names by default
- Fixed some style issues.
2017-06-25 13:58:31 -04:00
2a5b24f7bf Finished updating all Ruby scripts to match our coding standard. Woo! 2017-03-28 20:02:53 -04:00
3e0a7121fb Started to flesh out rubocop settings for this project. Added rakefile tasks to do so. Updated first script to make it compliant. 2017-03-28 15:48:28 -04:00
3062c39725 Starting to enforce our coding style. The first step is that we’ve pulled in Rubocop to check out Ruby syntax. There is likely a bit of customization to do yet AND there is definitely that backlog of todo’s that we just told it to ignore. 2017-03-28 08:44:32 -04:00
c3658a065d Dropped support for pre-2.0 versions of Ruby (not even rubylang supports them anymore) 2017-03-20 16:07:40 -04:00
8a45ccf406 Use custom mock prefix when searching for mock header files. #263 2017-03-20 15:56:05 -04:00
689610b864 reorder includes in generated test runners 2017-03-20 15:49:28 -04:00
c67a4ffcf3 - Add ability to detect TEST_FILE(“filename.c”) specifications in test files 2017-03-13 17:23:26 -04:00
41ee499e63 Tiny tweaks to make Unity fit in more smoothly with Ceedling 2017-03-13 16:46:41 -04:00
4dc04d3977 Enhance parseOutput.rb to support Unity fixture output
unity.h and unity_fixture.h output their results in different string formats. This parseOutput.rb script already parsed the unity.h output to generate a JUnit-style XML summary which could be parsed by CI servers to graph the history of test pass/fail results. The changes in this commit allow the script to also handle the output format of unity_fixture.h which utilizes groups to add a layer of organization for tests.

The changes in this commit were authored by Justin Seifi, my coworker, who has approved of me submitting his work back to this open source framework repo.
2017-02-07 10:38:49 -06:00
1782bab0ba handle undetailed lines test summary python script. 2017-01-31 10:10:31 -05:00
65e401f3de Always run the tearDown() even if test is ignored 2016-12-24 13:56:04 -06:00
7b51355e5a Module generator finishes for partially existing files
This resolves #219. When generating a new module, if all the files to
generate already exist then it fails as before. If some of the files
already exist, then the files that need to be created are created. Any
existing files are not changed.

Also added a bunch of tests for this feature via rspec. Run them from
the test folder with `rake spec`.
2016-12-02 13:49:07 -07:00
37049a3a20 Fixed error when path provided with module name. 2016-11-28 23:57:17 -07:00
4386cf356f Added to Module Generator:
- configurable case.
- better passing of includes and boilerplate information
- test only pattern
- optional naming conventions for case
2016-11-22 14:24:24 -05:00
4e2f0381cc Add ability to inject correct mock prefix 2016-11-21 15:19:16 -05:00
ae5b4c5799 Added ability to inject defines, much like what was built into Ceedling before Ceedling switched to just using this generator. 2016-11-10 10:10:13 -05:00
661c1b2d56 Boost version and remove some debug puts statements 2016-10-27 23:06:18 -04:00
2ce8618014 refactor generate_module so that it can be called as a class from within Ceedling (much like the test runner generator) 2016-10-27 17:33:13 -04:00
bc4da247b5 Do not match strings across newlines 2016-09-21 15:10:43 -04:00
9caae856c4 Test generator: scrub strings after comments
This fixes #220.

Removing strings from test files is still dangerous, but much
less likely to cause problems after this change to do the
removal after removing comments.

The bug could still manifest if a test file contains defines two
macros, one that contains a single quotation mark and then another
defined somewhere after it that contains a single quotation mark.
Everything in between the aforementioned quotation marks would
still be ignored after this commit, but that is an unlikely
scenario.
2016-09-21 14:20:29 -04:00
f276c79f9b Merge branch 'feature/cmd_line_args' 2016-08-11 13:37:51 -04:00
44c429bd8b Escape backslashes for windows paths, fixes #137.
Change-Id: I2dbae30e21ab31921817f68fd7a5e08d21c76626
2016-07-13 10:31:52 +02:00
f205b7de05 - If we declare main before the definition, we make sure the arguments match 2016-07-08 16:05:32 -04:00
eba387fa3e - Add tests which prove command line arguments now work with runner. Fixed a few bugs in this area. 2016-06-27 08:41:58 -04:00
96f51e8530 Updated method of testing generate_test_runner script to be a FUNCTIONAL test instead of a perfect code match. Backfilled most tests and added some coverage not previously present. Still need to test new command line args and a few cmock details. 2016-06-22 20:57:11 -04:00
4d3d062b56 Adding command line support. Started with -n (test name matching) -x (test name exclusion).
Script verification hasn't been added yet.
2016-06-21 16:07:10 -04:00
b3bc196ab3 making new flush routines work under all defined conditions. 2016-06-21 10:01:34 -04:00
87af5a1675 add unity_to_junit.py 2016-06-21 09:43:26 +02:00
7c3d829070 Protect against files without any test output 2016-05-18 07:31:17 -04:00
61dd3f181b Change comments style in unity and test runner to compile with std=c89 2016-05-15 14:35:50 +01:00
bcf6515329 Protect test runner generator against characters in strings that look like comments or functions 2016-02-25 15:35:45 -05:00