Skip to content

Commit

Permalink
travis: use script to run SITL tests
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes committed Nov 18, 2019
1 parent 29cd45f commit f78f064
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Expand Up @@ -136,9 +136,7 @@ script:
./build/src/unit_tests_runner;
fi
- if [[ "${BUILD_TARGET}" = "px4-sitl" ]]; then
docker run -it -v $TRAVIS_BUILD_DIR:/home/user/MAVSDK:rw ${DOCKER_REPO} cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_BACKEND=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=./install -Bbuild/debug -H.;
docker run -it -v $TRAVIS_BUILD_DIR:/home/user/MAVSDK:rw ${DOCKER_REPO} cmake --build build/debug --target install -- -j2;
docker run -it -v $TRAVIS_BUILD_DIR:/home/user/MAVSDK:rw ${DOCKER_REPO} PX4_SIM_SPEED_FACTOR=10 AUTOSTART_SITL=1 PX4_FIRMWARE_DIR=/home/user/Firmware HEADLESS=1 build/debug/src/integration_tests/integration_tests_runner --gtest_filter="SitlTest.*"';
docker run -it -v $TRAVIS_BUILD_DIR:/home/user/MAVSDK:rw ${DOCKER_REPO} tools/run-sitl-tests.sh;
fi
- if [[ "${BUILD_TARGET}" = "deb-x64" ]]; then
docker run -it -v $TRAVIS_BUILD_DIR:/home/user/MAVSDK:rw ${DOCKER_REPO} cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_BACKEND=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=./install -Bbuild/release -H.;
Expand Down
15 changes: 15 additions & 0 deletions tools/run-sitl-tests.sh
@@ -0,0 +1,15 @@
#!/usr/bin/env sh

set -e

PWD=$(pwd)

if [ -z ${PX4_FIRMWARE_DIR+x} ]; then
PX4_FIRMWARE_DIR=$PWD/../Firmware
fi

NPROCS=$(nproc --all)

cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_BACKEND=OFF -DBUILD_SHARED_LIBS=ON -Bbuild/debug -H.;
cmake --build build/debug -- -j$NPROCS;
PX4_SIM_SPEED_FACTOR=10 AUTOSTART_SITL=1 PX4_FIRMWARE_DIR=$PX4_FIRMWARE_DIR HEADLESS=1 build/debug/src/integration_tests/integration_tests_runner --gtest_filter="SitlTest.*"

0 comments on commit f78f064

Please sign in to comment.