-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
79 lines (76 loc) · 1.92 KB
/
.travis.yml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
os: linux
dist: bionic
language: c
compiler:
- gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- cmake cppcheck doxygen lcov graphviz
env:
global:
- SIMULATION=native
- ENABLE_UNIT_TESTS=true
- DEPLOY_DIR=$TRAVIS_BUILD_DIR/deploy
jobs:
- BUILDTYPE=release OMIT_DEPRECATED=true
deploy:
provider: pages
strategy: git
cleanup: false
token: $GITHUB_TOKEN
keep_history: false
local_dir: $DEPLOY_DIR
script:
- git clone https://github.com/nasa/cFS.git nasa/cFS
- ( cd nasa/cFS && git submodule init && git submodule update )
# install SBN and its modules
- ./install nasa/cFS
- cp -r test/cFS nasa/
# git SHA report
- git rev-parse HEAD
# Prep and build
- cd nasa/cFS
- make prep
- make
- make install
# Run unit tests and generate coverage results
- make test
- |
if [[ -s build/native/Testing/Temporary/LastTestsFailed.log ]]; then
echo "You must fix unit test errors before submitting a pull request"
echo ""
cat build/native/Testing/Temporary/LastTestsFailed.log
grep "\[ FAIL\]" build/native/Testing/Temporary/LastTest.log
exit -1
fi
- make lcov
- genhtml build/native/coverage_total.info --output-directory $DEPLOY_DIR/
- lcov -c -d build/native/default_cpu1/apps/sbn -o sbn.coverage
- |
pct=`lcov --summary sbn.coverage 2>&1 | grep lines | sed -e 's/.*: \([0-9]*\)\..*/\1/'`
echo "coverage is at ${pct}%"
if [[ ${pct} -lt 99 ]]
then
echo "coverage has dropped below 99%, be sure to add coverage test code (in unit-test/coverage) prior to pushing"
exit -2
else
fi
# run functional test
- ./run
- sleep 5
- echo === TO output ===
- cnt=`grep 'received from TO' to_recv.log | wc -l`
- |
if [[ ${cnt} -eq 3 ]]
then
echo 'success!'
sleep 5
else
echo "Only ${cnt} entries in to_recv.log"
sleep 5
exit 1
fi
- exit 0