1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-14 00:09:01 +03:00

Travis: split build and test into separate scripts.

This commit is contained in:
Joel Martin 2015-10-09 12:13:05 -05:00
parent 1fef97e26b
commit 7755014c7b
3 changed files with 41 additions and 5 deletions

View File

@ -85,12 +85,10 @@ matrix:
# os: linux
- env: IMPL=swift
os: osx
osx_image: xcode7
# - env: IMPL=vb
# os: linux
script:
- docker pull kanaka/mal-test-${IMPL,,}
- BUILD_IMPL=${BUILD_IMPL:-${IMPL}} && docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${BUILD_IMPL,,} make -C ${BUILD_IMPL}
- docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${IMPL,,} make TEST_OPTS="--soft --log-file ../run.out" test^${IMPL}
- cat run.out
#- docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${IMPL,,} make perf^${IMPL}
- ./.travis_build.sh
- ./.travis_test.sh

20
.travis_build.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -ex
case ${TRAVIS_OS_NAME} in
linux)
BUILD_IMPL=${BUILD_IMPL:-${IMPL}}
impl=$(echo "${IMPL}" | tr '[:upper:]' '[:lower:]')
build_impl=$(echo "${BUILD_IMPL}" | tr '[:upper:]' '[:lower:]')
docker pull kanaka/mal-test-${impl}
if [ "${impl}" != "${build_impl}" ]; then
docker pull kanaka/mal-test-${build_impl}
fi
docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${build_impl} make -C ${BUILD_IMPL}
;;
osx)
make -C ${IMPL}
;;
esac

18
.travis_test.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -ex
case ${TRAVIS_OS_NAME} in
linux)
impl=$(echo "${IMPL}" | tr '[:upper:]' '[:lower:]')
docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${impl} make TEST_OPTS="--soft --log-file ../test.out" test^${IMPL}
#docker run -it -u $(id -u) -v `pwd`:/mal kanaka/mal-test-${IMPL,,} make perf^${IMPL}
;;
osx)
make TEST_OPTS="--soft --log-file ../test.out" test^${IMPL}
#make TEST_OPTS="--soft --log-file ../perf" perf^${IMPL}
;;
esac
cat test.out
#cat perf.out