Skip to content

Commit e476797

Browse files
committed
Removed the REAL_GMOCK define
1 parent 7ae2c67 commit e476797

File tree

9 files changed

+8
-32
lines changed

9 files changed

+8
-32
lines changed

Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,17 @@ cpputest_build_gtest15:
218218
check_gtest15: cpputest_build_gtest15
219219
@echo "Build using gmock 1.5";
220220
export GMOCK_HOME=`pwd`/cpputest_build_gtest15/gmock-1.5.0; \
221-
make distclean; $(srcdir)/configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 --enable-gmock; make check
221+
make distclean; $(srcdir)/configure; make check
222222

223223
check_gtest16: cpputest_build_gtest16
224224
@echo "Build using gmock 1.6";
225225
export GMOCK_HOME=`pwd`/cpputest_build_gtest16/gmock-1.6.0; \
226-
make distclean; $(srcdir)/configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 --enable-gmock; make check
226+
make distclean; $(srcdir)/configure; make check
227227

228228
check_gtest17: cpputest_build_gtest17
229229
@echo "Build using gmock 1.7"
230230
export GMOCK_HOME=`pwd`/cpputest_build_gtest17/gmock-1.7.0; \
231-
make distclean; $(srcdir)/configure --enable-gmock; make check
231+
make distclean; $(srcdir)/configure; make check
232232

233233
remove_gtest_directories:
234234
rm -rf cpputest_build_gtest15

Makefile_using_MakefileWorker

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ test_all: start test_old_make
5656
@echo Building with overridden CXXFLAGS and CFLAGS and memory leak and STDC++ disabled
5757
$(TIME) make CLFAGS="" CXXFLAGS="" CPPFLAGS="-Iinclude -DCPPUTEST_STD_CPP_LIB_DISABLED -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED"
5858
make CFLAGS="" CXXFLAGS="" CPPFLAGS="-DCPPUTEST_STD_CPP_LIB_DISABLED -DCPPUTEST_MEM_LEAK_DETECTION_DISABLED" clean
59-
@echo Building CppUTest with Google Mock
60-
$(SILENCE) if [ -z $$GMOCK_HOME ]; then \
61-
echo "******** WARNING: Can't test with CPPUTEST_USE_REAL_GMOCK because can't find Google Mock -- no GMOCK_HOME set ********"; \
62-
else $(TIME) make extensions CPPUTEST_USE_REAL_GMOCK=Y; fi
6359
@echo Building examples
6460
make cleanExamples
6561
$(TIME) make examples

build/MakefileWorker.mk

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,6 @@ ifndef CPPUTEST_USE_STD_CPP_LIB
160160
CPPUTEST_USE_STD_CPP_LIB = Y
161161
endif
162162

163-
# Use gmock
164-
ifdef CPPUTEST_USE_REAL_GMOCK
165-
CPPUTEST_USE_REAL_GMOCK = Y
166-
else
167-
CPPUTEST_USE_REAL_GMOCK = N
168-
endif
169-
170-
171163
# Use gcov, off by default
172164
ifndef CPPUTEST_USE_GCOV
173165
CPPUTEST_USE_GCOV = N
@@ -179,7 +171,6 @@ endif
179171

180172
# Default warnings
181173
ifndef CPPUTEST_WARNINGFLAGS
182-
ifeq ($(CPPUTEST_USE_REAL_GMOCK), N)
183174
CPPUTEST_WARNINGFLAGS = -Wall -Wextra -Werror -Wshadow -Wswitch-default -Wswitch-enum -Wconversion
184175
ifeq ($(CPPUTEST_PEDANTIC_ERRORS), Y)
185176
CPPUTEST_WARNINGFLAGS += -pedantic-errors
@@ -190,7 +181,6 @@ endif
190181
CPPUTEST_CXX_WARNINGFLAGS = -Woverloaded-virtual
191182
CPPUTEST_C_WARNINGFLAGS = -Wstrict-prototypes
192183
endif
193-
endif
194184

195185
#Wonderful extra compiler warnings with clang
196186
ifeq ($(COMPILER_NAME),$(CLANG_STR))
@@ -289,15 +279,13 @@ ifeq ($(CPPUTEST_USE_STD_C_LIB), Y)
289279
endif
290280
endif
291281

292-
ifeq ($(CPPUTEST_USE_REAL_GMOCK), Y)
293-
ifndef GMOCK_HOME
294-
$(error CPPUTEST_USE_REAL_GMOCK defined, but GMOCK_HOME not, so can't use real gmock! Please define GMOCK_HOME to the gmock location)
295-
endif
282+
ifdef $(GMOCK_HOME)
296283
GTEST_HOME = $(GMOCK_HOME)/gtest
297284
CPPUTEST_CPPFLAGS += -I$(GMOCK_HOME)/include
298285
GMOCK_LIBRARY = $(GMOCK_HOME)/lib/.libs/libgmock.a
299286
LD_LIBRARIES += $(GMOCK_LIBRARY)
300-
CPPUTEST_CPPFLAGS += -DCPPUTEST_USE_REAL_GMOCK
287+
CPPUTEST_CPPFLAGS += -DINCLUDE_GTEST_TESTS
288+
CPPUTEST_WARNINGFLAGS =
301289
CPPUTEST_CPPFLAGS += -I$(GTEST_HOME)/include -I$(GTEST_HOME)
302290
GTEST_LIBRARY = $(GTEST_HOME)/lib/.libs/libgtest.a
303291
LD_LIBRARIES += $(GTEST_LIBRARY)

cmake/Modules/CppUTestConfigurationOptions.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ set(GMOCK_HOME $ENV{GMOCK_HOME})
4848
if (DEFINED ENV{GMOCK_HOME})
4949

5050
# GMock pulls in gtest.
51-
set(CPPUTEST_USE_REAL_GMOCK 1)
5251
set(INCLUDE_GTEST_TESTS 1)
5352
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1")
5453
include_directories(${GMOCK_HOME}/include ${GMOCK_HOME}/gtest ${GMOCK_HOME}/gtest/include)

config.h.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#cmakedefine CPPUTEST_STD_C_LIB_DISABLED
99
#cmakedefine CPPUTEST_STD_CPP_LIB_DISABLED
1010

11-
#cmakedefine CPPUTEST_USE_REAL_GMOCK
12-
1311
#cmakedefine INCLUDE_GTEST_TESTS
1412

1513
#endif

configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ GMOCK_HOME was set, but couldn't find the compiled library.
369369
Did you compile it?
370370
-------------------------------------]);
371371
fi
372-
AC_DEFINE([CPPUTEST_USE_REAL_GMOCK], [1], [Use GMock])
373372

374373
# In Travis, do not show warnings. The GTest warnings cause a log overflow that errors the build. Nice :)
375374
if test -n "${TRAVIS_BRANCH}"; then

include/CppUTestExt/GMock.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
#ifndef GMOCK_H_
2929
#define GMOCK_H_
3030

31-
#ifdef CPPUTEST_USE_REAL_GMOCK
3231
#undef new
33-
#endif
3432

3533
#undef RUN_ALL_TESTS
3634

@@ -40,10 +38,8 @@
4038
#include "gmock/gmock.h"
4139
#undef RUN_ALL_TESTS
4240

43-
#ifdef CPPUTEST_USE_REAL_GMOCK
4441
using testing::Return;
4542
using testing::NiceMock;
46-
#endif
4743

4844
#ifdef CPPUTEST_USE_NEW_MACROS
4945
#include "CppUTest/MemoryLeakDetectorNewMacros.h"

tests/CppUTestExt/TestGMock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626
*/
2727

28-
#ifdef CPPUTEST_USE_REAL_GMOCK
28+
#ifdef INCLUDE_GTEST_TESTS
2929

3030
#include "CppUTestExt/GMock.h"
3131
#include "CppUTest/TestHarness.h"

tests/CppUTestExt/TestGTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626
*/
2727

28-
#ifdef CPPUTEST_USE_REAL_GMOCK
28+
#ifdef INCLUDE_GTEST_TESTS
2929
#undef new
3030

3131
#include "gtest/gtest.h"

0 commit comments

Comments
 (0)