forked from ClickHouse/clickhouse-odbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_unicode.sh
executable file
·68 lines (63 loc) · 2.47 KB
/
test_unicode.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
#!/usr/bin/env bash
# !!! WARNING! THIS SCRIPT WILL UNINSTALL ALL PACKAGES DEPEND ON libiodbc2-dev unixodbc-dev !!!
# To build with your test unixodbc:
# env CMAKE_FLAGS="-DODBC_LIBRARIES=$HOME/unixODBC-2.3.7/odbcinst/.libs/libodbcinst.so;$HOME/unixODBC-2.3.7/DriverManager/.libs/libodbc.so" USE_LIBS="unixodbc" sh -x ./test_unicode.sh
set -x
set -e
set -o pipefail
cd ..
for lib in ${USE_LIBS=libiodbc unixodbc}; do
if [ "$lib" = "libiodbc" ]; then
CMAKE_FLAGS0=" -DFIND_IODBC_FIRST=1 "
fi
if [ "$lib" = "unixodbc" ]; then
CMAKE_FLAGS0=" -DFIND_UNIXODBC_FIRST=1 "
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ "$lib" = "libiodbc" ]; then
brew unlink unixodbc
brew install $lib
brew link $lib
fi
if [ "$lib" = "unixodbc" ]; then
brew unlink libiodbc
brew install $lib
brew link $lib
fi
elif [[ "$OSTYPE" == "FreeBSD"* ]]; then
if [ "$lib" = "libiodbc" ]; then
pkg install -y $lib
fi
if [ "$lib" = "unixodbc" ]; then
pkg install -y $lib
fi
elif [ `which apt` ]; then
if [ "$lib" = "libiodbc" ]; then
sudo apt install -y libiodbc2-dev iodbc
fi
if [ "$lib" = "unixodbc" ]; then
sudo apt install -y unixodbc-dev unixodbc
fi
fi
for compiler in ""; do
if [ "$compiler" = "_clang" ]; then
CMAKE_COMPILER_FLAGS="-DCMAKE_CXX_COMPILER=`which clang++-8 clang++-7 clang++-6.0 clang++-5.0 clang++60 clang++50 clang++ | head -n1` -DCMAKE_C_COMPILER=`which clang-8 clang-7 clang-6.0 clang-5.0 clang60 clang50 clang | head -n1`"
fi
if [ "$compiler" = "_gcc" ]; then
CMAKE_COMPILER_FLAGS="-DCMAKE_CXX_COMPILER=`which g++-9 g++-8 g++-7 g++9 g++8 g++7 g++ | head -n1` -DCMAKE_C_COMPILER=`which gcc-9 gcc-8 gcc-7 gcc9 gcc8 gcc7 gcc | head -n1`"
fi
for type in ${USE_TYPE=debug}; do
for option in ""; do
build_dir=build${compiler}_$type$option
echo build $compiler $type $option in ${build_dir}
mkdir -p ${build_dir}
rm -rf build
ln -sf ${build_dir} build
cd build
rm CMakeCache.txt
cmake .. -G Ninja $option -DCMAKE_BUILD_TYPE=$type -DTEST_DSN=${TEST_DSN=clickhouse_localhost} -DTEST_DSN_W=${TEST_DSN_W=clickhouse_localhost_w} $CMAKE_COMPILER_FLAGS $CMAKE_FLAGS0 $CMAKE_FLAGS | tee log_cmake.log && ninja -j ${MAKEJ=$(distcc -j || nproc || sysctl -n hw.ncpu || echo 4)} | tee log_build.log && ctest $CTEST_OPT | tee log_test.log
cd ..
done
done
done
done