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.
|
|
|
|
|
2019-06-21 18:15:22 +00:00
|
|
|
include $(dir $(lastword $(MAKEFILE_LIST)))../../../../share/trick/makefiles/Makefile.common
|
2015-02-26 15:02:31 +00:00
|
|
|
|
2022-11-15 15:16:08 +00:00
|
|
|
COVERAGE_FLAGS += -fprofile-arcs -ftest-coverage -O0
|
|
|
|
|
2015-02-26 15:02:31 +00:00
|
|
|
# Flags passed to the preprocessor.
|
2023-02-07 21:35:22 +00:00
|
|
|
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_TEST_FLAGS}
|
2015-02-26 15:02:31 +00:00
|
|
|
|
2024-03-28 20:15:19 +00:00
|
|
|
TRICK_LIBS = -L ${TRICK_LIB_DIR} -ltrick_mm -ltrick_units -ltrick -ltrick_pyip -ltrick_connection_handlers -ltrick_comm
|
2016-07-01 16:50:06 +00:00
|
|
|
TRICK_EXEC_LINK_LIBS += -L${GTEST_HOME}/lib64 -L${GTEST_HOME}/lib -lgtest -lgtest_main
|
2022-11-15 15:16:08 +00:00
|
|
|
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
|
|
|
|
|
2015-06-22 21:11:08 +00:00
|
|
|
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
|
|
|
|
|
2022-11-15 15:16:08 +00:00
|
|
|
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 :
|
2022-11-15 15:16:08 +00:00
|
|
|
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
|
2023-02-07 21:35:22 +00:00
|
|
|
$(TRICK_CXX) $(TRICK_CPPFLAGS) -c $<
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
Executive_test : Executive_test.o
|
2019-06-18 16:00:08 +00:00
|
|
|
$(TRICK_CXX) $(TRICK_SYSTEM_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) $(TRICK_LIBS) $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
|