blob: 4245d3b50f228939ab3d99886420fff48e3db3ca [file] [log] [blame]
E. Scott Daniels4e4fb502020-03-24 12:28:06 -04001
2coverage_opts = -ftest-coverage -fprofile-arcs
3
E. Scott Daniels97204c82020-06-29 15:39:57 -04004binaries = unit_test
5
6tests:: unit_test jhash_test
E. Scott Daniels4e4fb502020-03-24 12:28:06 -04007
8# RMR emulation
9rmr_em.o:: rmr_em.c
10 cc -g rmr_em.c -c
11
12unit_test:: unit_test.cpp rmr_em.o
13 # do NOT link the xapp lib; we include all modules in the test programme
14 g++ -g $(coverage_opts) -I ../src/messaging unit_test.cpp -o unit_test rmr_em.o -lpthread
15
E. Scott Daniels97204c82020-06-29 15:39:57 -040016# build a special jwrapper object with coverage settings
17jwrapper_test.o:: ../src/json/jwrapper.c ../src/json/jwrapper.h
E. Scott Daniels5a9d7c62020-07-09 11:56:10 -040018 cc $(coverage_opts) -g -I ../src/json -I ../ext/jsmn ../src/json/jwrapper.c -c -o jwrapper_test.o
E. Scott Daniels97204c82020-06-29 15:39:57 -040019
20jhash_test:: jwrapper_test.o jhash_test.cpp
21 # do NOT link the xapp lib; we include all modules in the test programme
22 g++ -g $(coverage_opts) -I ../src/json -I ../ext/jsmn jhash_test.cpp -o jhash_test jwrapper_test.o -lrmr_si -lpthread
23
E. Scott Daniels4e4fb502020-03-24 12:28:06 -040024# prune gcov files generated by system include files
25clean::
26 rm -f *.h.gcov *.c.gcov
27
28# ditch anything that can be rebuilt
29nuke::
30 rm -f *.a *.o *.gcov *.gcda *.gcno core a.out $(binaries)
31