E. Scott Daniels | 4e4fb50 | 2020-03-24 12:28:06 -0400 | [diff] [blame] | 1 | |
| 2 | coverage_opts = -ftest-coverage -fprofile-arcs |
| 3 | |
E. Scott Daniels | 97204c8 | 2020-06-29 15:39:57 -0400 | [diff] [blame] | 4 | binaries = unit_test |
| 5 | |
| 6 | tests:: unit_test jhash_test |
E. Scott Daniels | 4e4fb50 | 2020-03-24 12:28:06 -0400 | [diff] [blame] | 7 | |
| 8 | # RMR emulation |
| 9 | rmr_em.o:: rmr_em.c |
| 10 | cc -g rmr_em.c -c |
| 11 | |
| 12 | unit_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 Daniels | 97204c8 | 2020-06-29 15:39:57 -0400 | [diff] [blame] | 16 | # build a special jwrapper object with coverage settings |
| 17 | jwrapper_test.o:: ../src/json/jwrapper.c ../src/json/jwrapper.h |
E. Scott Daniels | 5a9d7c6 | 2020-07-09 11:56:10 -0400 | [diff] [blame^] | 18 | cc $(coverage_opts) -g -I ../src/json -I ../ext/jsmn ../src/json/jwrapper.c -c -o jwrapper_test.o |
E. Scott Daniels | 97204c8 | 2020-06-29 15:39:57 -0400 | [diff] [blame] | 19 | |
| 20 | jhash_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 Daniels | 4e4fb50 | 2020-03-24 12:28:06 -0400 | [diff] [blame] | 24 | # prune gcov files generated by system include files |
| 25 | clean:: |
| 26 | rm -f *.h.gcov *.c.gcov |
| 27 | |
| 28 | # ditch anything that can be rebuilt |
| 29 | nuke:: |
| 30 | rm -f *.a *.o *.gcov *.gcda *.gcno core a.out $(binaries) |
| 31 | |