Wednesday, July 20, 2016

CppUMock example

This is an example CppUMock test. It consists of 3 files: test_main.cpp, test.cpp and makefile.

test_main.cpp:

test.cpp:

makefile:

Output:

kuyu@castor-ub:~/dkuyu/Dropbox/practice/cpp/cpputest/ho$ make && ./a.out
g++ -g -I/usr/local/include  -c test_main.cpp
g++ -g -I/usr/local/include  -c test.cpp
g++ -g -o a.out test.o test_main.o -L/usr/local/lib -lCppUTest -lCppUTestExt
testBody: pProtocolFsm=0x189d4c0
ProtocolProcedure: Got 3
ProtocolProcedure: Got 5
ProtocolProcedure: Got 7
.
OK (1 tests, 1 ran, 3 checks, 0 ignored, 0 filtered out, 1 ms)

kuyu@castor-ub:~/dkuyu/Dropbox/practice/cpp/cpputest/ho$ 

No comments:

Post a Comment