From 628dbc13141e0c6e0000536af09a8bfef2638b72 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 9 Feb 2023 22:40:51 +0100 Subject: [PATCH] Add tests for correct build --- meson.build | 2 ++ test/build-w-o-warnings | 12 ++++++++++++ test/build-w-o-xwayland | 12 ++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 test/build-w-o-warnings create mode 100644 test/build-w-o-xwayland diff --git a/meson.build b/meson.build index 2d47aa2..3bc5241 100644 --- a/meson.build +++ b/meson.build @@ -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') diff --git a/test/build-w-o-warnings b/test/build-w-o-warnings new file mode 100644 index 0000000..0eaa509 --- /dev/null +++ b/test/build-w-o-warnings @@ -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}" diff --git a/test/build-w-o-xwayland b/test/build-w-o-xwayland new file mode 100644 index 0000000..5e10109 --- /dev/null +++ b/test/build-w-o-xwayland @@ -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}"