1
0
mirror of https://github.com/meekrosoft/fff synced 2026-01-23 00:15:59 +01:00

70 Commits

Author SHA1 Message Date
Jakub Dudarewicz
5111c61e1e Add GTest with FetchContent (#120)
* Add missing GTest linking
* Add unit testing switch
* Rename UNIT_TESTING to be fff-specific
* Add fff.h generation toggle
* Use options instead of variables for disabling build elements
* Add interface library for when the header is not regenerated
* Update build script and README
2023-05-22 19:31:38 +10:00
Yuval Peress
d254d115e1 Add tests to verify std::function works with capturing lambda
Introduce a test that uses a capturing lambda as a custom_fake.

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-28 09:11:40 -06:00
Yuval Peress
2cce6b0fc8 Add support for custom_fake function signatures
Update the generator to include a check for CUSTOM_FFF_FUNCTION_TEMPLATE.
If not present it will default to the C style function pointer.
Alternatively, developers may define their own version of the template to
leverage std::function or pw:Function (from the embedded Pigweed library).

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-28 09:11:40 -06:00
Yuval Peress
1f6a3c8331 Refactor test/ directory to match the rest of the project.
The prior PR didn't touch this directory because it was getting too big
and I wanted the diff to be smaller for the test directory. Now addressing
that.

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-28 09:11:40 -06:00
Yuval Peress
2eb067e5a1 Migrate build to CMake and standard github workflows
Replace makefiles with CMakeLists.txt. This will allow for IDE and
platform agnostic builds of FFF.

Update the CI for FFF to use github workflows which don't depend on MS VC.
The workflow added will verify the pull requests sent to master buy
running 'buildandtest' which mirrors the developer workflow.

Signed-off-by: Yuval Peress <peress@google.com>
2022-08-05 11:48:54 -06:00
Mike Long
ff70585de8 Bump windows sdk version to match 2022-08-04 09:34:25 +01:00
Mike Long
c325073b44 Revert "Try to upgrade solution files manually"
This reverts commit bdb739732b.
2022-08-04 09:29:13 +01:00
Mike Long
bdb739732b Try to upgrade solution files manually 2022-08-04 09:23:11 +01:00
Henning Rehn
b9f11dcd8a Handle return value history for custom fakes 2019-08-21 12:37:58 +02:00
James Fraser
2c5ecf5495 Update fff_test_cpp.cpp 2018-12-14 20:19:52 +11:00
James Fraser
f38b06e939 Fixed cpp test specifying calling convention. 2018-12-14 20:15:43 +11:00
James Fraser
fe54d15393 Merge branch 'no_extern_c' of https://github.com/zrax/fff into zrax-no_extern_c 2018-12-14 19:56:22 +11:00
Alain
b76c7c7168 Custom return value delegate sequences for variadic functions (#63)
* Custom return value delegate sequences for variadic functions
* Added unit tests for variadic functions custom return value delegate sequences
* Fixes in code style
* Variadic functions custom delegates also tested in C++
* Fixed some compilation warnings
* Added test for variadic function custom delegates sequence reset
* Updated documentation with variadic functions custom delegate sequences
* Update README.md
* Minor style changes.

Thank you very much @oliviera9!
2018-12-05 23:36:32 +11:00
James Fraser
45c4d31690 Re-instated assert from include fixture as per last commit fix. 2018-11-16 20:27:33 +11:00
James Fraser
a31a9ee38c Added support for specifying calling conventions. 2018-11-16 02:01:11 +11:00
Kate Hart
86c5e44614 Clear fff.call_history when calling FFF_RESET_HISTORY 2018-10-11 21:31:27 -07:00
Michael Hansen
b8f9e65387 Remove extern "C" from fake declarations.
Assuming your C interfaces are appropriately wrapped for C++, it is
unnecessary to force the fakes to be declared extern "C", and doing so
causes any functions declared with C++ linkage to be impossible to fake
due to the conflicting linkage declarations.
2018-05-09 13:26:44 -07:00
Mike Long
953ff07a7d Merge pull request #35 from alvarez86/return_val_history
Return val history
2018-01-28 17:36:18 +00:00
Mike Long
ffde0537d8 Merge pull request #20 from usr42/master
Fix for issue 13: Add function prototype to DECLARE_* macro
2018-01-28 17:35:58 +00:00
Mike Long
2c28c14e83 Merge branch 'master' into return_val_history 2018-01-28 17:24:54 +00:00
Paulo Antonio Alvarez
3000b0b6a4 Add test cases for saving the history of returned values
We test the following cases:
1 - Are return values set with fake.return_val saved in history?
2 - Are return values of a RETURN_SEQ saved in history?
3 - Are return values return by a CUSTOM_FAKE_SEQ saved in history?
2017-08-15 23:40:58 -03:00
usr42
68692c712c Improve vararg tests 2017-02-06 21:36:34 +01:00
usr42
248c7906b4 Merge remote-tracking branch 'upstream/master' 2017-02-04 12:34:55 +01:00
Stephan Creutz
f77932ce1c Wrap statements in multistatement macro with do {} while (0) 2017-01-24 21:09:18 +01:00
usr42
d2992fef8f Fix issue13: Add function prototype to DECLARE_* 2017-01-21 20:06:27 +01:00
usr42
190fa67039 Fix FAKE_VALUE_FUNC with 20 parameters 2017-01-16 12:00:24 +01:00
usr42
bf2275a475 Fix gcc/g++ usage in Makefile 2017-01-14 10:04:45 +01:00
mj
0cf75a229e Added auto counting of parameters for declaration and definition of fake functions for global use. Adjusted unit tests of global functions 2016-12-18 15:03:15 +01:00
Paulo Antonio Alvarez
961289f578 Added two test cases for SET_CUSTOM_FAKE_SEQ
Using a function that sets a value on a variable via a char pointer, we
test the following:
1 - Does the custom fakes are called in the expected order?
2 - When the sequence length is exhausted, do we only call the last
    custom fake in the sequence from then on?
2016-09-14 01:33:20 -03:00
Rubio R. C. Terra
88864216d3 Added test case for FAKE_VALUE_FUNC_VARARG. 2016-06-07 10:01:36 -03:00
Mike Long
cbe9b8b7fb Add license file and make gtest compile with own TR1 tuple library 2014-01-09 22:04:03 +08:00
Mike Long
c38a1343a4 Add support for up to 20 arguments 2013-06-26 07:43:25 +08:00
Mike Long
0f9f1d939d Merged varargs support with const support 2013-06-23 22:22:34 +08:00
Micha Hoiting
ef62856fc3 Implement minimal support for varargs 2012-11-09 01:33:10 +01:00
Micha Hoiting
3cf610ea97 Add support for const parameters in fakes (C only) 2012-11-08 23:14:02 +01:00
Micha Hoiting
e35ae98cac Add test with const parameters 2012-11-07 22:56:45 +01:00
Micha Hoiting
f0ea84ce35 Improve makefiles
Added the use of the $(MAKE) variable to support 'gnumake'.
Fixed an issue with some make compile rule and the -o option.
All targets are removed from the build directory when running 'make clean'.
2012-11-07 22:32:13 +01:00
Mike Long
d14ea470e8 Add tests for returning custom fake return values on non-void custom fakes 2012-07-06 03:29:10 +08:00
Mike Long
1aa823ea2b Add test case for returning values from custom fakes 2012-07-06 01:36:14 +08:00
Mike Long
ef60da4685 fix include file name 2012-07-06 01:35:18 +08:00
Mike Long
cd896ccaf9 fix include file name 2012-07-06 01:33:34 +08:00
Mike Long
aacca34887 fix include file name 2012-07-06 01:33:18 +08:00
Mike Long
899f5617a0 Some small tidying 2012-06-26 20:35:33 +08:00
Mike Long
3d6cfd218b Moved global variables into struct so they don't pollute the global namespace 2012-05-29 07:46:21 +08:00
Mike Long
72ec46f852 Common test cases for Fake Function Framework 2012-05-24 17:52:00 +08:00
Mike Long
f8af106f31 Test suite for global fakes from a cpp context 2012-05-24 17:51:20 +08:00
Mike Long
8ee3ba7261 A simple test framework for C code with googletest compatibility 2012-05-24 17:49:35 +08:00
Mike Long
2e0bb77ac7 Add fakes for common test cases 2012-05-24 17:47:13 +08:00
Mike Long
54fae16407 Add fakes for common test cases 2012-05-24 17:45:40 +08:00
Mike Long
09a747232c Add common test cases 2012-05-24 17:43:45 +08:00