Browse Source

Add tests to travis build. Some modifications for this

merge-requests/365/head
Jørgen Lien Sellæg 10 years ago
parent
commit
00d0265508
  1. 8
      .travis.yml
  2. 2
      ci/compile.sh
  3. 5
      ci/execute.sh
  4. 18
      ci/static_analysis.sh

8
.travis.yml

@ -14,6 +14,8 @@ before_install:
- ./ci/update_travis.sh
script:
- CXX=clang++ CC=clang ./ci/compile_container.sh
- ./ci/compile_container.sh
- ./ci/static_analysis.sh
- script=compile CXX=clang++ CC=clang ./ci/execute.sh
- script=clean ./ci/execute.sh
- script=compile ./ci/execute.sh
- script=static_analysis ./ci/execute.sh
- script=compile make_command="broadwayd & make test" ./ci/execute.sh

2
ci/entrypoint.sh → ci/compile.sh

@ -1,7 +1,7 @@
#!/bin/bash
if [ "${cmake_command}" == "" ]; then
cmake_command="cmake -DCMAKE_CXX_FLAGS=\"-Werror\" .."
cmake_command="cmake -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .."
fi
if [ "${make_command}" == "" ]; then

5
ci/compile_container.sh → ci/execute.sh

@ -2,7 +2,10 @@
function linux () {
cd ci || exit
if [ "${script}" == "clean" ]; then
sudo rm ../build -rf
return 0
fi
sudo docker run -it \
-e "CXX=$CXX" \
-e "CC=$CC" \
@ -10,7 +13,7 @@ function linux () {
-e "cmake_command=$cmake_command" \
-e "distribution=$distribution" \
-v "$PWD/../:/jucipp" \
--entrypoint="/jucipp/ci/entrypoint.sh" \
--entrypoint="/jucipp/ci/${script}.sh" \
"cppit/jucipp:$distribution"
}

18
ci/static_analysis.sh

@ -1,16 +1,8 @@
#!/bin/bash
function linux () {
cd ci || exit
sudo docker run -it \
-v "${PWD}/../:/jucipp/" \
"cppit/jucipp:${distribution}" \
sh -c "cd jucipp/build && scan-build -o ../html_${distribution} --status-bugs make"
}
if [ "${make_command}" == "" ]; then
make_command="make -j 2"
fi
#TODO should do static analysis on build
function osx () {
true
}
$TRAVIS_OS_NAME
cd jucipp/build || exit
exec sh -c "scan-build -o ../html_${distribution} --status-bugs ${make_command}"

Loading…
Cancel
Save