forked from symengine/symengine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_travis.sh
executable file
·93 lines (87 loc) · 2.57 KB
/
test_travis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env bash
# Exit on error
set -e
# Echo each command
set -x
# Shippable currently does not clean the directory after previous builds
# (https://github.com/Shippable/support/issues/238), so
# we need to do it ourselves.
git clean -dfx
export SOURCE_DIR=`pwd`
if [[ "${TEST_IN_TREE}" != "yes" ]]; then
mkdir build
cd build
fi
echo "Current directory:"
pwd
echo "Running cmake:"
# We build the command line here. If the variable is empty, we skip it,
# otherwise we pass it to cmake.
our_install_dir="$SOURCE_DIR/our_usr"
cmake_line="-DCMAKE_INSTALL_PREFIX=$our_install_dir"
if [[ "${BUILD_TYPE}" != "" ]]; then
cmake_line="$cmake_line -DCMAKE_BUILD_TYPE=${BUILD_TYPE}"
fi
if [[ "${WITH_BFD}" != "" ]]; then
cmake_line="$cmake_line -DWITH_BFD=${WITH_BFD}"
fi
if [[ "${WITH_PYTHON}" != "" ]]; then
cmake_line="$cmake_line -DWITH_PYTHON=${WITH_PYTHON}"
fi
if [[ "${WITH_CSYMPY_ASSERT}" != "" ]]; then
cmake_line="$cmake_line -DWITH_CSYMPY_ASSERT=${WITH_CSYMPY_ASSERT}"
fi
if [[ "${WITH_CSYMPY_RCP}" != "" ]]; then
cmake_line="$cmake_line -DWITH_CSYMPY_RCP=${WITH_CSYMPY_RCP}"
fi
if [[ "${WITH_CSYMPY_THREAD_SAFE}" != "" ]]; then
cmake_line="$cmake_line -DWITH_CSYMPY_THREAD_SAFE=${WITH_CSYMPY_THREAD_SAFE}"
fi
if [[ "${WITH_ECM}" != "" ]]; then
cmake_line="$cmake_line -DWITH_ECM=${WITH_ECM}"
fi
if [[ "${WITH_PRIMESIEVE}" != "" ]]; then
cmake_line="$cmake_line -DWITH_PRIMESIEVE=${WITH_PRIMESIEVE}"
fi
if [[ "${WITH_ARB}" != "" ]]; then
cmake_line="$cmake_line -DWITH_ARB=${WITH_ARB}"
fi
if [[ "${PYTHON_INSTALL}" == "yes" ]]; then
git clean -dfx
python setup.py install
mkdir empty
cd empty
py.test --pyargs csympy
cd ..
exit 0
fi
cmake $cmake_line ${SOURCE_DIR}
echo "Current directory:"
pwd
echo "Running make:"
make
echo "Running make install:"
make install
if [[ "${WITH_CSYMPY_RCP}" == "no" ]]; then
echo "CSymPy successfully built with Teuchos::RCP. No tests being run."
else
echo "Running tests in build directory:"
ctest --output-on-failure
if [[ "${WITH_PYTHON}" == "yes" ]]; then
nosetests -v
fi
echo "Running tests using installed csympy:"
cd $SOURCE_DIR/src/tests/basic/
extra_libs=""
if [[ "${WITH_BFD}" != "" ]]; then
extra_libs="$extra_libs -lbfd"
fi
if [[ "${WITH_ECM}" != "" ]]; then
extra_libs="$extra_libs -lecm"
fi
if [[ "${WITH_PRIMESIEVE}" != "" ]]; then
extra_libs="$extra_libs -lprimesieve"
fi
g++ -std=c++0x -I$our_install_dir/include/ -L$our_install_dir/lib test_basic.cpp -lcsympy -lgmpxx -lgmp -lteuchos $extra_libs
./a.out
fi