Add simple functional test to CI

This commit is contained in:
sfan5 2021-08-27 20:49:29 +02:00
parent 8b563f409e
commit 5c435f6459
3 changed files with 23 additions and 0 deletions

View File

@ -33,6 +33,11 @@ jobs:
CC: gcc CC: gcc
CXX: g++ CXX: g++
- name: Test
run: |
source util/ci/script.sh
do_functional_test
clang: clang:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
@ -49,3 +54,8 @@ jobs:
env: env:
CC: clang CC: clang
CXX: clang++ CXX: clang++
- name: Test
run: |
source util/ci/script.sh
do_functional_test

View File

@ -13,3 +13,15 @@ run_build() {
make -j2 make -j2
} }
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
}

1
util/ci/test_block Normal file
View File

@ -0,0 +1 @@
1b00ffff020278daedd4c1090000080331dd7f691710faf12589235cb12ae870fca6bffefaebafbffefaebafbffefaebbff7b708fdf1ffd11ffdd11ffdd11ffd01000000000000003836d59f010578da63000000010001000000ffffffff000002000000036169720001000d64656661756c743a73746f6e650a0000