summary refs log tree commit diff
path: root/nixos/doc/manual/development
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2021-04-23 15:02:36 +0000
committerLuke Granger-Brown <git@lukegb.com>2021-04-23 18:42:35 +0000
commit4de343cccfd6591ab798e03600d8b3626db8efbd (patch)
treee50e66fdbac073c8a0953fe2270498b4b9456e74 /nixos/doc/manual/development
parent3ac9de55b08fa8b20f8e56dfe0016d51834eb079 (diff)
downloadnixpkgs-4de343cccfd6591ab798e03600d8b3626db8efbd.tar
nixpkgs-4de343cccfd6591ab798e03600d8b3626db8efbd.tar.gz
nixpkgs-4de343cccfd6591ab798e03600d8b3626db8efbd.tar.bz2
nixpkgs-4de343cccfd6591ab798e03600d8b3626db8efbd.tar.lz
nixpkgs-4de343cccfd6591ab798e03600d8b3626db8efbd.tar.xz
nixpkgs-4de343cccfd6591ab798e03600d8b3626db8efbd.tar.zst
nixpkgs-4de343cccfd6591ab798e03600d8b3626db8efbd.zip
nixos/test-driver: use a variety of different Tesseract settings for OCR
When performing OCR, some of the Tesseract settings perform better than
others on a variety of different workloads, but they mostly take
~negligible incremental time to run compared to the overhead of running
the ImageMagick filters.

After this commit, we try using all three of the current Tesseract
models (classic, LSTM, and classic+LSTM) to generate output text. This
fixes chromium-90's tests at release-20.09, and should make cases where
you're looking for *specific* text better, with the tradeoff of running
Tesseract multiple times.

To make it sensible to cherrypick this into release-20.09, this doesn't
change the existing API surface for the test driver. In particular,
get_screen_text continues to have the existing behaviour.
Diffstat (limited to 'nixos/doc/manual/development')
-rw-r--r--nixos/doc/manual/development/writing-nixos-tests.xml22
1 files changed, 21 insertions, 1 deletions
diff --git a/nixos/doc/manual/development/writing-nixos-tests.xml b/nixos/doc/manual/development/writing-nixos-tests.xml
index 5f70f74d5d9..5a95436915f 100644
--- a/nixos/doc/manual/development/writing-nixos-tests.xml
+++ b/nixos/doc/manual/development/writing-nixos-tests.xml
@@ -188,6 +188,25 @@ start_all()
    </varlistentry>
    <varlistentry>
     <term>
+     <methodname>get_screen_text_variants</methodname>
+    </term>
+    <listitem>
+     <para>
+      Return a list of different interpretations of what is currently visible
+      on the machine's screen using optical character recognition. The number
+      and order of the interpretations is not specified and is subject to
+      change, but if no exception is raised at least one will be returned.
+     </para>
+     <note>
+      <para>
+       This requires passing <option>enableOCR</option> to the test attribute
+       set.
+      </para>
+     </note>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term>
      <methodname>get_screen_text</methodname>
     </term>
     <listitem>
@@ -350,7 +369,8 @@ start_all()
      <para>
       Wait until the supplied regular expressions matches the textual contents
       of the screen by using optical character recognition (see
-      <methodname>get_screen_text</methodname>).
+     <methodname>get_screen_text</methodname> and
+     <methodname>get_screen_text_variants</methodname>).
      </para>
      <note>
       <para>