Skip to content

Commit

Permalink
Fix nasa#346, Add functional and coverage test to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Apr 1, 2020
1 parent 15344d7 commit b614df5
Showing 1 changed file with 49 additions and 16 deletions.
65 changes: 49 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,55 @@ addons:
sources:
- ubuntu-toolchain-r-test
packages:
- cmake
- cmake cppcheck lcov

before_install:
- sudo apt-get install cppcheck
env:
global:
- OSAL_INCLUDEDIR=src/bsp/pc-linux/config/

script:
# Check versions
- cppcheck --version
functional_test: &functional_test
script:
# Check versions
- cppcheck --version

#cppcheck flight software osal/src/bsp, osal/src/os
- cppcheck --force --inline-suppr --std=c99 --language=c --error-exitcode=1 --enable=warning,performance,portability,style --suppress=variableScope --inconclusive src/bsp src/os 2>cppcheck_flight_osal.txt
- |
if [[ -s cppcheck_flight_osal.txt ]]; then
echo "You must fix cppcheck errors before submitting a pull request"
echo ""
cat cppcheck_flight_osal.txt
exit -1
fi
#cppcheck flight software osal/src/bsp, osal/src/os
- cppcheck --force --inline-suppr --std=c99 --language=c --error-exitcode=1
--enable=warning,performance,portability,style --suppress=variableScope
--inconclusive src/bsp src/os 2>cppcheck_flight_osal.txt
- |
if [[ -s cppcheck_flight_osal.txt ]]; then
echo "You must fix cppcheck errors before submitting a pull request"
echo ""
cat cppcheck_flight_osal.txt
exit -1
fi
# Setup
- mkdir build
- cd build

# Prep and build
- cmake -DENABLE_UNIT_TESTS=true -DOSAL_SYSTEM_OSTYPE=posix -DOSAL_SYSTEM_BSPTYPE=pc-linux
-DCFE_SYSTEM_PSPNAME=none ..
- make

# Test
- make test

jobs:
include:
- env: BUILDTYPE=release OSAL_OMIT_DEPRECATED=true
<<: *functional_test
- env: BUILDTYPE=release OSAL_OMIT_DEPRECATED=false
<<: *functional_test
- env: BUILDTYPE=debug OSAL_OMIT_DEPRECATED=true
<<: *functional_test
- env: BUILDTYPE=debug OSAL_OMIT_DEPRECATED=false
<<: *functional_test
- script:
- cmake -DCMAKE_BUILD_TYPE=debug -DOSALCOVERAGE_TARGET_OSTYPE='shared'
../src/unit-test-coverage/
- make
- make test
- lcov --capture --directory ./ --output-file coverage_test.info
- genhtml coverage_test.info --output-directory lcov

0 comments on commit b614df5

Please sign in to comment.