-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
34 lines (30 loc) · 1000 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
SRC_DIR=$(shell pwd)
BUILD_DIR=/tmp/$(shell basename ${SRC_DIR})_build
define COVERAGERC
[run]
include = *src/capabilities*
endef
export COVERAGERC
COVERAGE_BIN=${SRC_DIR}/test/run_coverage
coverage:
@echo "Using SRC_DIR: ${SRC_DIR}"
@echo "Using BUILD_DIR: ${BUILD_DIR}"
mkdir -p ${BUILD_DIR}
echo "$$COVERAGERC" > ${BUILD_DIR}/.coveragerc
@echo "Cleaning out old coverage files"
-rm ~/.ros/.coverage
-rm ${BUILD_DIR}/.coverage
-rm ./.coverage
-cd ${BUILD_DIR} && mkdir -p src
-ln -s ${SRC_DIR} ${BUILD_DIR}/src
cd ${BUILD_DIR} && catkin_make
cd ${BUILD_DIR} && catkin_make tests
cd ${BUILD_DIR} && catkin_make -j1 run_tests
catkin_test_results ${BUILD_DIR}
ls ${HOME}/.ros/.coverage
cp ${HOME}/.ros/.coverage ./.coverage.1
cd ${BUILD_DIR} && ${BUILD_DIR}/devel/env.sh nosetests --where=${SRC_DIR}/test/unit --with-coverage -s
ls ${BUILD_DIR}/.coverage
cp ${BUILD_DIR}/.coverage ./.coverage.2
${COVERAGE_BIN} combine
${COVERAGE_BIN} report --include='*capabilities/src*' -m