trick/trick_source/sim_services/Executive/test/Makefile

59 lines
1.9 KiB
Makefile
Raw Normal View History

2015-02-26 15:02:31 +00:00
#SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
include $(dir $(lastword $(MAKEFILE_LIST)))../../../../share/trick/makefiles/Makefile.common
2015-02-26 15:02:31 +00:00
COVERAGE_FLAGS += -fprofile-arcs -ftest-coverage -O0
2015-02-26 15:02:31 +00:00
# Flags passed to the preprocessor.
TRICK_CXXFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -std=c++11 ${TRICK_SYSTEM_CXXFLAGS}
2015-02-26 15:02:31 +00:00
TRICK_LIBS = -L ${TRICK_LIB_DIR} -ltrick_mm -ltrick_units -ltrick
TRICK_EXEC_LINK_LIBS += -L${GTEST_HOME}/lib64 -L${GTEST_HOME}/lib -lgtest -lgtest_main
TRICK_SYSTEM_LDFLAGS += ${COVERAGE_FLAGS}
2015-02-26 15:02:31 +00:00
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
TESTS = Executive_test
OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \
../../include/object_${TRICK_HOST_CPU}/io_SimObject.o
2015-02-26 15:02:31 +00:00
# House-keeping build targets.
all : $(TESTS)
test: $(TESTS)
./Executive_test --gtest_output=xml:${TRICK_HOME}/trick_test/Executive.xml
code-coverage: test
# Give rid of any old code-coverage HTML we may have.
rm -rf lcov_html
# Gather coverage information about the src code.
lcov --capture \
--directory ../object_${TRICK_HOST_CPU} \
--base-directory ../ \
--output-file src_coverage.info
# Filter out information about directories that we don't care about.
lcov --remove src_coverage.info '/Applications/*' '/usr/include/*' \
--output-file MemoryManager_code_coverage.info
# Generate HTML
genhtml MemoryManager_code_coverage.info \
--output-directory lcov_html
# Clean up
# rm *.info
2015-02-26 15:02:31 +00:00
clean :
rm -f $(TESTS) *.o *.gcda *.gcno *.info
rm -rf lcov_html
2015-02-26 15:02:31 +00:00
Executive_test.o : Executive_test.cpp
$(TRICK_CXX) $(TRICK_CXXFLAGS) -c $<
2015-02-26 15:02:31 +00:00
Executive_test : Executive_test.o
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) $(TRICK_LIBS) $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)