2021-08-27 16:50:46 +02:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
install_linux_deps() {
|
2021-09-01 23:55:32 +02:00
|
|
|
local pkgs=(cmake libgd-dev libsqlite3-dev libleveldb-dev libpq-dev libhiredis-dev libzstd-dev)
|
2021-08-27 16:50:46 +02:00
|
|
|
|
|
|
|
sudo apt-get update
|
2023-01-29 14:44:03 +01:00
|
|
|
sudo apt-get remove -y 'libgd3' nginx || : # ????
|
|
|
|
sudo apt-get install -y --no-install-recommends "${pkgs[@]}" "$@"
|
2021-08-27 16:50:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
run_build() {
|
2024-04-20 21:38:15 +02:00
|
|
|
local args=(
|
|
|
|
-DCMAKE_BUILD_TYPE=Debug
|
2021-08-27 16:50:46 +02:00
|
|
|
-DENABLE_LEVELDB=1 -DENABLE_POSTGRESQL=1 -DENABLE_REDIS=1
|
2024-04-20 21:38:15 +02:00
|
|
|
)
|
|
|
|
[[ "$CXX" == clang* ]] && args+=(-DCMAKE_CXX_FLAGS="-fsanitize=address")
|
|
|
|
cmake . "${args[@]}"
|
2021-08-27 16:50:46 +02:00
|
|
|
|
|
|
|
make -j2
|
|
|
|
}
|
2021-08-27 20:49:29 +02:00
|
|
|
|
|
|
|
do_functional_test() {
|
|
|
|
mkdir testmap
|
|
|
|
echo "backend = sqlite3" >testmap/world.mt
|
|
|
|
sqlite3 testmap/map.sqlite <<END
|
|
|
|
CREATE TABLE blocks(pos INT,data BLOB);
|
|
|
|
INSERT INTO blocks(pos, data) VALUES(0, x'$(cat util/ci/test_block)');
|
|
|
|
END
|
|
|
|
|
|
|
|
./minetestmapper --noemptyimage -i ./testmap -o map.png
|
|
|
|
file map.png
|
|
|
|
}
|