594 Commits

Author SHA1 Message Date
c629e120e1 Fix Leak Detection always passing, but printing a fail message
Don't set CurrentTestFailed = 0 at end, move before last check
 These tests now fail if the output_Spy is not used instead of putchar()
2015-12-16 17:21:09 -06:00
81cf5eb626 Do not add EOL after every ignored test using Unity Fixture
Revert part of commit 77af37ad, code looked like a temporary change
 The behavior is back to the original, printing "....!..." in quiet mode
 Added an ignored test to Fixture for visual inspection
2015-12-15 20:57:22 -06:00
1703bd1a5e Reduce stack usage by removing unnecessary call from group runner in Fixture
Defining a group_runner which calls group_runner_runAll() is redundant
2015-12-15 12:05:38 -06:00
f75f489b6e Get rid of magic numbers and strlen call for 'end' string in Fixture
Using sizeof() instead of constant 4, makes code less fragile to change
 Change name of 'guard' in Guard struct to 'guard_space'
2015-12-15 12:05:38 -06:00
e966a079a4 Fix printing of largest negative number, MIN 64-bits, -9223372036854775808
'divisor' ranges from 1 to 1e18, representable by a long or unsigned long
 'number' becomes negative when cast as signed, so remove the cast and
  keep conversion warnings quiet by turning 'divisor' unsigned
2015-12-14 15:15:09 -06:00
e8662ae1cc - Get these pointers all straightened out! Allow us to override them 2015-12-10 21:47:03 -05:00
86b0d628fd - Applied details to FAIL messages as well 2015-12-10 18:42:45 -05:00
28195baaba - Made some tweaks to the way the new detail handling works (to make it look nicer, mostly)
- Fixed a big ugly error in the fancy RUN_TEST handler
2015-12-10 18:12:45 -05:00
dfbf21c2a3 - Added ability to tack on details to a Unity failure message. 2015-12-10 13:06:41 -05:00
9aeaee26c9 - Cleaned up UnitPointer_Set (thanks Eric)
- Cleaned up a casting warning error
- Removed a couple semicolons from the end of macros SHAME!
2015-12-07 21:41:44 -05:00
90813a3e78 ignore more stuff we don't care about 2015-12-03 16:01:39 -05:00
535fe43c2a Merge pull request #146 from jsalling/unity-eol
Move UNITY_PRINT_EOL to internals, change to function macro (Thanks, jsalling!)
2015-11-24 06:43:27 -05:00
de7cf8335e Transform plain macro into a function macro, UNITY_PRINT_EOL()
This helps clarity and is more obvious, it looks like a print function
2015-11-23 21:03:46 -06:00
d4353166d2 Replace all hard-coded '\n' with UNITY_PRINT_EOL macro in fixture
Delete the { ;} braces and semicolon from UNITY_PRINT_EOL to give it expected
  behavior: 1) requires a semicolon 2) works in one-liner if-else statements
If you need "\r\n" for EOL, define as the following to get the same behavior:
  do{UNITY_OUTPUT_CHAR('\r'); UNITY_OUTPUT_CHAR('\n');}while(0)
2015-11-23 17:09:30 -06:00
5fc2b092d3 Move UNITY_PRINT_EOL to internals to allow access to it.
Unity fixture needs access to this macro to be consistent.
Add #ifndef wrapper for easier redefinition on systems that use "\r\n".
2015-11-23 14:21:43 -06:00
c6dc96f387 We're going to use the C99 isinf() and isnan() macros wherever possible now. If your compiler doesn't support this, define UNITY_EXCLUDE_MATH_H and it will go back to the old method 2015-11-13 09:16:42 -05:00
e4a99b5f96 Merge pull request #141 from adiorion/cpp-fixes
Fix some C++ compatibility issues
2015-11-13 08:15:03 -05:00
16e535c9f8 Merge pull request #142 from paul-wilkinson/docs-typo
docs: fix some typos
2015-11-10 12:05:41 -05:00
1c080665aa docs: fix some typos 2015-11-09 19:53:06 +00:00
d4b83f180b define setUp and tearDown under UNITY_WEAK_PRAGMA
The intent of UNITY_WEAK_PRAGMA is that we have weak symbols for setUp
and tearDown in unity.o, so that developers can override these symbols
if needed but the link works right if they are not defined.

In order to do this using #pragma, the pragma and the definition of the
function (not the declaration) need to be present in the same translation
unit (source code file).

Previously, the UNITY_WEAK_PRAGMA code was just declaring the setUp
function, but not defining it, which means that developers had to add an
empty setUp function to their tests in order to link.
2015-10-28 18:04:43 -07:00
0c9fc9bb33 add prototypes for setUp and tearDown to unity.h 2015-10-27 18:47:31 -07:00
bc8533836b add C++ guards in unity.h 2015-10-27 18:46:59 -07:00
e896830484 Merge pull request #139 from jeremyhannon/master
MISRA rule 19.10: parentheses around macro params
2015-10-15 06:29:11 -04:00
1273112a05 MISRA rule 19.10: parentheses around macro params
Added parentheses around all macro parameters to resolve MISRA 2004
rule 19.10, "in the definition of a function-like macro, each instance
of a parameter shall be enclosed in parenthesis" as tested with the
IAR EW for 8051 compiler, version 9.20.2.

The only questionable change is in "unity_fixture.h" where the nested
macro DECLARE_TEST_CASE in RUN_TEST_CASE prevents surrounding params
"group" and "name" with parentheses.
However, it appears that macro DECLARE_TEST_CASE isn't used elsewhere,
so I eliminated DECLARE_TEST_CASE and put its expansion directly in
RUN_TEST_CASE.  Now the following header files pass rule 19.10:
* unity.h
* unity_internals.h
* unity_fixture.h

For my own project, this change to the Unity test framework allows me
to include my unit test code to be tested against MISRA rules as well,
instead of just production code, to help enforce style and team
guidelines.
2015-10-14 17:19:26 -05:00
6621bc81c4 Merge pull request #136 from algernon/h/fixture/unity_free-NULL-safety
unity_fixture: Make unity_free() NULL-safe
2015-10-06 06:50:52 -04:00
1affe544d2 unity_fixture: Make unity_free() NULL-safe
At the start of unity_free(), check mem for NULL, and return immediately
if it is, so we don't crash in this case. This mimics the behaviour of
most free() implementations. Closes #135.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-10-06 10:44:44 +02:00
7f9f937cd1 Merge pull request #134 from mjago/master
Fix custom message for 64bit WITHIN_MESSAGE macros (thanks Martyn)
2015-09-18 07:02:34 -04:00
70d6cb5780 Fix custom message for 64bit WITHIN_MESSAGE macros 2015-09-18 11:54:09 +01:00
bc307bd600 properly slash paths passed to UnityBegin in test runner generator 2015-08-18 08:27:15 -04:00
98e8590fce Use correct macro for unity_fixture's FAIL.
Output used headers from test runner generator
2015-08-18 08:03:50 -04:00
f97e03d063 Merge pull request #128 from XelaRellum/fix_for_compiler_warning_signed_unsigned
Fixes compiler warning about comparison of signed/unsigned
2015-08-03 10:13:43 -04:00
e3c86b659c Fixes compiler warning about comparison of signed/unsigned 2015-08-03 10:48:17 +02:00
7ff000f29f Merge pull request #126 from tabascoeye/patch-1
"usage" output to show .py ext instead of .rb
2015-07-28 17:20:17 -04:00
f72ca64b52 "usage" output to show .py ext instead of .rb
since this is a python port of "unity_test_summary.rb" the console usage output should say "unity_test_summary.py" instead
2015-07-27 14:24:55 +02:00
a7b85335be the test runner generator now has the ability to also output a header file for the tests, which can get pulled into the test itself if desired. 2015-07-21 15:35:33 -04:00
ab7e322a04 protect against capturing both declaration and definitions and therefore creating a runner which runs that test twice. 2015-07-21 09:37:26 -04:00
16a7d30d5e INTPTR_MAX is defined as nothing on some targets (looking at you HP-UX) and therefore these lines would crash. Adding 0 to the check makes these lines always run. 2015-07-21 08:38:48 -04:00
e47ac34c82 Fix default path in unity test summarizer 2015-07-21 08:29:56 -04:00
ba87d27b77 - switch to old-school hash notation to be backwards compatible with older versions of ruby 2015-07-21 07:35:29 -04:00
a1596c9497 Merge pull request #125 from trianglee/missing_string_assert
Added back TEST_ASSERT_EQUAL_STRING_MESSAGE() which was (accidentally?) removed some time ago.
2015-07-15 10:24:28 -04:00
8c56cf4c67 Merge pull request #124 from trianglee/missing_unity_ptr_attribute
Use UNITY_PTR_ATTRIBUTE() in one place where it was (accidentally?) not used.
2015-07-15 10:23:54 -04:00
f4292f6df5 Added back TEST_ASSERT_EQUAL_STRING_MESSAGE() which was (accidentally?) removed some time ago. 2015-07-15 13:27:15 +03:00
4c9e06e356 Use UNITY_PTR_ATTRIBUTE() in one place where it was (accidentally?) not used.
This eliminates a compiler warning for certain compilers.
2015-07-15 11:52:29 +03:00
6f119a8ebd Merge pull request #122 from trianglee/get_tests_counts
Added ability to get number of ignored tests and total number of tests.
2015-07-14 16:45:55 -04:00
c7b0d3e80d Merge pull request #123 from trianglee/ignored_tests_counted
Bug fix - ignored tests were incorrectly counted when not selected for running. (Thanks!)
2015-07-14 15:27:48 -04:00
8a5e7cce24 Added ability to get number of ignored tests and total number of tests. 2015-07-14 19:49:09 +03:00
9e9adc050c Bug fix - ignored tests were incorrectly counted when not selected for running.
Ignored tests are now correctly skipped if not selected by test name or
by group name.
2015-07-14 19:29:16 +03:00
6a944c2eb9 Merge pull request #120 from aburks/master
Fixes #118: unity_output_Spy should use the platform-agnostic macros for memory.
2015-07-12 10:18:43 -04:00
22b05ad537 Fixes #118: unity_output_Spy should use the platform-agnostic macros for memory. 2015-07-01 11:17:09 -07:00
254ba80543 Merge pull request #117 from aburks/master
Fixes issues #3 and #116 (Thanks!)
2015-06-30 22:48:42 -04:00