jsalling
4c384658e5
Move makefile output to build/ dir for Fixture testing
2016-02-05 21:48:23 -06:00
jsalling
189085d03a
Check for writes to guard space on malloc'd buffers in Fixture
...
There was already some space reserved as a guard, added check for writes
before the beginning of the buffer. Did not change the 'overrun' message.
Underrun buffer writes are likely to be a more rare case.
2016-02-05 21:31:38 -06:00
Mark VanderVoord
7943c766b9
Merge pull request #161 from jsalling/feature/fixture-remove-dependencies
...
Feature - remove dependencies from Fixture, add internal heap option (Wow! Thanks jsalling!)
2016-02-03 21:00:24 -05:00
jsalling
955b221218
Add configuration option UNITY_EXCLUDE_STDLIB_MALLOC to Fixture
...
This feature removes the dependency on malloc/free for constrained
embedded systems without a heap. It uses a static heap inside
Unity Fixture. Setting UNITY_INTERNAL_HEAP_SIZE_BYTES sizes the heap.
Add tests for new option, add targets to makefile for running tests.
UNITY_FIXTURE_MALLOC for Fixture use only, remove from unity_output_Spy.c.
2016-02-01 23:54:06 -06:00
Mark VanderVoord
ed2842fd4d
Merge pull request #160 from pmendham/master
...
Added support for mocks in sub-directories. (Thanks pmendham! This is helpful!)
2016-02-01 18:20:37 -05:00
Peter Mendham
099b0db22b
Updated mock determination code to be more efficient applying the
...
feedback from @mvandervoord (Thanks).
2016-02-01 22:48:23 +00:00
jsalling
ccb29e80c2
Add NULL safety checks to Fixture allocation functions
...
Consistent use of one-liners and NULL
2016-01-31 23:15:00 -06:00
jsalling
e2ad88b9c0
Add checks for NULL return value to Fixture tests and spy
...
Help failures in the spy by adding filename and message to output
2016-01-31 22:44:45 -06:00
jsalling
63a0b98faf
Remove atoi() dependency, only need stdlib.h in Fixture for malloc
...
For redefinition of UNITY_FIXTURE_MALLOC/...FREE use both or replace both.
Clean up whitespace, remaining void*, and comment.
2016-01-30 22:35:59 -06:00
Peter Mendham
4ea563e65b
Added support for mocks in sub-directories.
...
This supports mock headers of the form:
#include "some/dir/MockMyCode.h"
Where the mock name is actually MockMyCode.
I *think* this is the most common scenario when working with mocks
in subdirectories but if not this could be modified to support
alternate schemes.
2016-01-28 20:45:58 +00:00
Mark VanderVoord
f36bd5f521
Merge pull request #159 from pmendham/master
...
Removed unecessary output when generating a test runner (Thanks pmendham!)
2016-01-27 09:52:01 -05:00
Peter Mendham
9a9d6c75cf
Removed unecessary output when generating a test runner
2016-01-27 14:42:29 +00:00
Mark VanderVoord
2179e54d6d
Merge pull request #158 from jsalling/bugfix/fixture-rakefile-fails
...
Fixture rakefile has a conflict defining UNITY_OUTPUT_CHAR
2016-01-24 09:55:50 -05:00
Mark VanderVoord
044a1f517d
Merge pull request #156 from pmendham/master
...
Two small changes to runner generation
2016-01-20 09:08:18 -05:00
Peter Mendham
55a75ded7a
Improved header file generation.
...
Changed the guard syntax as it was cumbersome for header files in deep
sub-directories. Added framework/mock includes to make the header file
stand alone. Made sure that a valid prototype was generated in the case of
no arguments (void).
2016-01-20 13:48:15 +00:00
Peter Mendham
2e4799111c
Added a command line option to change the name of main.
...
This allows alternative entry points. This is intended for the
integration of the unit test into a larger system or for it to be used with
a platform/OS which requires an application entry point other than main. At
the moment there is no way to change the type signature.
2016-01-20 13:45:25 +00:00
jsalling
cd472439bf
Fixture rakefile has a conflict defining UNITY_OUTPUT_CHAR
...
Make core Unity rakefile helper follow Fixture define procedure.
This commit reverts parts of 36e2ca1 .
2016-01-19 23:47:32 -06:00
jsalling
34a30f8e98
Delete dangling function prototype in Fixture internals
2016-01-19 21:47:40 -06:00
jsalling
a7b60dfc88
Consistent use of * in types in the Fixture, whitespace only
2016-01-19 21:47:32 -06:00
jsalling
693417847b
Remove unnecessary stdio.h dependency and clean up Fixture
...
Delete unused variables and empty functions
Make setUp & tearDown (used in Unity core) optionally defined
if 'weak' linking is present
2016-01-15 22:35:43 -06:00
Mark VanderVoord
10146392c8
Merge pull request #154 from jsalling/bugfix/AssertNumbersWithin-overflow
...
Bugfix for UnityAssertNumbersWithin()
2016-01-07 20:45:35 -05:00
Mark VanderVoord
33325f4a0b
More fixes to line endings
2016-01-07 14:20:59 -05:00
Mark VanderVoord
d1111d92af
Merge pull request #152 from jsalling/feature/fixture-ignore-tests-require-spy
...
Fixture - require spy or else ignore tests
2016-01-07 07:56:47 -05:00
Mark VanderVoord
716f88caca
Merge pull request #153 from jsalling/refactor/trailing-whitespace
...
Fix trailing whitespace CRLF, no code changes
2016-01-06 20:41:34 -05:00
jsalling
4108319007
Fix for overflow issue in UnityAssertNumbersWithin()
...
Make subtraction result unsigned, change prototype & casts in internals.
If "actual - expected" overflowed, it wrapped to a negative number,
but would fit in an unsigned type, example is INT_MAX - (-1) = INT_MIN
For correctness, 'delta' should be unsigned too. Passing in a negative
number always passed. The delta can be between INT_MAX & UINT_MAX.
2016-01-06 17:41:06 -06:00
jsalling
8ca3062ad4
Adding tests for overflow when calling UnityAssertNumbersWithin()
...
32 or 64 bit test will fail if compiled with -m32 or -m64, repectively
on clang or gcc
Fixes to the failures will follow
2016-01-06 17:41:02 -06:00
jsalling
04adb2d2c9
Fix trailing whitespace CRLF, no code changes
...
Now that the project is using .gitattributes, get rid of CRLF in the repo.
2016-01-06 17:23:43 -06:00
Mark VanderVoord
edfba3793e
Merge pull request #151 from jsalling/bugfix/add-tests-for-printing-numbers
...
Add tests for printing numbers, interface for spying on output strings (Thanks! I like this idea!)
2016-01-05 19:17:52 -05:00
Mark VanderVoord
f52538d401
- fix whitespace
...
- tweak docs
2016-01-04 19:30:38 -05:00
Mark VanderVoord
0decf21b9d
Merge pull request #149 from jsalling/refactor/fixture-cleanup
...
Refactor Fixture, no EOL with ignored tests, add a Makefile for Fixture tests
2016-01-04 18:46:22 -05:00
Mark VanderVoord
eac0943f53
Merge pull request #148 from jsalling/master
...
Fix printing of largest negative number
2016-01-04 18:42:24 -05:00
Mark VanderVoord
a61ba9d43f
Merge pull request #150 from pacheco017/unity-float-verbose-includes
...
Include <stdio.h> (for sprintf) when using UNITY_FLOAT_VERBOSE (thanks pacheco017!)
2015-12-28 13:17:28 -05:00
Matias Devenuta
fe4001f876
Include <stdio.h> (for sprintf) when using UNITY_FLOAT_VERBOSE
2015-12-28 15:04:27 -03:00
jsalling
c5bfe0e100
Fixture C99 compliance on tricky macros for Spy & match core Unity version
...
Add CFLAGS in Fixture Makefile to catch C99 rules with '-pedantic'
2015-12-22 12:40:31 -06:00
jsalling
5cc5e3473d
Add MACROs to check if tests are built using the Output Spy
...
Ignore tests that need the Spy if we are not building with it
2015-12-21 14:37:23 -06:00
jsalling
36e2ca192b
Adding -D UNITY_OUTPUT_CHAR=putcharSpy to testing build targets
...
Updated clang and gcc targets. Fixed spelling of LIMITS, which breaks the
gcc_auto_sizeof.yml build.
Commented -Wunreachable-code, Unity won't build on OSX clang with it,
error in unity.c:769 & 932: 'default: break;' case.
2015-12-21 11:39:50 -06:00
jsalling
a3d81dfa41
Add tests for printing numbers using a compile time replacement spy
...
If Unity core is compiled with UNITY_OUTPUT_CHAR = putcharSpy, these tests
will run, otherwise they are ignored and print a message
Includes an implementation of putcharSpy, which allows checking the I/O
from Unity during a test. Follows closely from the Fixture spy
Tricky macros determine if putcharSpy is injected
2015-12-20 22:00:02 -06:00
jsalling
caa3f6663d
Add Makefile to fixture/test to make building tests easier
...
No rake and ruby required to build existing tests
2015-12-18 17:48:35 -06:00
jsalling
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
jsalling
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
jsalling
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
jsalling
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
jsalling
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
Mark VanderVoord
e8662ae1cc
- Get these pointers all straightened out! Allow us to override them
2015-12-10 21:47:03 -05:00
Mark VanderVoord
86b0d628fd
- Applied details to FAIL messages as well
2015-12-10 18:42:45 -05:00
Mark VanderVoord
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
Mark VanderVoord
dfbf21c2a3
- Added ability to tack on details to a Unity failure message.
2015-12-10 13:06:41 -05:00
Mark VanderVoord
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
Mark VanderVoord
90813a3e78
ignore more stuff we don't care about
2015-12-03 16:01:39 -05:00
Mark VanderVoord
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