X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2FMakefile;h=ed3620521338b3c58b6458480c6f018bd0f04526;hb=79451ff52d5d6420728e896f22cc2f98e4738c49;hp=b7c843b86b93bd6ef6c8899147432b88344adff4;hpb=ef3620529c936a8790d6970c57198b4caee09c0d;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/test/Makefile b/test/Makefile index b7c843b..ed36205 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,11 +1,10 @@ coverage_opts = -ftest-coverage -fprofile-arcs -binaries = unit_test +binaries = unit_test jhash_test config_test metrics_test +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 -tests:: unit_test jhash_test metrics_test - -include_list = -I ../src/metrics -I ../src/alarm -I ../src/messaging +tests:: $(binaries) # RMR emulation rmr_em.o:: rmr_em.c @@ -15,19 +14,21 @@ rmr_em.o:: rmr_em.c # emulate (and don't need to) # unit_test:: unit_test.cpp rmr_em.o - g++ -g $(coverage_opts) $(include_list) unit_test.cpp -o unit_test -L../.build -lricxfcpp rmr_em.o -lrmr_si -lpthread + 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 # build a special jwrapper object with coverage settings jwrapper_test.o:: ../src/json/jwrapper.c ../src/json/jwrapper.h - cc $(coverage_opts) -g -I ../src/json -I ../ext/jsmn ../src/json/jwrapper.c -c -o jwrapper_test.o + cc $(coverage_opts) -DDEBUG=0 -g -I ../src/json -I ../ext/jsmn ../src/json/jwrapper.c -c -o jwrapper_test.o jhash_test:: jwrapper_test.o jhash_test.cpp # do NOT link the xapp lib; we include all modules in the test programme - g++ -g $(coverage_opts) -I ../src/json -I ../ext/jsmn jhash_test.cpp -o jhash_test jwrapper_test.o -lrmr_si -lpthread + 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 metrics_test:: metrics_test.cpp rmr_em.o - # do NOT link the xapp lib; we include all modules in the test programme - g++ -g $(coverage_opts) $(include_list) metrics_test.cpp -o metrics_test -L../.build -lricxfcpp rmr_em.o -l rmr_si -lpthread + 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 + +config_test:: config_test.cpp jwrapper_test.o + 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 # prune gcov files generated by system include files clean:: @@ -37,3 +38,4 @@ clean:: nuke:: rm -f *.a *.o *.gcov *.gcda *.gcno core a.out $(binaries) +