From 37beab89946e00a426f815a5055df54809a2c121 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Feb 2023 00:12:33 +0100 Subject: [PATCH] Adjust file sync for parallel testing --- meson.build | 2 +- test/arguments | 3 +++ test/environment-variables | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e906db7..74f37a4 100644 --- a/meson.build +++ b/meson.build @@ -351,8 +351,8 @@ test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ test('Copyright and LICENSE', find_program('test/copyright-license'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()), ''.join('MESONLICENSE=', meson.project_license())], suite: 'devel' ) test('Clang-format (formatting check)', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Shellcheck (script linting)', find_program('test/shellcheck'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel-long') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), 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') test('Check for strings indicating problems', find_program('test/illegal-strings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') test('Semantic versioning', find_program('test/versions'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/test/arguments b/test/arguments index e276516..05d24e3 100644 --- a/test/arguments +++ b/test/arguments @@ -27,6 +27,7 @@ RESULT=0 cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/-c-config" "${testdir}" sed -i "s|CONFIGPATH|${testdir}\/result|g" "${testdir}/-c-config" WLR_BACKENDS=headless ./cagebreak -c "${testdir}/-c-config" +sync [[ $(cat "${testdir}/result") = "SUCCESS" ]] || RESULT=1 # check -e option @@ -35,11 +36,13 @@ cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" readonly oldsocket=$CAGEBREAK_SOCKET sed -i "s|CONFIGPATH|${testdir}\/socket|g" "${testdir}/config" (WLR_BACKENDS=headless ./cagebreak -c "${testdir}/config") +sync [[ $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 ## Check with socket cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" (WLR_BACKENDS=headless ./cagebreak -e -c "${testdir}/config") +sync [[ ! $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 # check -h option diff --git a/test/environment-variables b/test/environment-variables index d0d26c6..ceb74c6 100644 --- a/test/environment-variables +++ b/test/environment-variables @@ -13,17 +13,20 @@ cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" readonly oldsocket=$CAGEBREAK_SOCKET sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" (WLR_BACKENDS=headless ./cagebreak -c "${testdir}/config") +sync [[ $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 ## Check with socket cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" (WLR_BACKENDS=headless ./cagebreak -e -c "${testdir}/config") +sync [[ ! $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 # XDG_CONFIG_HOME cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/env-var-config" "${testdir}/cagebreak/config" sed -i "s|CONFIGPATH|${testdir}\/result|g" "${testdir}/cagebreak/config" XDG_CONFIG_HOME="${testdir}/" WLR_BACKENDS=headless ./cagebreak +sync [[ $(cat "${testdir}/result") = "SUCCESS" ]] || RESULT=1 # The XKB_DEFAULT_* family of variables is not found in the source code