RIC-641 Fixing client/server model definitions and adding client and server API
[ric-plt/xapp-frame-cpp.git] / test / Makefile
1
2 coverage_opts = -ftest-coverage -fprofile-arcs
3
4 binaries = unit_test jhash_test config_test metrics_test
5 include = -I ../src/xapp -I ../src/alarm -I ../src/messaging  -I  ../src/config -I ../ext/jsmn  -I  ../src/json -I ../src/metrics  -I ../src/model -I ../src/rest-client -I ../src/rest-server
6
7 tests:: $(binaries)
8
9 # RMR emulation
10 rmr_em.o::      rmr_em.c
11         cc -g rmr_em.c -c
12
13 # include the emulated rmr stuff, but we still need the rmr lib for symtab things which we cannot hope to
14 # emulate (and don't need to)
15 #
16 unit_test:: unit_test.cpp rmr_em.o
17         g++ -g $(coverage_opts) $(include) unit_test.cpp -o unit_test -L../.build -lricxfcpp rmr_em.o  -lrmr_si -lpthread -lm -lboost_system -lcrypto -lssl -lcpprest -lpistache -lnlohmann_json_schema_validator
18
19 # build a special jwrapper object with coverage settings
20 jwrapper_test.o:: ../src/json/jwrapper.c ../src/json/jwrapper.h
21         cc $(coverage_opts)  -DDEBUG=0 -g -I  ../src/json -I ../ext/jsmn  ../src/json/jwrapper.c -c -o jwrapper_test.o
22
23 jhash_test:: jwrapper_test.o jhash_test.cpp
24         # do NOT link the xapp lib; we include all modules in the test programme
25         g++ -g $(coverage_opts) -I ../src/json -I ../ext/jsmn jhash_test.cpp -o jhash_test jwrapper_test.o -lrmr_si -lpthread -lm -lboost_system -lcrypto -lssl -lcpprest -lpistache -lnlohmann_json_schema_validator
26
27 metrics_test:: metrics_test.cpp rmr_em.o
28         g++ -g $(coverage_opts) $(include) metrics_test.cpp -o metrics_test -L../.build -lricxfcpp rmr_em.o -l rmr_si -lpthread -lm -lboost_system -lcrypto -lssl -lcpprest -lpistache -lnlohmann_json_schema_validator
29
30 config_test:: config_test.cpp jwrapper_test.o
31         g++ -g $(coverage_opts) $(include) config_test.cpp -o config_test jwrapper_test.o -lricxfcpp -lrmr_si -lpthread -lm -lboost_system -lcrypto -lssl -lcpprest -lpistache -lnlohmann_json_schema_validator
32
33 # prune gcov files generated by system include files
34 clean::
35         rm -f *.h.gcov *.c.gcov
36
37 # ditch anything that can be rebuilt
38 nuke::
39         rm -f *.a *.o *.gcov *.gcda *.gcno core a.out $(binaries)
40
41