run_test.sh 2.01 KB
Newer Older
Tianqi Chen committed
1
#!/bin/bash
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
# 
#   http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
Tianqi Chen committed
18

19 20
if [ ${TASK} == "lint" ] || [ ${TASK} == "all_test" ]; then
    if [ ! ${TRAVIS_OS_NAME} == "osx" ]; then
21
        ./tests/scripts/task_lint.sh || exit -1
22
    fi
Tianqi Chen committed
23 24
fi

25
cp make/config.mk config.mk
26
echo "USE_CUDA=0" >> config.mk
27
echo "USE_RPC=1" >> config.mk
Tianqi Chen committed
28

29
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
30 31
    echo "USE_OPENCL=1" >> config.mk
    echo "USE_METAL=1" >> config.mk
32
else
Tianqi Chen committed
33 34 35 36
    # use g++-4.8 for linux
    if [ ${CXX} == "g++" ]; then
        export CXX=g++-4.8
    fi
37
    echo "USE_OPENCL=0" >> config.mk
Tianqi Chen committed
38 39
fi

40 41
if [ ${TASK} == "verilog_test" ] || [ ${TASK} == "all_test" ]; then
    if [ ! ${TRAVIS_OS_NAME} == "osx" ]; then
42
        make -f tests/scripts/packages.mk iverilog
43
        make all || exit -1
44
        ./tests/scripts/task_verilog_test.sh || exit -1
45 46 47
    fi
fi

48
if [ ${TASK} == "cpp_test" ] || [ ${TASK} == "all_test" ]; then
Tianqi Chen committed
49
    make -f dmlc-core/scripts/packages.mk gtest
50
    ./tests/scripts/task_cpp_unittest.sh || exit -1
Tianqi Chen committed
51 52
fi

53 54
if [ ${TASK} == "python_test" ] || [ ${TASK} == "all_test" ]; then
    make all || exit -1
Tianqi Chen committed
55
    if [ ${TRAVIS_OS_NAME} == "osx" ]; then
56
        ./tests/scripts/task_python_unittest.sh || exit -1
Tianqi Chen committed
57
    else
58 59
        nosetests -v tests/python/unittest || exit -1
        nosetests3 -v tests/python/unittest || exit -1
Tianqi Chen committed
60 61
    fi
fi