qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/6] tests/acceptance: Introduce tesseract_ocr() helper


From: Thomas Huth
Subject: Re: [PATCH 4/6] tests/acceptance: Introduce tesseract_ocr() helper
Date: Mon, 26 Oct 2020 07:09:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

On 24/10/2020 19.40, Philippe Mathieu-Daudé wrote:
> On 10/24/20 9:37 AM, Philippe Mathieu-Daudé wrote:
>> On 10/24/20 8:40 AM, Thomas Huth wrote:
>>> On 24/10/2020 08.35, Thomas Huth wrote:
>>>> On 21/10/2020 12.50, Philippe Mathieu-Daudé wrote:
>>>>> We are going to reuse the tesseract OCR code.
>>>>> Create a new tesseract_ocr() helper and use it.
>>>>>
>>>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>>>> ---
>>>>>   tests/acceptance/machine_m68k_nextcube.py | 21 +++++----------------
>>>>>   tests/acceptance/tesseract_utils.py       | 18 ++++++++++++++++++
>>>>>   2 files changed, 23 insertions(+), 16 deletions(-)
> ...
> 
>>>>
>>>> Would it make sense to completely hide the tesseract version handling in
>>>> this new tesseract_utils.py file now, so that the tests themselves do not
>>>> have to worry about this anymore
> 
> The problem is the recognized strings differ between versions,
> see in tests/acceptance/machine_m68k_nextcube.py:
> 
>         lines = tesseract_ocr(screenshot_path, tesseract_version=3)
>         text = '\n'.join(lines)
>         self.assertIn('Backplane', text)
>         self.assertIn('Ethernet address', text)
> 
> and:
> 
>         lines = tesseract_ocr(screenshot_path, tesseract_version=4)
>         text = '\n'.join(lines)
>         self.assertIn('Testing the FPU, SCC', text)
>         self.assertIn('System test failed. Error code', text)
>         self.assertIn('Boot command', text)
>         self.assertIn('Next>', text)

Ah, right, I forgot about that ... well, one more reason to completely
switch to tesseract v4 now ;-)

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]