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

15 Commits

Author SHA1 Message Date
Mike Long
488442255c Don't use shell script for CI runs, doesn't work on windows 2022-08-19 16:37:21 +02:00
Mike Long
d4fed915a3 Add ninja to build envs 2022-08-19 16:33:30 +02:00
Mike Long
25d4c616be Build on push also 2022-08-19 16:27:24 +02:00
Mike Long
21f1693002 Run tests in CI 2022-08-19 16:21:02 +02:00
Mike Long
78555cb85c Merge pull request #112 from yperess/peress/ci
Migrate to standard github workflows
2022-08-10 14:13:53 +02: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
Mike Long
c9bebd9d14 Create msbuild.yml 2022-08-03 19:01:23 +01:00
Mike Long
7e09f07e5b Merge pull request #77 from henningrehn/return_value_history_for_custom_fakes
Handle return value history for custom fakes
2019-08-21 14:57:51 +02:00
Henning Rehn
b9f11dcd8a Handle return value history for custom fakes 2019-08-21 12:37:58 +02:00
James Fraser
ab47e7fc5b Update README.md 2019-03-02 16:01:24 +11:00
James Fraser
f9c08aec81 Update README.md 2019-03-02 16:00:41 +11:00
James Fraser
cf2c4780ef Update README.md 2019-03-02 15:59:49 +11:00
73 changed files with 548 additions and 1651 deletions

View File

@@ -1,13 +0,0 @@
version: '{build}-appveyor'
image: Visual Studio 2017
build:
verbosity: minimal
test_script:
- cmd: >-
C:\projects\fff\test\ms_vc_fff_test\x64\Debug\ms_vc_fff_test_c.exe
C:\projects\fff\test\ms_vc_fff_test\x64\Debug\ms_vc_fff_test_cpp.exe
C:\projects\fff\test\ms_vc_fff_test\x64\Debug\ms_vc_fff_test_global_cpp.exe
C:\projects\fff\test\ms_vc_fff_test\x64\Debug\ms_vc_fff_test_global_c.exe

25
.github/workflows/verify_pr.yaml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Check PR
on:
pull_request:
branches:
- master
push:
jobs:
check-pr:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Build
run: |
mkdir build
cmake -GNinja -B build
cmake --build build
ctest --test-dir build --output-on-failure

3
.gitignore vendored
View File

@@ -25,6 +25,9 @@ bld/
# Visual Studio 2015/2017 cache/options directory
.vs/
# IntelliJ IDE project directory
.idea/
# Visual C++ cache files
ipch/
*.aps

34
CMakeLists.txt Normal file
View File

@@ -0,0 +1,34 @@
# Copyright 2022 Google LLC
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
project(fff)
set(CMAKE_CXX_STANDARD 11)
# Add the gtest library which will be used below
add_subdirectory(gtest)
# Enable ctest
enable_testing()
# Generate fff.h if fakegen.rb changed
add_custom_command(
OUTPUT
${CMAKE_CURRENT_LIST_DIR}/fff.h
COMMAND
ruby ${CMAKE_CURRENT_LIST_DIR}/fakegen.rb >> ${CMAKE_CURRENT_LIST_DIR}/fff.h
DEPENDS
${CMAKE_CURRENT_LIST_DIR}/fakegen.rb
${CMAKE_CURRENT_LIST_DIR}/LICENSE
)
add_custom_target(fff_h DEPENDS ${CMAKE_CURRENT_LIST_DIR}/fff.h)
# Add an interface library for fff.h
add_library(fff INTERFACE)
add_dependencies(fff fff_h)
target_include_directories(fff INTERFACE ${CMAKE_CURRENT_LIST_DIR})
# Add tests and samples
add_subdirectory(test)
add_subdirectory(examples)

View File

@@ -1,10 +0,0 @@
all:
mkdir -p build
cd gtest; $(MAKE) all
cd test; $(MAKE) all
cd examples; $(MAKE) all
clean:
cd gtest; $(MAKE) clean
cd test; $(MAKE) clean
cd examples; $(MAKE) clean

View File

@@ -6,34 +6,41 @@
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/wulfgarpro/fff?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
- [A Fake Function Framework for C](#a-fake-function-framework-for-c)
- [Hello fake world!](#hello-fake-world)
- [Capturing arguments](#capturing-arguments)
- [Return values](#return-values)
- [Resetting a fake](#resetting-a-fake)
- [Call history](#call-history)
- [Hello Fake World!](#hello-fake-world)
- [Capturing Arguments](#capturing-arguments)
- [Return Values](#return-values)
- [Resetting a Fake](#resetting-a-fake)
- [Call History](#call-history)
- [Default Argument History](#default-argument-history)
- [User Defined Argument History](#user-defined-argument-history)
- [Function Return Value Sequences](#function-return-value-sequences)
- [Custom Return Value Delegate](#custom-return-value-delegate)
- [Custom Return Value Delegate Sequences](#custom-return-value-delegate-sequences)
- [Return value history](#return-value-history)
- [Return Value History](#return-value-history)
- [Variadic Functions](#variadic-functions)
- [How do I specify calling conventions for my fake functions?](#how-do-i-specify-calling-conventions-for-my-fake-functions)
- [How do I fake a function that returns a value by reference?](#how-do-i-fake-a-function-that-returns-a-value-by-reference)
- [How do I fake a function with a function pointer parameter?](#how-do-i-fake-a-function-with-a-function-pointer-parameter)
- [How do I reuse a fake across multiple test-suites?](#how-do-i-reuse-a-fake-across-multiple-test-suites)
- [Common Questions](#common-questions)
- [Specifying GCC Function Attributes](#specifying-gcc-function-attributes)
- [Find out more...](#find-out-more)
- [Find Out More](#find-out-more)
- [Benefits](#benefits)
- [Under the hood](#under-the-hood)
- [Under the Hood](#under-the-hood)
- [Cheat Sheet](#cheat-sheet)
## A Fake Function Framework for C
fff is a micro-framework for creating fake C functions for tests. Because life
is too short to spend time hand-writing fake functions for testing.
## Running all tests
## Hello fake world!
### Linux / MacOS
To run all the tests and sample apps, simply call `$ buildandtest`. This script
will call down into CMake with the following:
```shell
cmake -GNinja -B build
cmake --build build
ctest --test-dir build --output-on-failure
```
## Hello Fake World!
Say you are testing an embedded user interface and you have a function that
you want to create a fake for:
@@ -87,11 +94,7 @@ typedef struct DISPLAY_init_Fake {
DISPLAY_init_Fake DISPLAY_init_fake;
```
## Capturing arguments
## Capturing Arguments
Ok, enough with the toy examples. What about faking functions with arguments?
@@ -129,9 +132,7 @@ type (a char pointer in this example).
A variable is created for every argument in the form
`"function_name"fake.argN_val`
## Return values
## Return Values
When you want to define a fake function that returns a value, you should use the
`FAKE_VALUE_FUNC` macro. For instance:
@@ -178,10 +179,7 @@ you would use a syntax like this:
```c
FAKE_VALUE_FUNC(double, pow, double, double);
```
## Resetting a fake
## Resetting a Fake
Good tests are isolated tests, so it is important to reset the fakes for each
unit test. All the fakes have a reset function to reset their arguments and
@@ -221,7 +219,7 @@ void setup()
}
```
## Call history
## Call History
Say you want to test that a function calls functionA, then functionB, then
functionA again, how would you do that? Well fff maintains a call
history so that it is easy to assert these expectations.
@@ -302,7 +300,6 @@ override the default by defining it before include the `fff.h` like this:
#include "../fff.h"
```
## Function Return Value Sequences
Often in testing we would like to test the behaviour of sequence of function call
@@ -349,7 +346,7 @@ TEST_F(FFFTestSuite, when_value_custom_fake_called_THEN_it_returns_custom_return
}
```
## Custom Return Value Delegate Sequences
### Custom Return Value Delegate Sequences
Say you have a function with an out parameter, and you want it to have a different behaviour
on the first three calls, for example: set the value 'x' to the out parameter on the first call,
@@ -395,7 +392,7 @@ The fake will call your custom functions in the order specified by the `SET_CUST
macro. When the last custom fake is reached the fake will keep calling the last custom
fake in the sequence. This macro works much like the `SET_RETURN_SEQ` macro.
## Return value history
## Return Value History
Say you have two functions f1 and f2. f2 must be called to release some resource
allocated by f1, but only in the cases where f1 returns zero. f1 could be
@@ -437,7 +434,9 @@ could call the real `fprintf()` like this:
Just like [return value delegates](#custom-return-value-delegate-sequences), you can also specify sequences for variadic functions using `SET_CUSTOM_FAKE_SEQ`.
See the test files for examples.
## How do I specify calling conventions for my fake functions?
## Common Questions
### How do I specify calling conventions for my fake functions?
fff has a limited capability for enabling specification of Microsoft's Visual C/C++ calling conventions, but this support must be enabled when generating fff's header file `fff.h`.
@@ -454,7 +453,7 @@ FAKE_VOID_FUNC(__cdecl, voidfunc1, int);
FAKE_VALUE_FUNC(long, __cdecl, longfunc0);
```
## How do I fake a function that returns a value by reference?
### How do I fake a function that returns a value by reference?
The basic mechanism that fff provides you in this case is the custom_fake field described in the *Custom Return Value Delegate* example above.
@@ -494,7 +493,7 @@ TEST_F(FFFTestSuite, when_value_custom_fake_called_THEN_it_returns_custom_output
}
```
## How do I fake a function with a function pointer parameter?
### How do I fake a function with a function pointer parameter?
Using fff to stub functions that have function pointer parameter can cause problems when trying to stub them. Presented here is an example how to deal with this situation.
@@ -578,7 +577,8 @@ TEST_F(FFFTestSuite, test_fake_with_function_pointer)
ASSERT_EQ(cb_timeout_called, 1);
}
```
## How do I reuse a fake across multiple test-suites?
### How do I reuse a fake across multiple test-suites?
fff functions like `FAKE_VALUE_FUNC` will perform both the declaration AND the definition of the fake function and the corresponding data structs. This cannot be placed in a header, since it will lead to multiple definitions of the fake functions.
@@ -605,13 +605,14 @@ DEFINE_FAKE_VALUE_FUNC_VARARG(int, value_function_vargs, const char *, int, ...)
DEFINE_FAKE_VOID_FUNC_VARARG(void_function_vargs, const char *, int, ...);
```
## Specifying GCC Function Attributes
You can specify GCC function attributes for your fakes using the `FFF_GCC_FUNCTION_ATTRIBUTES` directive.
### Weak Functions
One usful attribute is the _weak_ attribute that marks a function such that it can be overridden by a non-weak variant at link time. Using weak functions in combination with FFF can help simplify your testing approach.
One usful attribute is the _weak_ attribute that marks a function such that it can be overridden by a non-weak variant at link time. Using weak functions in combination with fff can help simplify your testing approach.
For example:
* Define a library of fake functions, e.g. libfake.a.
@@ -626,7 +627,7 @@ You can mark all fakes with the weak attribute like so:
See the example project that demonstrates the above approach: _./examples/weak_linking_.
## Find out more...
## Find Out More
Look under the examples directory for full length examples in both C and C++.
There is also a test suite for the framework under the test directory.

View File

@@ -1,20 +1,15 @@
#!/bin/bash
set -e
cat LICENSE > fff.h
echo >> fff.h
ruby fakegen.rb >> fff.h
make clean
make all
build/fff_test_c
build/fff_test_cpp --gtest_output=xml:build/test_results.xml
build/ui_test_ansic
build/ui_test_cpp --gtest_output=xml:build/example_results.xml
build/fff_test_glob_c
build/fff_test_glob_cpp --gtest_output=xml:build/test_global_results.xml
build/driver_testing --gtest_output=xml:build/driver_testing.xml
build/driver_testing_fff --gtest_output=xml:build/driver_testing_fff.xml
build/weak_linking/test_display
build/weak_linking/test_sensor
build/weak_linking/test_main
# Clear the environment
rm -fr build fff.h
mkdir build
# Configure the build
cmake -GNinja -B build || exit -1
# Build all targets
cmake --build build || exit -1
# Run all tests
ctest --test-dir build --output-on-failure

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env bash
fff_len=`cat fff.h | wc -l`
# test/fff_test_c.c
gcc -E test/fff_test_c.c > out
comm -13 <(sort < fff.h | uniq) <(sort < out | uniq) > unique_to_out # strip out fff.h include
awk 'FNR==NR{a[$1];next}($1 in a){print}' fff.h unique_to_out > matched # find unique matches
awk 'FNR==NR{a[$1];next}($1 in a){print}' matched fff.h > coverage # find coverage of matches in fff.h
cov_len=`cat coverage | wc -l`
echo "test/fff_test_c.c coverage:"
echo "$cov_len / $fff_len" | bc -l
# test/fff_test_cpp.cpp
gcc -E test/fff_test_cpp.cpp -I . > out
comm -13 <(sort < fff.h | uniq) <(sort < out | uniq) > unique_to_out
awk 'FNR==NR{a[$1];next}($1 in a){print}' fff.h unique_to_out > matched
awk 'FNR==NR{a[$1];next}($1 in a){print}' matched fff.h > coverage
cov_len_2=`cat coverage | wc -l`
echo "test/fff_test_cpp.cpp coverage:"
echo "$cov_len_2 / $fff_len" | bc -l
# total coverage
echo "TOTAL COVERAGE:"
echo "($cov_len + $cov_len_2) / ($fff_len * 2)" | bc -l

6
examples/CMakeLists.txt Normal file
View File

@@ -0,0 +1,6 @@
# Copyright 2022 Google LLC
# SPDX-License-Identifier: Apache-2.0
add_subdirectory(driver_testing)
add_subdirectory(embedded_ui)
add_subdirectory(weak_linking)

View File

@@ -1,9 +0,0 @@
all:
cd embedded_ui; $(MAKE) all
cd driver_testing; $(MAKE) all
cd weak_linking; $(MAKE) all
clean:
cd embedded_ui; $(MAKE) clean
cd driver_testing; $(MAKE) clean
cd weak_linking; $(MAKE) clean

View File

@@ -0,0 +1,31 @@
# Copyright 2022 Google LLC
# SPDX-License-Identifier: Apache-2.0
# Create the driver test binary
add_executable(driver_test
src/driver.c
src/driver.test.cpp
)
target_include_directories(driver_test PRIVATE include)
target_link_libraries(driver_test PRIVATE gtest fff)
target_compile_definitions(driver_test PUBLIC TEST_USER_OWN_TR1_TUPLE=1 TESTING)
# Create the driver fff test binary
add_executable(driver_fff_test
src/driver.c
src/driver.test.fff.cpp
)
target_include_directories(driver_fff_test PRIVATE include)
target_link_libraries(driver_fff_test PRIVATE gtest fff)
target_compile_definitions(driver_fff_test PUBLIC TEST_USER_OWN_TR1_TUPLE=1 TESTING)
# Add tests to ctest
add_test(
NAME driver_test
COMMAND $<TARGET_FILE:driver_test>
)
add_test(
NAME driver_fff_test
COMMAND $<TARGET_FILE:driver_fff_test>
)

View File

@@ -1,64 +0,0 @@
$(VERBOSE).SILENT:
BUILD_DIR = ../../build
TEMPLATE_PROGNAME = $(BUILD_DIR)/template
CPP_PROGNAME_NOFFF = $(BUILD_DIR)/driver_testing
CPP_PROGNAME_FFF = $(BUILD_DIR)/driver_testing_fff
CC = gcc
CC += -c
CPP = g++
CPP += -c
LD = g++
GTEST_OBJS = $(BUILD_DIR)/gtest-all.o $(BUILD_DIR)/gtest-main.o
C_OBJFILES = $(BUILD_DIR)/driver.o
TEMPLATE_OBJFILES = $(BUILD_DIR)/test_suite_template.o
FFF_OBJFILES = $(BUILD_DIR)/driver.test.fff.o $(GTEST_OBJS)
NOFFF_OBJFILES = $(BUILD_DIR)/driver.test.o $(GTEST_OBJS)
CPP_LIBS = -lpthread
all: $(CPP_PROGNAME_NOFFF) $(CPP_PROGNAME_FFF) $(TEMPLATE_PROGNAME)
.PHONY: clean
clean:
@echo "Cleaning object files"
@echo " rm -f $(BUILD_DIR)/*.o"
rm -f $(BUILD_DIR)/*.o
@echo "Cleaning backups"
@echo " rm -f *~"
rm -f *~
@echo "Removing programs"
@echo " rm -f $(CPP_PROGNAME_NOFFF) $(CPP_PROGNAME_FFF) $(TEMPLATE_PROGNAME)"
rm -f $(CPP_PROGNAME_NOFFF) $(CPP_PROGNAME_FFF) $(TEMPLATE_PROGNAME)
$(BUILD_DIR)/%.o: %.c
@echo "Compiling "$@
@echo " CC "$<
$(CC) -o $@ $< -DTESTING
$(BUILD_DIR)/%.o: %.cpp
@echo "Compiling "$@
@echo " CPP "$<
$(CPP) -DGTEST_USE_OWN_TR1_TUPLE=1 -I../.. -o $@ $< -DTESTING
$(TEMPLATE_PROGNAME): $(TEMPLATE_OBJFILES)
@echo "Linking "$@
@echo " LD -o "ctemplate" "$(TEMPLATE_OBJFILES)
$(LD) -o $(TEMPLATE_PROGNAME) $(TEMPLATE_OBJFILES)
$(CPP_PROGNAME_FFF): $(FFF_OBJFILES) $(C_OBJFILES)
@echo "Linking "$@
@echo " LD -o "$(CPP_PROGNAME_FFF)" "$(FFF_OBJFILES)
$(LD) -o $(CPP_PROGNAME_FFF) $(FFF_OBJFILES) $(C_OBJFILES) $(CPP_LIBS)
$(CPP_PROGNAME_NOFFF): $(NOFFF_OBJFILES) $(C_OBJFILES)
@echo "Linking "$@
@echo " LD -o "$(CPP_PROGNAME_NOFFF)" "$(NOFFF_OBJFILES)
$(LD) -o $(CPP_PROGNAME_NOFFF) $(NOFFF_OBJFILES) $(C_OBJFILES) $(CPP_LIBS)
nothing:
@echo "Nothing to do; quitting :("
@echo "HINT: Try make all"

View File

@@ -3,7 +3,7 @@ extern "C"
#include "driver.h"
#include "registers.h"
}
#include "../../fff.h"
#include "../../../fff.h"
#include <gtest/gtest.h>

View File

@@ -3,7 +3,7 @@ extern "C"{
#include "registers.h"
#include "hardware_abstraction.h"
}
#include "../../fff.h"
#include "fff.h"
#include <gtest/gtest.h>
DEFINE_FFF_GLOBALS;

View File

@@ -0,0 +1,23 @@
# Copyright 2022 Google LLC
# SPDX-License-Identifier: Apache-2.0
# Create the ui_test_ansic test binary
add_executable(ui_test_ansic src/UI_test_ansic.c src/UI.c)
target_include_directories(ui_test_ansic PRIVATE include)
target_link_libraries(ui_test_ansic PRIVATE fff)
# Create the ui_test_cpp test binary
add_executable(ui_test_cpp src/UI_test_cpp.cpp src/UI.c)
target_include_directories(ui_test_cpp PRIVATE include)
target_link_libraries(ui_test_cpp PRIVATE gtest fff)
# Add tests to ctest
add_test(
NAME ui_test_ansic
COMMAND $<TARGET_FILE:ui_test_ansic>
)
add_test(
NAME ui_test_cpp
COMMAND $<TARGET_FILE:ui_test_cpp>
)

View File

@@ -1,67 +0,0 @@
$(VERBOSE).SILENT:
BUILD_DIR = ../../build
TEMPLATE_PROGNAME = $(BUILD_DIR)/template
C_PROGNAME = $(BUILD_DIR)/ui_test_ansic
CPP_PROGNAME = $(BUILD_DIR)/ui_test_cpp
CC = gcc
CC += -c
CPP = g++
CPP += -c
LD = g++
GTEST_OBJS = $(BUILD_DIR)/gtest-all.o $(BUILD_DIR)/gtest-main.o
C_OBJFILES = $(BUILD_DIR)/UI_test_ansic.o $(BUILD_DIR)/UI.o
TEMPLATE_OBJFILES = $(BUILD_DIR)/test_suite_template.o
CPP_OBJFILES = $(BUILD_DIR)/UI_test_cpp.o $(BUILD_DIR)/UI.o $(GTEST_OBJS)
CPP_LIBS = -lpthread
all: $(C_PROGNAME) $(CPP_PROGNAME) $(TEMPLATE_PROGNAME)
.PHONY: clean
clean:
@echo "Cleaning object files"
@echo " rm -f $(BUILD_DIR)/*.o"
rm -f $(BUILD_DIR)/*.o
@echo "Cleaning backups"
@echo " rm -f *~"
rm -f *~
@echo "Removing programs"
@echo " rm -f "$(C_PROGNAME)
rm -f $(C_PROGNAME)
@echo " rm -f "$(CPP_PROGNAME) $(TEMPLATE_PROGNAME)
rm -f $(CPP_PROGNAME) $(TEMPLATE_PROGNAME)
$(BUILD_DIR)/%.o: %.c
@echo "Compiling "$@
@echo " CC "$<
$(CC) -o $@ $<
$(BUILD_DIR)/%.o: %.cpp
@echo "Compiling "$@
@echo " CPP "$<
$(CPP) -DGTEST_USE_OWN_TR1_TUPLE=1 -I../.. -o $@ $<
$(TEMPLATE_PROGNAME): $(TEMPLATE_OBJFILES)
@echo "Linking "$@
@echo " LD -o "ctemplate" "$(TEMPLATE_OBJFILES)
$(LD) -o $(TEMPLATE_PROGNAME) $(TEMPLATE_OBJFILES)
$(C_PROGNAME): $(C_OBJFILES)
@echo "Linking "$@
@echo " LD -o "$(C_PROGNAME)" "$(C_OBJFILES)
$(LD) -o $(C_PROGNAME) $(C_OBJFILES)
$(CPP_PROGNAME): $(CPP_OBJFILES) $(C_OBJFILES)
@echo "Linking "$@
@echo " LD -o "$(CPP_PROGNAME)" "$(CPP_OBJFILES)
$(LD) -o $(CPP_PROGNAME) $(CPP_OBJFILES) $(CPP_LIBS)
nothing:
@echo "Nothing to do; quitting :("
@echo "HINT: Try make all"

View File

@@ -1,5 +1,5 @@
#include "UI.h"
#include "../../fff.h"
#include "fff.h"
#include "SYSTEM.h"
#include "DISPLAY.h"

View File

@@ -6,7 +6,7 @@ extern "C"{
#include <gtest/gtest.h>
#include "../../fff.h"
#include "fff.h"
DEFINE_FFF_GLOBALS;
/* SYSTEM.h */

View File

@@ -1,34 +0,0 @@
#include "../../test/c_test_framework.h"
/* Initialializers called for every test */
void setup()
{
}
/* Tests go here */
TEST_F(GreeterTests, hello_world)
{
assert(1 == 0);
}
int main()
{
setbuf(stderr, NULL);
fprintf(stdout, "-------------\n");
fprintf(stdout, "Running Tests\n");
fprintf(stdout, "-------------\n\n");
fflush(0);
/* Run tests */
RUN_TEST(GreeterTests, hello_world);
printf("\n-------------\n");
printf("Complete\n");
printf("-------------\n\n");
return 0;
}

View File

@@ -0,0 +1,54 @@
# Copyright 2022 Google LLC
# SPDX-License-Identifier: Apache-2.0
# Skip these tests for Windows
if(WIN32)
message(STATUS "Weak linking requires __attribute__((weak)) which isn't supported on MS VS, skipping tests")
return()
endif()
# Set the global FFF_GCC_FUNCTION_ATTRIBUTES for config.h
set(FFF_GCC_FUNCTION_ATTRIBUTES "__attribute__((weak))")
configure_file(config/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
# Create a libfakes static library that will be used in the executables below.
# This library will depend on the above generated config.h which will add the
# FFF 'weak' function attributes.
add_library(libfakes STATIC
test/src/bus.fake.c
test/src/display.fake.c
test/src/error.fake.c
test/src/sensor.fake.c
test/src/test_common.c
)
target_precompile_headers(libfakes PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/config.h)
target_include_directories(libfakes PUBLIC include test/include)
target_link_libraries(libfakes PUBLIC fff)
# Create the main test binary
add_executable(test_main src/main.c test/src/main.test.c)
target_link_libraries(test_main PRIVATE libfakes)
# Create the sensor test binary
add_executable(test_sensor src/sensor.c test/src/sensor.test.c)
target_link_libraries(test_sensor PRIVATE libfakes)
# Create the display test binary
add_executable(test_display src/display.c test/src/display.test.c ${LIBFAKES_SRCS})
target_link_libraries(test_display PRIVATE libfakes)
# Add tests to ctest
add_test(
NAME test_main
COMMAND $<TARGET_FILE:test_main>
)
add_test(
NAME test_sensor
COMMAND $<TARGET_FILE:test_sensor>
)
add_test(
NAME test_display
COMMAND $<TARGET_FILE:test_display>
)

View File

@@ -1,39 +0,0 @@
BUILD_DIR = ../../build
INCLUDE_DIRS = -I "../../" -I "./src/"
BUILD_DIR_FAKE = $(BUILD_DIR)/weak_linking
CC = gcc
WEAK_FLAGS=-Wall -DFFF_GCC_FUNCTION_ATTRIBUTES="__attribute__((weak))"
$(BUILD_DIR_FAKE)/%.o: test/%.c
@echo "Compiling "$@
$(CC) $(WEAK_FLAGS) $(INCLUDE_DIRS) -g -O0 -c $< -o $@
FAKE_OBJECTS = $(BUILD_DIR_FAKE)/display.fake.o $(BUILD_DIR_FAKE)/sensor.fake.o $(BUILD_DIR_FAKE)/sensor.fake.o $(BUILD_DIR_FAKE)/error.fake.o $(BUILD_DIR_FAKE)/bus.fake.o $(BUILD_DIR_FAKE)/test_common.o
TEST_BINARIES = $(BUILD_DIR_FAKE)/test_main $(BUILD_DIR_FAKE)/test_display $(BUILD_DIR_FAKE)/test_sensor
mkdir:
mkdir -p $(BUILD_DIR_FAKE)/
clean:
rm -rf $(BUILD_DIR_FAKE)/
$(BUILD_DIR_FAKE)/libfakes.a: $(FAKE_OBJECTS)
ar r $@ $^
# First case where we need __weak__ linking:
# - If we have the build objects (for some reason) in order where the fake object comes first.
$(BUILD_DIR_FAKE)/test_display: ./test/display.test.c $(BUILD_DIR_FAKE)/libfakes.a ./src/display.c
$(CC) $(WEAK_FLAGS) $(INCLUDE_DIRS) -o $@ $^
# Second case where we need weak linking:
# - If we use an object from the fake object -> gcc linker will include it.
$(BUILD_DIR_FAKE)/test_sensor: ./test/sensor.test.c ./src/sensor.c $(BUILD_DIR_FAKE)/libfakes.a
$(CC) $(WEAK_FLAGS) $(INCLUDE_DIRS) -o $@ $^
# Third case where we need weak linking:
# - We want to fake one function but not all.
$(BUILD_DIR_FAKE)/test_main: ./test/main.test.c ./src/main.c $(BUILD_DIR_FAKE)/libfakes.a
$(CC) $(WEAK_FLAGS) $(INCLUDE_DIRS) -o $@ $^
all: mkdir $(TEST_BINARIES)

View File

@@ -0,0 +1,5 @@
/* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
#cmakedefine FFF_GCC_FUNCTION_ATTRIBUTES @FFF_GCC_FUNCTION_ATTRIBUTES@

View File

@@ -22,12 +22,12 @@ void init_tests()
{
memset( GLOBAL_TEST_bus_read_ret, 0x00, sizeof(GLOBAL_TEST_bus_read_ret));
FFF_RESET_HISTORY();
RESET_FAKE(bus_read_write);
RESET_FAKE(bus_write);
RESET_FAKE(runtime_error);
runtime_error_fake.custom_fake = spoof_runtime_error;
bus_read_write_fake.custom_fake = spoof_bus_read_write;
bus_write_fake.return_val = true;
}
}

View File

@@ -8,6 +8,10 @@ $MAX_ARGS = 20
$DEFAULT_ARG_HISTORY = 50
$MAX_CALL_HISTORY = 50
def license
File.foreach("#{__dir__}/LICENSE") { |line| putd line }
end
def include_dependencies
putd "#include <stdarg.h>"
putd "#include <string.h> /* For memset and memcpy */"
@@ -479,7 +483,14 @@ def output_function_body(arg_count, has_varargs, is_value_function)
putd_backslash "}"
}
putd_backslash "}"
putd_backslash "if (FUNCNAME##_fake.custom_fake) #{return_type}FUNCNAME##_fake.custom_fake(#{arg_list(arg_count)});"
putd_backslash "if (FUNCNAME##_fake.custom_fake){ "
indent {
putd_backslash "RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(#{arg_list(arg_count)});" unless not is_value_function
putd_backslash "SAVE_RET_HISTORY(FUNCNAME, ret);" unless not is_value_function
putd_backslash "return ret;" unless not is_value_function
putd_backslash "#{return_type}FUNCNAME##_fake.custom_fake(#{arg_list(arg_count)});"
}
putd_backslash "}"
end
putd_backslash "RETURN_FAKE_RESULT(FUNCNAME)" if is_value_function
@@ -629,6 +640,7 @@ def output_macro_counting_shortcuts(has_calling_conventions)
end
def output_c_and_cpp(has_calling_conventions)
license
include_guard {
include_dependencies
output_constants

231
fff.h
View File

@@ -173,7 +173,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -214,7 +216,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -258,7 +262,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -305,7 +311,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -355,7 +363,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -408,7 +418,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -464,7 +476,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -523,7 +537,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -585,7 +601,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -650,7 +668,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -718,7 +738,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -789,7 +811,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -863,7 +887,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -940,7 +966,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1020,7 +1048,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1103,7 +1133,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1189,7 +1221,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1278,7 +1312,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1370,7 +1406,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1465,7 +1503,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1563,7 +1603,9 @@ FFF_END_EXTERN_C
FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \
} \
} \
if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \
if (FUNCNAME##_fake.custom_fake){ \
FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \
} \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1608,7 +1650,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1657,7 +1704,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1709,7 +1761,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1764,7 +1821,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1822,7 +1884,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1883,7 +1950,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -1947,7 +2019,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2014,7 +2091,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2084,7 +2166,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2157,7 +2244,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2233,7 +2325,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2312,7 +2409,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2394,7 +2496,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2479,7 +2586,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2567,7 +2679,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2658,7 +2775,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2752,7 +2874,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2849,7 +2976,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -2949,7 +3081,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -3052,7 +3189,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \
@@ -3158,7 +3300,12 @@ FFF_END_EXTERN_C
return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \
} \
} \
if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \
if (FUNCNAME##_fake.custom_fake){ \
RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \
SAVE_RET_HISTORY(FUNCNAME, ret); \
return ret; \
return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \
} \
RETURN_FAKE_RESULT(FUNCNAME) \
} \
DEFINE_RESET_FUNCTION(FUNCNAME) \

12
gtest/CMakeLists.txt Normal file
View File

@@ -0,0 +1,12 @@
# Copyright 2022 Google LLC
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
find_package(Threads REQUIRED)
set(CMAKE_EXE_LINKER_FLAGS " -static")
# Create the gtest library
add_library(gtest src/gtest-all.cc src/gtest-main.cc)
target_include_directories(gtest PUBLIC include include/gtest)
target_link_libraries(gtest PRIVATE Threads::Threads -static-libstdc++)

View File

@@ -1,22 +0,0 @@
BUILD_DIR = ../build
LIBS := -lpthread
CPP_OBJS=$(BUILD_DIR)/gtest-all.o $(BUILD_DIR)/gtest-main.o
SOURCES=gtest-all.cc gtest-main.cc
# Each subdirectory must supply rules for building sources it contributes
$(BUILD_DIR)/%.o: %.cc
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
g++ -I../ -O0 -g3 -Wall -DGTEST_USE_OWN_TR1_TUPLE=1 -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
all: $(CPP_OBJS)
clean:
-$(RM) $(CPP_OBJS)
-@echo ' '

View File

@@ -1554,11 +1554,29 @@ inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
// <tr1/functional>. Hence the following #define is a hack to prevent
// <tr1/functional> from being included.
# define _TR1_FUNCTIONAL 1
# include <tr1/tuple>
# include <tuple>
namespace std {
namespace tr1 {
using ::std::get;
using ::std::make_tuple;
using ::std::tuple;
using ::std::tuple_element;
using ::std::tuple_size;
}
}
# undef _TR1_FUNCTIONAL // Allows the user to #include
// <tr1/functional> if he chooses to.
# else
# include <tr1/tuple> // NOLINT
# include <tuple> // NOLINT
namespace std {
namespace tr1 {
using ::std::get;
using ::std::make_tuple;
using ::std::tuple;
using ::std::tuple_element;
using ::std::tuple_size;
}
}
# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
# else

56
test/CMakeLists.txt Normal file
View File

@@ -0,0 +1,56 @@
# Copyright 2022 Google LLC
# SPDX-License-Identifier: Apache-2.0
# Create a list of common files needed for tests
set(
COMMON_FILE_LIST
c_test_framework.h
test_cases.include
)
# Create the C test executable
add_executable(c_test fff_test_c.c ${COMMON_FILE_LIST})
target_link_libraries(c_test PRIVATE fff)
# Create the C++ test executable
add_executable(cpp_test fff_test_cpp.cpp ${COMMON_FILE_LIST})
target_link_libraries(cpp_test PRIVATE gtest fff)
# Create the C global test executable
add_executable(c_global_test
fff_test_global_c.c
global_fakes.c
global_fakes.h
${COMMON_FILE_LIST}
)
target_link_libraries(c_global_test PRIVATE fff)
# Create the C++ global test executable
add_executable(cpp_global_test
fff_test_global_cpp.cpp
global_fakes.c
global_fakes.h
${COMMON_FILE_LIST}
)
target_link_libraries(cpp_global_test PRIVATE gtest fff)
# Add the tests for ctest
add_test(
NAME c_test
COMMAND $<TARGET_FILE:c_test>
)
add_test(
NAME cpp_test
COMMAND $<TARGET_FILE:cpp_test>
)
add_test(
NAME c_global_test
COMMAND $<TARGET_FILE:c_global_test>
)
add_test(
NAME cpp_global_test
COMMAND $<TARGET_FILE:cpp_global_test>
)

View File

@@ -1,81 +0,0 @@
BUILD_DIR = ../build
FFF_TEST_CPP_OBJS += \
$(BUILD_DIR)/fff_test_cpp.o \
$(BUILD_DIR)/gtest-all.o \
$(BUILD_DIR)/gtest-main.o
FFF_TEST_GLOBAL_CPP_OBJS += \
$(BUILD_DIR)/fff_test_global_cpp.o \
$(BUILD_DIR)/global_fakes.o \
$(BUILD_DIR)/gtest-all.o \
$(BUILD_DIR)/gtest-main.o
FFF_TEST_C_OBJS = $(BUILD_DIR)/fff_test_c.o
FFF_TEST_GLOBAL_C_OBJS += \
$(BUILD_DIR)/global_fakes.o \
$(BUILD_DIR)/fff_test_global_c.o
FFF_TEST_CPP_TARGET = $(BUILD_DIR)/fff_test_cpp
FFF_TEST_C_TARGET = $(BUILD_DIR)/fff_test_c
FFF_TEST_GLOBAL_C_TARGET = $(BUILD_DIR)/fff_test_glob_c
FFF_TEST_GLOBAL_CPP_TARGET = $(BUILD_DIR)/fff_test_glob_cpp
LIBS := -lpthread
# All Target
all: $(FFF_TEST_CPP_TARGET) $(FFF_TEST_C_TARGET) $(FFF_TEST_GLOBAL_C_TARGET) $(FFF_TEST_GLOBAL_CPP_TARGET)
# Each subdirectory must supply rules for building sources it contributes
$(BUILD_DIR)/%.o: %.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
g++ -I../ -O0 -g3 -Wall -DGTEST_USE_OWN_TR1_TUPLE=1 -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
$(BUILD_DIR)/%.o: %.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
gcc -I../ -O0 -g3 -Wall -std=c99 -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
# Link targets
$(FFF_TEST_CPP_TARGET): $(FFF_TEST_CPP_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
g++ -o "$(FFF_TEST_CPP_TARGET)" $(FFF_TEST_CPP_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
$(FFF_TEST_C_TARGET): $(FFF_TEST_C_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C Linker'
gcc -o "$(FFF_TEST_C_TARGET)" $(FFF_TEST_C_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
$(FFF_TEST_GLOBAL_C_TARGET): $(FFF_TEST_GLOBAL_C_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
gcc -o "$(FFF_TEST_GLOBAL_C_TARGET)" $(FFF_TEST_GLOBAL_C_OBJS) $(LIBS) $(WRAP_LDFLAGS)
@echo 'Finished building target: $@'
@echo ' '
$(FFF_TEST_GLOBAL_CPP_TARGET): $(FFF_TEST_GLOBAL_CPP_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker'
g++ -o "$(FFF_TEST_GLOBAL_CPP_TARGET)" $(FFF_TEST_GLOBAL_CPP_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(FFF_TEST_CPP_OBJS) $(FFF_TEST_GLOBAL_C_OBJS) $(FFF_TEST_C_OBJS) \
$(FFF_TEST_CPP_TARGET) $(FFF_TEST_C_TARGET) $(FFF_TEST_GLOBAL_CPP_TARGET) $(FFF_TEST_GLOBAL_C_TARGET)
-@echo ' '

View File

@@ -6,7 +6,7 @@
#define OVERRIDE_CALL_HIST_LEN 17u
#define FFF_CALL_HISTORY_LEN OVERRIDE_CALL_HIST_LEN
#include "../fff.h"
#include "fff.h"
#include "c_test_framework.h"
#include <assert.h>

View File

@@ -12,7 +12,7 @@
#define OVERRIDE_CALL_HIST_LEN 17u
#define FFF_CALL_HISTORY_LEN OVERRIDE_CALL_HIST_LEN
#include "../fff.h"
#include "fff.h"
#include <gtest/gtest.h>
DEFINE_FFF_GLOBALS

View File

@@ -1,7 +1,7 @@
#ifndef GLOBAL_FAKES_H_
#define GLOBAL_FAKES_H_
#include "../fff.h"
#include "fff.h"
#include "string.h"

View File

@@ -1,140 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{CDBC5A3A-59B8-4638-B818-935395302DAF}</ProjectGuid>
<RootNamespace>fff2</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<ProjectName>fff</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<PreBuildEvent>
<Command>del $(SolutionDir)..\..\fff.h
ruby.exe $(SolutionDir)..\..\fakegen.rb -wcc &gt; $(SolutionDir)..\..\fff.h</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<PreBuildEvent>
<Command>del $(SolutionDir)..\..\fff.h
ruby.exe $(SolutionDir)..\..\fakegen.rb -wcc &gt; $(SolutionDir)..\..\fff.h</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>del $(SolutionDir)..\..\fff.h
ruby.exe $(SolutionDir)..\..\fakegen.rb -wcc &gt; $(SolutionDir)..\..\fff.h</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>del $(SolutionDir)..\..\fff.h
ruby.exe $(SolutionDir)..\..\fakegen.rb -wcc &gt; $(SolutionDir)..\..\fff.h</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fff.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fff.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,163 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{792FDC07-43A6-42BB-ABD5-18BA1A8B17E7}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>gtest</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\gtest\gtest-all.cc" />
<ClCompile Include="..\..\..\gtest\gtest-main.cc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\gtest\gtest.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\gtest\gtest-all.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gtest\gtest-main.cc">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\gtest\gtest.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,93 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ms_vc_fff_test_c", "ms_vc_fff_test_c\ms_vc_fff_test_c.vcxproj", "{B7658726-71D3-48B3-8BD2-6D383A60DC8E}"
ProjectSection(ProjectDependencies) = postProject
{CDBC5A3A-59B8-4638-B818-935395302DAF} = {CDBC5A3A-59B8-4638-B818-935395302DAF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "gtest\gtest.vcxproj", "{792FDC07-43A6-42BB-ABD5-18BA1A8B17E7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ms_vc_fff_test_cpp", "ms_vc_fff_test_cpp\ms_vc_fff_test_cpp.vcxproj", "{00EE1499-1C86-4F7B-8A00-9EBE696D0142}"
ProjectSection(ProjectDependencies) = postProject
{CDBC5A3A-59B8-4638-B818-935395302DAF} = {CDBC5A3A-59B8-4638-B818-935395302DAF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ms_vc_fff_test_global_cpp", "ms_vc_fff_test_global_cpp\ms_vc_fff_test_global_cpp.vcxproj", "{4384428B-E0FE-404D-A6EB-8CD9A3C88E5C}"
ProjectSection(ProjectDependencies) = postProject
{CDBC5A3A-59B8-4638-B818-935395302DAF} = {CDBC5A3A-59B8-4638-B818-935395302DAF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ms_vc_fff_test_global_c", "ms_vc_fff_test_global_c\ms_vc_fff_test_global_c.vcxproj", "{0F70375A-2C80-4B07-9EA0-A64E9679B0C7}"
ProjectSection(ProjectDependencies) = postProject
{CDBC5A3A-59B8-4638-B818-935395302DAF} = {CDBC5A3A-59B8-4638-B818-935395302DAF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fff", "fff\fff.vcxproj", "{CDBC5A3A-59B8-4638-B818-935395302DAF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B7658726-71D3-48B3-8BD2-6D383A60DC8E}.Debug|x64.ActiveCfg = Debug|x64
{B7658726-71D3-48B3-8BD2-6D383A60DC8E}.Debug|x64.Build.0 = Debug|x64
{B7658726-71D3-48B3-8BD2-6D383A60DC8E}.Debug|x86.ActiveCfg = Debug|Win32
{B7658726-71D3-48B3-8BD2-6D383A60DC8E}.Debug|x86.Build.0 = Debug|Win32
{B7658726-71D3-48B3-8BD2-6D383A60DC8E}.Release|x64.ActiveCfg = Release|x64
{B7658726-71D3-48B3-8BD2-6D383A60DC8E}.Release|x64.Build.0 = Release|x64
{B7658726-71D3-48B3-8BD2-6D383A60DC8E}.Release|x86.ActiveCfg = Release|Win32
{B7658726-71D3-48B3-8BD2-6D383A60DC8E}.Release|x86.Build.0 = Release|Win32
{792FDC07-43A6-42BB-ABD5-18BA1A8B17E7}.Debug|x64.ActiveCfg = Debug|x64
{792FDC07-43A6-42BB-ABD5-18BA1A8B17E7}.Debug|x64.Build.0 = Debug|x64
{792FDC07-43A6-42BB-ABD5-18BA1A8B17E7}.Debug|x86.ActiveCfg = Debug|Win32
{792FDC07-43A6-42BB-ABD5-18BA1A8B17E7}.Debug|x86.Build.0 = Debug|Win32
{792FDC07-43A6-42BB-ABD5-18BA1A8B17E7}.Release|x64.ActiveCfg = Release|x64
{792FDC07-43A6-42BB-ABD5-18BA1A8B17E7}.Release|x64.Build.0 = Release|x64
{792FDC07-43A6-42BB-ABD5-18BA1A8B17E7}.Release|x86.ActiveCfg = Release|Win32
{792FDC07-43A6-42BB-ABD5-18BA1A8B17E7}.Release|x86.Build.0 = Release|Win32
{00EE1499-1C86-4F7B-8A00-9EBE696D0142}.Debug|x64.ActiveCfg = Debug|x64
{00EE1499-1C86-4F7B-8A00-9EBE696D0142}.Debug|x64.Build.0 = Debug|x64
{00EE1499-1C86-4F7B-8A00-9EBE696D0142}.Debug|x86.ActiveCfg = Debug|Win32
{00EE1499-1C86-4F7B-8A00-9EBE696D0142}.Debug|x86.Build.0 = Debug|Win32
{00EE1499-1C86-4F7B-8A00-9EBE696D0142}.Release|x64.ActiveCfg = Release|x64
{00EE1499-1C86-4F7B-8A00-9EBE696D0142}.Release|x64.Build.0 = Release|x64
{00EE1499-1C86-4F7B-8A00-9EBE696D0142}.Release|x86.ActiveCfg = Release|Win32
{00EE1499-1C86-4F7B-8A00-9EBE696D0142}.Release|x86.Build.0 = Release|Win32
{4384428B-E0FE-404D-A6EB-8CD9A3C88E5C}.Debug|x64.ActiveCfg = Debug|x64
{4384428B-E0FE-404D-A6EB-8CD9A3C88E5C}.Debug|x64.Build.0 = Debug|x64
{4384428B-E0FE-404D-A6EB-8CD9A3C88E5C}.Debug|x86.ActiveCfg = Debug|Win32
{4384428B-E0FE-404D-A6EB-8CD9A3C88E5C}.Debug|x86.Build.0 = Debug|Win32
{4384428B-E0FE-404D-A6EB-8CD9A3C88E5C}.Release|x64.ActiveCfg = Release|x64
{4384428B-E0FE-404D-A6EB-8CD9A3C88E5C}.Release|x64.Build.0 = Release|x64
{4384428B-E0FE-404D-A6EB-8CD9A3C88E5C}.Release|x86.ActiveCfg = Release|Win32
{4384428B-E0FE-404D-A6EB-8CD9A3C88E5C}.Release|x86.Build.0 = Release|Win32
{0F70375A-2C80-4B07-9EA0-A64E9679B0C7}.Debug|x64.ActiveCfg = Debug|x64
{0F70375A-2C80-4B07-9EA0-A64E9679B0C7}.Debug|x64.Build.0 = Debug|x64
{0F70375A-2C80-4B07-9EA0-A64E9679B0C7}.Debug|x86.ActiveCfg = Debug|Win32
{0F70375A-2C80-4B07-9EA0-A64E9679B0C7}.Debug|x86.Build.0 = Debug|Win32
{0F70375A-2C80-4B07-9EA0-A64E9679B0C7}.Release|x64.ActiveCfg = Release|x64
{0F70375A-2C80-4B07-9EA0-A64E9679B0C7}.Release|x64.Build.0 = Release|x64
{0F70375A-2C80-4B07-9EA0-A64E9679B0C7}.Release|x86.ActiveCfg = Release|Win32
{0F70375A-2C80-4B07-9EA0-A64E9679B0C7}.Release|x86.Build.0 = Release|Win32
{CDBC5A3A-59B8-4638-B818-935395302DAF}.Debug|x64.ActiveCfg = Debug|x64
{CDBC5A3A-59B8-4638-B818-935395302DAF}.Debug|x64.Build.0 = Debug|x64
{CDBC5A3A-59B8-4638-B818-935395302DAF}.Debug|x86.ActiveCfg = Debug|Win32
{CDBC5A3A-59B8-4638-B818-935395302DAF}.Debug|x86.Build.0 = Debug|Win32
{CDBC5A3A-59B8-4638-B818-935395302DAF}.Release|x64.ActiveCfg = Release|x64
{CDBC5A3A-59B8-4638-B818-935395302DAF}.Release|x64.Build.0 = Release|x64
{CDBC5A3A-59B8-4638-B818-935395302DAF}.Release|x86.ActiveCfg = Release|Win32
{CDBC5A3A-59B8-4638-B818-935395302DAF}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9DEDA619-1153-4BD1-B292-069D4954391E}
EndGlobalSection
EndGlobal

View File

@@ -1,150 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\fff_test_c.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fff.h" />
<ClInclude Include="..\..\c_test_framework.h" />
</ItemGroup>
<PropertyGroup>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{B7658726-71D3-48B3-8BD2-6D383A60DC8E}</ProjectGuid>
<RootNamespace>msvcffftest</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<ProjectName>ms_vc_fff_test_c</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;._MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;._MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;._MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;._MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\fff_test_c.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\c_test_framework.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\fff.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,154 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{00EE1499-1C86-4F7B-8A00-9EBE696D0142}</ProjectGuid>
<RootNamespace>msvcffftestcpp</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\gtest\gtest-main.cc" />
<ClCompile Include="..\..\fff_test_cpp.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\gtest\gtest.vcxproj">
<Project>{792fdc07-43a6-42bb-abd5-18ba1a8b17e7}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fff.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\fff_test_cpp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gtest\gtest-main.cc">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fff.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,147 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{0F70375A-2C80-4B07-9EA0-A64E9679B0C7}</ProjectGuid>
<RootNamespace>msvcffftestglobalc</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\fff_test_global_c.c" />
<ClCompile Include="..\..\global_fakes.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fff.h" />
<ClInclude Include="..\..\c_test_framework.h" />
<ClInclude Include="..\..\global_fakes.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\fff_test_global_c.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\global_fakes.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\global_fakes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\c_test_framework.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\fff.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,149 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{4384428B-E0FE-404D-A6EB-8CD9A3C88E5C}</ProjectGuid>
<RootNamespace>msvcffftestglobalcpp</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(SolutionDir)..\..\gtest;$(SolutionDir)..\..\;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;TEST_WITH_CALLING_CONVENTIONS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\gtest\gtest.vcxproj">
<Project>{792fdc07-43a6-42bb-abd5-18ba1a8b17e7}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\gtest\gtest-main.cc" />
<ClCompile Include="..\..\fff_test_global_cpp.cpp" />
<ClCompile Include="..\..\global_fakes.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\fff.h" />
<ClInclude Include="..\..\global_fakes.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\fff_test_global_cpp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gtest\gtest-main.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\global_fakes.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\global_fakes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\fff.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -347,6 +347,13 @@ long my_custom_value_fake(void)
{
return MEANING_OF_LIFE;
}
long my_custom_value_fake2(void)
{
static long val = 0;
return val++;
}
TEST_F(FFFTestSuite, when_value_custom_fake_called_THEN_it_returns_custom_return_value)
{
longfunc0_fake.custom_fake = my_custom_value_fake;
@@ -354,6 +361,18 @@ TEST_F(FFFTestSuite, when_value_custom_fake_called_THEN_it_returns_custom_return
ASSERT_EQ(MEANING_OF_LIFE, retval);
}
TEST_F(FFFTestSuite, return_values_from_custom_fake_saved_in_history)
{
longfunc0_fake.custom_fake = my_custom_value_fake2;
longfunc0();
longfunc0();
longfunc0();
ASSERT_EQ(0, longfunc0_fake.return_val_history[0]);
ASSERT_EQ(1, longfunc0_fake.return_val_history[1]);
ASSERT_EQ(2, longfunc0_fake.return_val_history[2]);
}
int valuefunc3var_custom_fake1(const char *str, int a, va_list vl)
{
int arg;