Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] Powerful and easy way to testing text

Hi all,

As we're having fun with StyledText and editors these days, some of us contributors have had discussions about how to test things.
I'd like to share with you a simple and powerful approach to test Text rendering (in a widget, in an editor, wherever): using an OCR like Tesseract.

I've tried the following:
* Open a Java editor with codeminings enabled
* Took a screenshot of the editor (cropped to remove ruler and keep only text)
* then ran from CLI `tesseract /path/to/screenshot.png stdout -psm 6` and got as output a string that matches almost perfectly the text in the editor; more particularly showing the codeminings were rendered and read properly.

I think it's an extremely powerful way to do rendering test for StyledText and the family (editors, code minings...).
Would is seem acceptable to start adopting such OCR-based tests where needed in Platform? I really think it's 1000 times worth it.


Mickael Istria
Eclipse IDE developer, for Red Hat Developers

Back to the top