Mark VanderVoord
8723d50f0e
Turn UNITY_OUTPUT_FLUSH off by default. Added a quick-define for the most common case: UNITY_USE_FLUSH_STDOUT. Clarified documentation. Fixes issue #269
2017-03-14 23:23:19 -04:00
Mark VanderVoord
c67a4ffcf3
- Add ability to detect TEST_FILE(“filename.c”) specifications in test files
2017-03-13 17:23:26 -04:00
jsalling
b4f6afa4cf
Test for printing max width of a hex number, back to 100% test coverage
...
Correct clean target and print test fails during coverage in Makefile
2017-01-23 23:05:06 -06:00
jsalling
185fb49380
Cleanup example Makefiles, update test runners
...
Delete clang flags that were disabled with -Wno-*
2017-01-18 08:13:41 -06:00
jsalling
ef1e2ad58c
Option to exclude setjump/longjmp, setjmp.h
...
Using this option changes the control flow of Unity, but is useful on
constrained embedded systems. You can't fully simulate the power of
'longjmp' with just 'return', but Unity still works well, all tests pass.
2017-01-14 11:15:30 -06:00
Mark VanderVoord
c5e9a93418
Merge pull request #243 from jsalling/feature/makefile-clang
...
Organize Makefile so clang works on all platforms, warnings are set
2017-01-13 15:47:50 -05:00
Mark VanderVoord
9954d4f863
Merge pull request #244 from jsalling/cleanup/promotion-warnings
...
Remove promotion warnings on float constants, Inline the isneg/ispos macros
2017-01-13 15:46:07 -05:00
Mark VanderVoord
7b87a579d1
Merge pull request #245 from jsalling/feature/teardown-not-ignore
...
Always run the tearDown() even if test is ignored
2017-01-13 15:43:26 -05:00
Mark VanderVoord
9e8ab3df84
Merge pull request #241 from jsalling/cleanup/float-testing
...
Cleanup floating point print testing, update docs
2017-01-13 15:42:15 -05:00
jsalling
41df8feaee
Fix test for counting CMock_Verify calls
2016-12-31 13:59:07 -06:00
jsalling
f771f0b98f
Finish cleaning up float options in testunity
2016-12-29 23:06:34 -06:00
jsalling
bd4ac58486
Inline the isneg/ispos macros, remove promotion warnings on constants
...
Originated from commit c6dc96f3 but are rarely used and not in math.h
Removes float to double promotion warning and simplifies the code
'gcc -std=gnu99 -Wdouble-promotion' spits out these warnings
2016-12-29 20:47:03 -06:00
jsalling
a0cb138533
Organize Makefile so clang works on all platforms, warnings are set
...
Delete warning flags included by -Wall, -Wextra, or produce false postives
2016-12-29 20:46:06 -06:00
jsalling
65e401f3de
Always run the tearDown() even if test is ignored
2016-12-24 13:56:04 -06:00
jsalling
64f90b1925
Fix test that failed when any other test failed, too distracting
2016-12-23 22:57:21 -06:00
Mark VanderVoord
0603c1cf1e
Merge pull request #231 from jsalling/feature/print-floats
...
Unity prints float (and double) by default
2016-12-21 21:18:43 -05:00
jsalling
b0870ec8b9
Merge branch 'feature/print-floats'
...
Fix new type name conflicts
Conflicts:
src/unity.c
src/unity_internals.h
2016-12-15 21:15:30 -06:00
Matt Chernosky
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
Mark VanderVoord
8e31f5d869
Revised internal type naming scheme to better sandbox Unity away from everything else. Sure, short was nice, but not at the expense of naming collisions.
2016-11-29 08:38:51 -05:00
jsalling
aa4d773df2
Tests for Printing All float values
...
Takes about 10 minutes to run all floats, so split into 3 tests for parallel
running later. This was useful during development for finding hard corner cases
and getting the routine to high quality. Off by default.
Note that all floats 16.0 and up can be represented uniquely (in this format) and will
round-trip back to the exact same float with sscanf(). This property is true for
UnityPrintFloat, despite a few rounding error cases, it will produce output identity.
Better comments and refactor on round ties to even
Add upper threshold value on round to even feature since numerical precision issues
start to give approximations when dividing one large double by another. When tested
on float values, using 1e22 gave the fewest rounding errors.
Fix warnings from gcc. Some float constants do not behave well in existing tests.
Add casts where conversions could be imprecise.
2016-11-19 13:59:19 -06:00
jsalling
25f6417351
Refactor repeated code to print float expected and actual
...
Move double tests down in the file
2016-11-19 13:52:24 -06:00
jsalling
9f4b1a332f
Tests for Printing Floating Point numbers
2016-11-19 13:52:24 -06:00
jsalling
47f6a85b8c
Make UnityPrintFloat on by default
...
Remove UNITY_FLOAT_VERBOSE entirely, add option UNITY_EXCLUDE_FLOAT_PRINT
Remove some questionable float casts from doubles
Default to Round Ties to Even behavior, add option to Round Ties Away from Zero
2016-11-19 13:52:24 -06:00
jsalling
54fe786fae
Round ties to even by default, many C libraries follow this
...
Linux gcc & clang and OSX clang produce output with ties round to even
Windows mingw gcc does not
Example 0.0078125 prints '0.007812'
2016-11-19 13:52:24 -06:00
jsalling
4a27d14734
Correct boundary conditions and add tests
2016-11-19 13:52:24 -06:00
jsalling
1dfcb54491
Start adding tests. Add const and simplify code.
2016-11-19 13:52:24 -06:00
jsalling
e48fe0a07c
Reorganize NaN and Inf printing into if-else blocks
2016-11-19 13:51:59 -06:00
Jean Carlo Machado
4faae4435d
removed duplicated declaration of putcharSpy
2016-11-16 21:37:51 -02:00
jsalling
933cc97364
Add option to set NaN != NaN for floating point assertions
2016-10-10 21:20:10 -05:00
Mark VanderVoord
dce6d329ff
Finished fixing floating point comparisons. We have streamlined how floats and doubles are checked, but we still can't compare them for equality directly. So we're directly testing for infinite and NaN before checking diffs. Also, we've officially decided that for testing purposes NaN shall equal NaN, +Inf shall equal +Inf, and -Inf shall equal -Inf. It's what most people expect during a test.
2016-09-22 08:35:22 -04:00
Mark VanderVoord
7dc17efbb3
Merge pull request #215 from jsalling/bugfix/inf-equals-inf
...
Bugfix Inf equals Inf
2016-09-21 20:52:58 -04:00
Mark VanderVoord
693169eddf
Merge pull request #218 from 2trill2spill/master
...
Add OSX to travis-ci build.
2016-09-20 14:31:45 -04:00
Mark VanderVoord
95435afa4e
Merge pull request #214 from jsalling/feature/c-strings
...
Print escapes for C strings
2016-09-07 07:48:09 -04:00
nah
e12cef36e2
Don't need to ignore unused functions on linux because I reverted the static commit.
2016-09-04 10:47:35 -05:00
nah
8e6716645e
Revert setting functions to static.
2016-09-04 10:38:40 -05:00
nah
2d98ed6afb
Merge branch 'build'
...
Merge build branch.
2016-09-04 10:35:02 -05:00
nah
7ee9bc3ecd
Ignore missing prototype warning.
2016-09-04 10:31:57 -05:00
nah
794e533ab5
Ignore unused functions on linux.
2016-09-04 10:25:31 -05:00
nah
f0f9f20421
Set functions that are only used within testunity to static.
2016-09-04 10:21:06 -05:00
nah
7552c187fb
Ignore missing noreturn and unused functions.
2016-09-04 10:20:31 -05:00
nah
65f0febf03
Ignore padding and float to double implicit warning.
2016-09-04 09:55:49 -05:00
nah
647c846f9f
Set CFLAGS differently for linux and osx.
...
Add check for linux and move initial CFLAG settings inside linux check. Add
CFLAGS specific to osx and clang to the existing osx/darwin check. Ignore clang warning about default on covered enum switch, look at pull #217 and pull #177 for more info about why that warning is ignored on clang. Ignore unknown clang options so that I don't have to change CFLAG settings elsewhere in the file, clang should just ignore options it dosen't know about.
2016-09-04 09:25:44 -05:00
jsalling
de39186187
Add test for C string escape sequences
2016-09-01 01:18:03 -05:00
jsalling
af590028fa
Unity to print C-style escaped strings as "\x16"
...
Changes from "\0x16" before, makes it easier to copy strings from output
2016-09-01 01:18:03 -05:00
jsalling
0cc3e45a23
Suppress output of FAIL messages that are expected during testing
...
Works when using the putcharSpy, transparent without it
2016-08-31 20:43:21 -05:00
Mark VanderVoord
382c7087f4
Merge pull request #211 from jsalling/feature/testunity-fail-output
...
Make testunity.c failure output uniform
2016-08-31 07:20:34 -04:00
jsalling
028ca953d7
Finish checking for equal floats in Arrays functions
...
Refactor to use the same code everywhere for FloatWithin check
Rename and fix a few tests for new behavior, infinity == infinity
2016-08-27 15:12:45 -05:00
jsalling
268c5b7e0b
Make testunity.c printing uniform during failure, delete word "Previous"
2016-08-25 23:02:11 -05:00
jsalling
113f2fc32a
Add line numbers to Unity test Runner generated by awk script
2016-08-25 23:01:10 -05:00
jsalling
28c94bd403
Remove references to UNITY_EXCLUDE_SIZEOF, rework config header
2016-08-25 08:48:29 -05:00