Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add simple functional test to CI
  • Loading branch information
sfan5 committed Aug 27, 2021
1 parent 8b563f4 commit 5c435f6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -33,6 +33,11 @@ jobs:
CC: gcc
CXX: g++

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

- name: Test
run: |
source util/ci/script.sh
do_functional_test
12 changes: 12 additions & 0 deletions util/ci/script.sh
Expand Up @@ -13,3 +13,15 @@ run_build() {

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 change: 1 addition & 0 deletions util/ci/test_block
@@ -0,0 +1 @@
1b00ffff020278daedd4c1090000080331dd7f691710faf12589235cb12ae870fca6bffefaebafbffefaebafbffefaebbff7b708fdf1ffd11ffdd11ffdd11ffd01000000000000003836d59f010578da63000000010001000000ffffffff000002000000036169720001000d64656661756c743a73746f6e650a0000

0 comments on commit 5c435f6

Please sign in to comment.