1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 08:25:58 +01:00
Commit Graph

1079 Commits

Author SHA1 Message Date
Carson Holloway
53e1449f89 Fixed CMake install when compiled with extensions
This is a fix from the change I made in
`commit 418c1635f2f1bcd353b6fce23a16594c914047b8`
where I added options to compile unity with the `fixture` and `memory`
extensions:

In that version, Unity had been able to build, but there were some issues when
trying to install it. Namely, the CMake generator expressions were not
evaluated correctly, and it would try to install with a path that had
un-expanded generator commands in it, which would obviously fail and throw an
error. I've got a feeling that this is a bug with CMake, but for now the
workaround that worked in [this stackoverflow
post](https://stackoverflow.com/questions/51541678/nested-cmake-generator-expressions-are-only-partially-evaluated)
seemed to work here, as well.

Another issue with that commit was that it tried to include a
`unity_memory_internals.h` file, which did not exist. This has also been
resolved.
2021-01-08 10:34:38 +10:00
Carson Holloway
418c1635f2 Added option to compile fixture and memory extensions in CMakeLists.txt 2020-12-20 12:58:11 +11:00
Mark VanderVoord
386c540510 Merge pull request #524 from sardior/exlude-details-compile-fix
Update unity.c
2020-10-12 08:36:48 -04:00
Robert Sławomir Kőműves
723b9fee53 Update unity.c
UNITY_EXCLUDE_DETAILS caused a compile error here due to UNITY_DETAIL{1,2}_NAME declaration already being skipped.
2020-10-08 00:55:47 +02:00
Mark VanderVoord
98045925af Merge pull request #514 from michaelbrockus/let_meson_handle_flags
Let meson handle flags
2020-08-06 06:37:48 -04:00
Michael Brockus
62d0e7d68e Update meson.build 2020-08-05 21:15:37 -07:00
Michael Brockus
52d5f59b72 Update meson.build 2020-08-05 21:13:06 -07:00
Mark VanderVoord
09acb0b64f Merge pull request #513 from carsonalh/msvcfix
Fix for MSVC compilation errors
2020-07-18 10:37:51 -04:00
Carson Holloway
e640949eb3 Patched compilation error for MSVC. 2020-07-18 21:59:55 +10:00
Carson Holloway
6fecc8eb38 Added MSVC options to CMakeLists.txt. 2020-07-18 21:58:54 +10:00
Carson Holloway
777ad17420 Added MSVC options to CMakeLists.txt. 2020-07-18 21:52:00 +10:00
Mark VanderVoord
0126e4804c Merge pull request #504 from phyrwork/master
Fix TEST_ASSERT_BIT(S)_HIGH testing only lower 32-bits (Thanks @phyrwork !)
2020-05-26 08:04:03 -04:00
Connor Newton
b4b1994bd7 Fix TEST_ASSERT_BIT(S)_HIGH testing only lower 32-bits
The high/low bits masks for TEST_ASSERT_BIT(S)_HIGH/LOW are created
by casting 0/-1 to UNITY_UINT32. This isn't OK on 64-bit platforms
as it results in a high bits mask of 0x00000000ffffffff instead of
0xffffffffffffffff.

Cast 0/-1 to UNITY_UINT instead.
2020-05-26 12:58:14 +01:00
Mark VanderVoord
fedd1495c2 Merge pull request #503 from andred/master
unity: annotate noreturn APIs (fix Wsuggest-attribute=noreturn warnings)
2020-05-25 11:09:55 -04:00
André Draszik
a6a4e9766d unity: annotate noreturn APIs (fix Wsuggest-attribute=noreturn warnings)
GCC (& Clang) have the notion of pure and const functions [1],
where those attributes are intended to help the optimiser.

Annotate a few APIs here with the appropriate key words, which
also fixes Wsuggest-attribute=noreturn warning, which a
source base might have enabled:
Compiling unity.c...
.../src/unity.c: In function ‘UnityFail’:
.../src/unity.c:1759:6: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn]
 1759 | void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
      |      ^~~~~~~~~
.../src/unity.c: In function ‘UnityIgnore’:
.../src/unity.c:1796:6: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn]
 1796 | void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
      |      ^~~~~~~~~~~

[1] https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html

Signed-off-by: André Draszik <git@andred.net>
2020-05-25 15:49:47 +01:00
Mark VanderVoord
06a668579f Merge pull request #501 from andred/master
allow compilation with stricter warnings (Thanks @andred !)
2020-05-25 06:59:32 -04:00
André Draszik
9760c4f14f unity: fix Wswitch-enum warning
Compiling a source base / test with Wswitch-enum enabled, gives
the following warning:

../src/unity.c: In function ‘UnityAssertFloatSpecial’:
../src/unity.c:1092:5: warning: enumeration value ‘UNITY_FLOAT_INVALID_TRAIT’ not handled in switch [-Wswitch-enum]
 1092 |     switch (style)
      |     ^~~~~~

Fix by adding the missing value to the default (unhandled) case.

Signed-off-by: André Draszik <git@andred.net>
2020-05-25 08:58:37 +01:00
André Draszik
f5ff3504b5 auto/run_test: fix Wsign-compare warning
Compiling a source base / test with Wsign-compare enabled, gives
the following warning:

build/test/runners/test_system_runner.c: In function ‘run_test’:
build/test/runners/test_system_runner.c:62:35: warning: conversion to ‘UNITY_UINT’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
   62 |     Unity.CurrentTestLineNumber = line_num;
      |                                   ^~~~~~~~

Fix by updating the type in the function declaration.

Signed-off-by: André Draszik <git@andred.net>
2020-05-25 07:14:14 +01:00
Mark VanderVoord
b0032caca4 Merge pull request #499 from jsloth/bugfix/suiteTearDown
Fixed suiteTearDown not matching prototype
2020-05-04 16:09:30 -04:00
Jakob Olesen
dcb30731f8 Fixed suiteTearDown not matching prototype
Fixed suiteTearDown to match prototype in unity.h
2020-05-04 20:34:45 +02:00
Mark VanderVoord
77c394e975 Merge pull request #498 from AlariOis/master
c99 support for new RUN_TEST macro. Thanks @AlariOis !
2020-05-04 09:48:23 -04:00
Mark VanderVoord
87f382fbb2 Merge branch 'master' into master 2020-05-04 09:45:03 -04:00
Alari Õis
97f6d55256 c99 support for new RUN_TEST macro 2020-05-04 08:20:19 +03:00
Mark VanderVoord
cf949f45ca Bump Version v2.5.1 2020-05-03 16:03:07 -04:00
Mark VanderVoord
fd80d514ee Revert "More elegant RUN_TEST macro"
This reverts commit cdfb7e092c.
2020-05-03 08:57:21 -04:00
Mark VanderVoord
9f4b2251de Merge pull request #493 from VShilenkov/master
cmake: update CMake
2020-05-02 14:38:02 -04:00
Mark VanderVoord
c5413ce16b Merge pull request #497 from AlariOis/master
More elegant RUN_TEST macro
2020-05-02 14:36:03 -04:00
Alari Õis
cdfb7e092c More elegant RUN_TEST macro 2020-05-01 08:18:09 +03:00
Mark VanderVoord
ae8b98e80b Merge pull request #496 from AlariOis/master
Fixed typos in documentation
2020-04-25 08:55:07 -04:00
Alari Õis
ec31dfacad Fixed typos in documentation 2020-04-25 07:14:21 +03:00
Vitalii Shylienkov
a2af08c773 project: revert UNITY_VERSION_* to unity.h 2020-04-14 11:02:24 +02:00
Vitalii Shylienkov
b397a72e89 cmake: get version from meson 2020-04-13 13:08:18 +02:00
Vitalii Shylienkov
2a2a4d19c5 meson: supports version
- generate version header
2020-04-13 12:47:07 +02:00
Mark VanderVoord
a78e6c8566 Merge pull request #494 from jlindgren90/master
Wrap UNITY_TEST_ASSERT in a do ... while(0) block
2020-04-09 16:10:46 -04:00
John Lindgren
2485d49d13 Wrap UNITY_TEST_ASSERT in a do ... while(0) block
This ensures that constructions like the following work correctly:

  if(condition)
    TEST_ASSERT(a);
  else
    TEST_ASSERT(b);
2020-04-09 13:03:16 -04:00
Vitalii Shylienkov
d603ccdc3b cmake: update CMake 2020-04-09 13:58:45 +02:00
Mark VanderVoord
10fd84f02b Merge pull request #492 from farshield/fix_small_typo
Fix small typo
2020-03-28 13:34:31 -04:00
Gavriil Pascalau
ff479e9aa0 Fix small typo 2020-03-28 18:31:43 +01:00
mvandervoord
87d8de6d55 Disable osx tests because (1) they are slow and (2) the toolchain is old and crusty 2020-03-19 10:02:38 -04:00
mvandervoord
615cf2349e Update self-test parameters 2020-03-19 09:48:40 -04:00
mvandervoord
8c4ae7aacd clarification in docs (#468) 2020-03-18 15:19:35 -04:00
mvandervoord
2c3e75e859 Fixed issue #486 2020-03-17 20:38:11 -04:00
mvandervoord
371e062555 Fixed issue #480 - better protection against bad pattern matching. 2020-03-17 16:24:25 -04:00
mvandervoord
f61a7ea8e4 Fix Issue #479 (Thanks @cy18) 2020-03-17 16:12:08 -04:00
Mark VanderVoord
a67cb27dd4 Merge pull request #472 from jlindgren90/master
auto: Only create run_test() function if it's needed.
2020-03-17 15:35:47 -04:00
mvandervoord
99199515fd Update documentation.
Add UNITY_PRINT_TEST_CONTEXT (thanks @jlindgren90 !)
Replaces PR #473
2020-03-17 15:01:46 -04:00
mvandervoord
3e4dfec147 Add support for alternate forms of header and source files to test runner generator. This borrows heavily from #477 (Thanks @Tuc-an) but maintains the ability to sort files that don't need to be relinked. 2020-03-17 14:02:54 -04:00
mvandervoord
75754de04e more of the same. 2020-03-16 20:38:54 -04:00
mvandervoord
6e3ecbf92b Declare the test variable static 2020-03-16 20:26:10 -04:00
mvandervoord
d7a05a56df Working with very picky compilers. :) 2020-03-16 20:14:02 -04:00