Add tests for correct build

This commit is contained in:
project-repo 2023-02-09 22:40:51 +01:00
commit 628dbc1314
3 changed files with 26 additions and 0 deletions

View file

@ -310,6 +310,8 @@ message('\n'.join(summary))
# Test Suite
test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic')
test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic')
test('Clang-format formatting check', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic')
test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic')
test('Scan-build static analysis', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release')

12
test/build-w-o-warnings Normal file
View file

@ -0,0 +1,12 @@
#! /bin/sh
RESULT=0
cd $MESONCURRENTCONFIGDIR
echo "Build standard release build"
rm -rf test/test-w-o-warnings
meson setup test/test-w-o-warnings -Dxwayland=true -Dman-pages=true --buildtype=release --fatal-meson-warnings || RESULT=1
ninja -C test/test-w-o-warnings || RESULT=1
rm -rf test/test-w-o-warnings
exit "${RESULT}"

12
test/build-w-o-xwayland Normal file
View file

@ -0,0 +1,12 @@
#! /bin/sh
RESULT=0
cd $MESONCURRENTCONFIGDIR
echo "Build without xwayland"
rm -rf test/test-w-o-xwayland
meson setup test/test-w-o-xwayland -Dxwayland=false -Dman-pages=false --buildtype=release --fatal-meson-warnings || RESULT=1
ninja -C test/test-w-o-xwayland || RESULT=1
rm -rf test/test-w-o-xwayland
exit "${RESULT}"