gmock stub
This commit is contained in:
parent
a560e672b9
commit
e3375443eb
0
lib/.ignore_me
Normal file
0
lib/.ignore_me
Normal file
@ -74,4 +74,27 @@ unit-tests/metadata_t: unit-tests/metadata_t.o $(OBJECTS)
|
||||
unit-tests/endian_t: unit-tests/endian_t.o $(OBJECTS)
|
||||
g++ $(CXXFLAGS) $(INCLUDES) -o $@ $+ $(LIBS) $(LIBEXPAT)
|
||||
|
||||
|
||||
#----------------------------------------------------------------
|
||||
# gmock tests
|
||||
|
||||
GMOCK_DIR=gmock-1.6.0/
|
||||
GMOCK_INCLUDES=\
|
||||
-Igmock-1.6.0/include \
|
||||
-Igmock-1.6.0/gtest/include
|
||||
|
||||
GMOCK_LIBS=\
|
||||
-Llib -lgmock -lpthread
|
||||
|
||||
lib/gmock.a:
|
||||
g++ $(GMOCK_INCLUDES) -I$(GMOCK_DIR)/gtest -c $(GMOCK_DIR)/gtest/src/gtest-all.cc
|
||||
g++ $(GMOCK_INCLUDES) -I$(GMOCK_DIR) -c $(GMOCK_DIR)/src/gmock-all.cc
|
||||
ar -rv lib/libgmock.a gtest-all.o gmock-all.o
|
||||
|
||||
unit-tests/gmock_t.o: unit-tests/gmock_t.cc
|
||||
g++ -c $(INCLUDES) $(GMOCK_INCLUDES) $(CXXFLAGS) -o $@ $<
|
||||
|
||||
unit-tests/gmock_t: unit-tests/gmock_t.o lib/gmock.a
|
||||
g++ $(CXXFLAGS) -o $@ $< $(LIBS) $(GMOCK_LIBS)
|
||||
|
||||
all: $(TEST_PROGRAMS)
|
||||
|
27
unit-tests/gmock_t.cc
Normal file
27
unit-tests/gmock_t.cc
Normal file
@ -0,0 +1,27 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
namespace {
|
||||
class MyClass {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
TEST(MyClass, can_construct)
|
||||
{
|
||||
MyClass c;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
Loading…
Reference in New Issue
Block a user