run_test.sh 1.29 KB
Newer Older
Tianqi Chen committed
1 2
#!/bin/bash

3 4
if [ ${TASK} == "lint" ] || [ ${TASK} == "all_test" ]; then
    if [ ! ${TRAVIS_OS_NAME} == "osx" ]; then
5
        ./tests/scripts/task_lint.sh || exit -1
6
    fi
Tianqi Chen committed
7 8
fi

9
cp make/config.mk config.mk
10
echo "USE_CUDA=0" >> config.mk
11
echo "USE_RPC=1" >> config.mk
Tianqi Chen committed
12

13
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
14 15
    echo "USE_OPENCL=1" >> config.mk
    echo "USE_METAL=1" >> config.mk
16
else
Tianqi Chen committed
17 18 19 20
    # use g++-4.8 for linux
    if [ ${CXX} == "g++" ]; then
        export CXX=g++-4.8
    fi
21
    echo "USE_OPENCL=0" >> config.mk
Tianqi Chen committed
22 23
fi

24 25
if [ ${TASK} == "verilog_test" ] || [ ${TASK} == "all_test" ]; then
    if [ ! ${TRAVIS_OS_NAME} == "osx" ]; then
26
        make -f tests/scripts/packages.mk iverilog
27
        make all || exit -1
28
        ./tests/scripts/task_verilog_test.sh || exit -1
29 30 31
    fi
fi

32
if [ ${TASK} == "cpp_test" ] || [ ${TASK} == "all_test" ]; then
Tianqi Chen committed
33
    make -f dmlc-core/scripts/packages.mk gtest
34
    ./tests/scripts/task_cpp_unittest.sh || exit -1
35
    ./tests/scripts/task_cpp_topi.sh || exit -1
Tianqi Chen committed
36 37
fi

38 39
if [ ${TASK} == "python_test" ] || [ ${TASK} == "all_test" ]; then
    make all || exit -1
Tianqi Chen committed
40
    if [ ${TRAVIS_OS_NAME} == "osx" ]; then
41
        ./tests/scripts/task_python_unittest.sh || exit -1
Tianqi Chen committed
42
    else
43 44
        nosetests -v tests/python/unittest || exit -1
        nosetests3 -v tests/python/unittest || exit -1
Tianqi Chen committed
45 46
    fi
fi