From 40c3980b3ef25c02a827b87df47bdd5ba41156bb Mon Sep 17 00:00:00 2001 From: cytopia Date: Sun, 23 Jan 2022 22:08:10 +0100 Subject: [PATCH] Adjust CI tests for enchant --- tests/mods/modules.sh | 20 ++++---- tests/mods/modules/enchant/enchant-aspell.php | 7 +++ tests/mods/modules/enchant/enchant-hspell.php | 7 +++ .../mods/modules/enchant/enchant-hunspell.php | 51 +++++++++++++++++++ tests/mods/modules/enchant/enchant-ispell.php | 16 ++++++ .../mods/modules/enchant/enchant-myspell.php | 21 ++++++++ 6 files changed, 112 insertions(+), 10 deletions(-) create mode 100644 tests/mods/modules/enchant/enchant-hunspell.php diff --git a/tests/mods/modules.sh b/tests/mods/modules.sh index 1efa79b..b1bf64b 100755 --- a/tests/mods/modules.sh +++ b/tests/mods/modules.sh @@ -58,22 +58,22 @@ docker run \ set -e set -u if [ -f \"\${1:-}\" ]; then - fail=0 - printf \"[TEST] %s\" \"\${1}\" + error=0 if script -e -c \"php \${1}\" /dev/null 2>&1 | grep -Ei \"core|segmentation|fatal|except|err|warn|notice\" 2>&1 >/dev/null; then - fail=1 - fi - if ! php \"\${1}\" 2>&1 | grep -E \"^(OK|SKIP)$\" 2>&1 >/dev/null; then - fail=1 - fi - - if [ \"\${fail}\" != \"0\" ]; then printf \"\\r[FAIL] %s\\n\" \"\${1}\" php \"\${1}\" || true exit 1 else - printf \"\\r[OK] %s\\n\" \"\${1}\" + if php \"\${1}\" 2>&1 | grep -E \"^(OK)$\" 2>&1 >/dev/null; then + printf \"\\r[OK] %s\\n\" \"\${1}\" + elif php \"\${1}\" 2>&1 | grep -E \"^(SKIP)$\" 2>&1 >/dev/null; then + printf \"\\r[SKIP] %s\\n\" \"\${1}\" + else + printf \"\\r[FAIL] %s\\n\" \"\${1}\" + php \"\${1}\" || true + exit 1 + fi fi fi diff --git a/tests/mods/modules/enchant/enchant-aspell.php b/tests/mods/modules/enchant/enchant-aspell.php index 5ed7cd5..9b42929 100644 --- a/tests/mods/modules/enchant/enchant-aspell.php +++ b/tests/mods/modules/enchant/enchant-aspell.php @@ -7,6 +7,13 @@ ini_set('display_startup_errors', 1); ini_set('display_errors', 1); error_reporting(-1); +// FIXME: Currently disabled for PHP 7.3 and PHP 7.4 +if (PHP_MAJOR_VERSION == 7) { + if (PHP_MINOR_VERSION == 3 || PHP_MINOR_VERSION == 4) { + echo 'SKIP'; + exit(0); + } +} $backend = 'aspell'; diff --git a/tests/mods/modules/enchant/enchant-hspell.php b/tests/mods/modules/enchant/enchant-hspell.php index 9c67a95..894a0be 100644 --- a/tests/mods/modules/enchant/enchant-hspell.php +++ b/tests/mods/modules/enchant/enchant-hspell.php @@ -7,6 +7,13 @@ ini_set('display_startup_errors', 1); ini_set('display_errors', 1); error_reporting(-1); +// FIXME: Currently disabled for PHP 7.3 and PHP 7.4 +if (PHP_MAJOR_VERSION == 7) { + if (PHP_MINOR_VERSION == 3 || PHP_MINOR_VERSION == 4) { + echo 'SKIP'; + exit(0); + } +} $backend = 'hspell'; diff --git a/tests/mods/modules/enchant/enchant-hunspell.php b/tests/mods/modules/enchant/enchant-hunspell.php new file mode 100644 index 0000000..45c6882 --- /dev/null +++ b/tests/mods/modules/enchant/enchant-hunspell.php @@ -0,0 +1,51 @@ +=')) { + echo 'SKIP'; + exit(0); +} $backend = 'myspell';