diff options
author | Thomas Huth <huth@tuxfamily.org> | 2023-11-01 21:43:22 +0100 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2023-11-07 19:26:50 +0100 |
commit | 645198d58b6e1236373f5375fdaa8e3b15519108 (patch) | |
tree | e4bfc69163b1b7604b4be0d62529196d13f93748 /tests/avocado/tesseract_utils.py | |
parent | e416fd79d5d12889266259e6df6ff0d22f6f6d6b (diff) | |
download | qemu-645198d58b6e1236373f5375fdaa8e3b15519108.zip qemu-645198d58b6e1236373f5375fdaa8e3b15519108.tar.gz qemu-645198d58b6e1236373f5375fdaa8e3b15519108.tar.bz2 |
tests/avocado: Allow newer versions of tesseract in the nextcube test
Current Linux distros ship version 5 of the tesseract OCR software,
so the nextcube screen test is ignored there. Let's make the check
more flexible to allow newer versions, too, and remove the old v3
test since most Linux distros don't ship this version anymore.
Message-ID: <20231101204323.35533-1-huth@tuxfamily.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
Diffstat (limited to 'tests/avocado/tesseract_utils.py')
-rw-r--r-- | tests/avocado/tesseract_utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/avocado/tesseract_utils.py b/tests/avocado/tesseract_utils.py index 72cd9ab..476f528 100644 --- a/tests/avocado/tesseract_utils.py +++ b/tests/avocado/tesseract_utils.py @@ -21,13 +21,13 @@ def tesseract_available(expected_version): version = res.stdout_text.split()[1] except IndexError: version = res.stderr_text.split()[1] - return int(version.split('.')[0]) == expected_version + return int(version.split('.')[0]) >= expected_version match = re.match(r'tesseract\s(\d)', res) if match is None: return False # now this is guaranteed to be a digit - return int(match.groups()[0]) == expected_version + return int(match.groups()[0]) >= expected_version def tesseract_ocr(image_path, tesseract_args='', tesseract_version=3): |