forked from alibaba/AliSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextension-upload-test.sh
More file actions
executable file
·64 lines (53 loc) · 1.31 KB
/
extension-upload-test.sh
File metadata and controls
executable file
·64 lines (53 loc) · 1.31 KB
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
#!/bin/bash
set -e
set -x
CMAKE_CONFIG=Release
EXT_BASE_PATH=build/release
if [ "${FORCE_32_BIT:0}" == "1" ]; then
FORCE_32_BIT_FLAG="-DFORCE_32_BIT=1"
else
FORCE_32_BIT_FLAG=""
fi
FILES="${EXT_BASE_PATH}/extension/*/*.duckdb_extension"
EXTENSION_LIST=""
for f in $FILES
do
ext=`basename $f .duckdb_extension`
EXTENSION_LIST="${EXTENSION_LIST}-$ext"
done
mkdir -p testext
cd testext
if [ "$2" = "oote" ]; then
CMAKE_ROOT="../duckdb"
else
CMAKE_ROOT=".."
fi
cmake -DCMAKE_BUILD_TYPE=${CMAKE_CONFIG} ${FORCE_32_BIT_FLAG} -DTEST_REMOTE_INSTALL="${EXTENSION_LIST}" ${CMAKE_ROOT}
cmake --build . --config ${CMAKE_CONFIG}
cd ..
duckdb_path="testext/duckdb"
unittest_path="testext/test/unittest"
if [ ! -f "${duckdb_path}" ]; then
duckdb_path="testext/${CMAKE_CONFIG}/duckdb.exe"
unittest_path="testext/test/${CMAKE_CONFIG}/unittest.exe"
fi
${duckdb_path} -c "FROM duckdb_extensions()"
for f in $FILES
do
ext=`basename $f .duckdb_extension`
install_path=${ext}
unsigned_flag=
if [ "$1" = "local" ]
then
install_path=${f}
unsigned_flag=-unsigned
fi
echo ${install_path}
${duckdb_path} ${unsigned_flag} -c "FORCE INSTALL '${install_path}'"
${duckdb_path} ${unsigned_flag} -c "LOAD '${ext}'"
done
# Only run tests for non-local, we have tested in enough other ways
if [ "$1" != "local" ]
then
${unittest_path}
fi