|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | + |
| 4 | +if [ ${TASK} == "lint" ]; then |
| 5 | + make lint || exit -1 |
| 6 | + echo "Check documentations of c++ code..." |
| 7 | + make doc 2>log.txt |
| 8 | + (cat log.txt| grep -v ENABLE_PREPROCESSING |grep -v "unsupported tag") > logclean.txt |
| 9 | + echo "---------Error Log----------" |
| 10 | + cat logclean.txt |
| 11 | + echo "----------------------------" |
| 12 | + (cat logclean.txt|grep warning) && exit -1 |
| 13 | + (cat logclean.txt|grep error) && exit -1 |
| 14 | + exit 0 |
| 15 | +fi |
| 16 | + |
| 17 | + |
| 18 | +if [ ! ${TRAVIS_OS_NAME} == "osx" ]; then |
| 19 | + # use g++-4.8 for linux |
| 20 | + if [ ${CXX} == "g++" ]; then |
| 21 | + export CXX=g++-4.8 |
| 22 | + fi |
| 23 | +fi |
| 24 | + |
| 25 | +if [ ${TASK} == "cpp_test" ]; then |
| 26 | + make -f dmlc-core/scripts/packages.mk gtest |
| 27 | + echo "GTEST_PATH="${CACHE_PREFIX} >> config.mk |
| 28 | + make test || exit -1 |
| 29 | + for test in tests/cpp/*_test; do |
| 30 | + ./$test || exit -1 |
| 31 | + done |
| 32 | + exit 0 |
| 33 | +fi |
| 34 | + |
| 35 | +# run two test one for cython, one for ctypes |
| 36 | +if [ ${TASK} == "python_test" ]; then |
| 37 | + make clean |
| 38 | + make -j all || exit -1 |
| 39 | + if [ ${TRAVIS_OS_NAME} == "osx" ]; then |
| 40 | + python -m nose tests/python/ || exit -1 |
| 41 | + python3 -m nose tests/python/ || exit -1 |
| 42 | + else |
| 43 | + nosetests tests/python/ || exit -1 |
| 44 | + nosetests3 tests/python/ || exit -1 |
| 45 | + fi |
| 46 | + |
| 47 | + python -m nose tests/python/ || exit -1 |
| 48 | + python3 -m nose tests/python/ || exit -1 |
| 49 | + make cython || exit -1 |
| 50 | + make cython3 || exit -1 |
| 51 | + python -m nose tests/python/ || exit -1 |
| 52 | + python3 -m nose tests/python/ || exit -1 |
| 53 | + exit 0 |
| 54 | +fi |
0 commit comments