-
Notifications
You must be signed in to change notification settings - Fork 2
/
EclipseLcov.sh
executable file
·30 lines (21 loc) · 1.25 KB
/
EclipseLcov.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
#!/bin/bash
OUTPUT_DIR=Build
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_DIR/Build/x86-linux/Core
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/EPICS/base-7.0-dev/lib/linux-x86_64/
#Build with coverage enabled
make -f Makefile.cov clean
make -f Makefile.cov
#Run baseline coverage
lcov --capture --initial --directory . --no-external --output-file $OUTPUT_DIR/MARTe2-components.coverage.info.initial
#Execute the tests
Test/GTest/cov/MainGTest.ex --gtest_filter=*
#Create test coverage data file
lcov --capture --directory . --no-external --output-file $OUTPUT_DIR/MARTe2-components.coverage.info.tests
#Combine baseline and test coverage data
lcov --add-tracefile $OUTPUT_DIR/MARTe2-components.coverage.info.initial --add-tracefile $OUTPUT_DIR/MARTe2-components.coverage.info.tests --output-file $OUTPUT_DIR/MARTe2-components.coverage.info.1
#Remove false positives
lcov --remove $OUTPUT_DIR/MARTe2-components.coverage.info.1 "/Test*" --output-file $OUTPUT_DIR/MARTe2-components.coverage.info.2
lcov --remove $OUTPUT_DIR/MARTe2-components.coverage.info.2 "*gtest*" --output-file $OUTPUT_DIR/MARTe2-components.coverage.info
#Generate the html
genhtml $OUTPUT_DIR/MARTe2-components.coverage.info --output-directory $OUTPUT_DIR/cov_html
make -f Makefile.cov clean_gen