-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautorun.sh
executable file
·32 lines (29 loc) · 1001 Bytes
/
autorun.sh
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
echo "### Building..."
mkdir -p build
cd build
cmake .. -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Coverage
find . -name "*.gcda" -print0 | xargs -0 -r rm
make -j8
[[ $? == 0 ]] || exit $?
echo "### Running tests..."
#./runUnitTests
TEST_RESULTS=./test-results
export GTEST_OUTPUT=xml:${TEST_RESULTS}/
GTEST_COLOR=1 ctest -V
echo "### Generating coverage report..."
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info 'tests/*' '/usr/*' 'test-library*' '*modules/googletest*' '*MacOS*' --output-file coverage.info &>/dev/null
lcov --list coverage.info
genhtml coverage.info --output-directory html-coverage
cd ..
# Collect test results
if [ $# -eq 0 ]; then
echo "No test report directory provided"
else
TEST_REPORT_DIR=${1}
mkdir -p ${TEST_REPORT_DIR}
echo "### Copying test results to ${TEST_REPORT_DIR}"
cp -r build/coverage.info ${TEST_REPORT_DIR}
cp -r build/html-coverage ${TEST_REPORT_DIR}
cp -r build/test-results ${TEST_REPORT_DIR}
fi