billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=759eeb81682d240dd930f88bc716649cdcdeab53

commit 759eeb81682d240dd930f88bc716649cdcdeab53
Author: Boris Faure <bill...@gmail.com>
Date:   Fri Dec 25 11:49:08 2020 +0100

    tests: only sleep within testing ui
---
 src/bin/termpty.c                                    |  3 +++
 tests/da.sh                                          |  4 +++-
 tests/dsr-cpr.sh                                     |  6 ++++--
 tests/esc_term_name_version.sh                       |  6 ++++--
 tests/mouse_reporting_mode_all_ext_none.sh           | 20 +++++++++++---------
 tests/mouse_reporting_mode_all_ext_sgr.sh            | 20 +++++++++++---------
 tests/mouse_reporting_mode_all_ext_urxvt.sh          | 20 +++++++++++---------
 tests/mouse_reporting_mode_all_ext_utf8.sh           | 20 +++++++++++---------
 ...use_reporting_mode_mouse_move_pressed_ext_none.sh | 20 +++++++++++---------
 ...ouse_reporting_mode_mouse_move_pressed_ext_sgr.sh | 20 +++++++++++---------
 ...se_reporting_mode_mouse_move_pressed_ext_urxvt.sh | 20 +++++++++++---------
 ...use_reporting_mode_mouse_move_pressed_ext_utf8.sh | 20 +++++++++++---------
 tests/mouse_reporting_mode_normal_ext_none.sh        | 20 +++++++++++---------
 tests/mouse_reporting_mode_normal_ext_sgr.sh         | 20 +++++++++++---------
 tests/mouse_reporting_mode_normal_ext_urxvt.sh       | 20 +++++++++++---------
 tests/mouse_reporting_mode_normal_ext_utf8.sh        | 20 +++++++++++---------
 tests/mouse_reporting_mode_x10_ext_none.sh           | 20 +++++++++++---------
 tests/mouse_reporting_mode_x10_ext_sgr.sh            | 20 +++++++++++---------
 tests/mouse_reporting_mode_x10_ext_urxvt.sh          | 20 +++++++++++---------
 tests/mouse_reporting_mode_x10_ext_utf8.sh           | 20 +++++++++++---------
 tests/osc-11-query.sh                                |  4 +++-
 tests/xterm-osc-10.sh                                |  1 -
 tests/xterm-osc-11.sh                                |  1 -
 tests/xterm-osc-12.sh                                |  1 -
 24 files changed, 193 insertions(+), 153 deletions(-)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 1d51f7b..383f39e 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -778,6 +778,9 @@ termpty_new(const char *cmd, Eina_Bool login_shell, const 
char *cd,
         putenv("XTERM_256_COLORS=1");
         putenv("TERM_PROGRAM=terminology");
         putenv("TERM_PROGRAM_VERSION=" PACKAGE_VERSION);
+#if defined(ENABLE_TEST_UI)
+        putenv("IN_TY_TEST_UI=1" PACKAGE_VERSION);
+#endif
         if (window_id)
           {
              char buf[256];
diff --git a/tests/da.sh b/tests/da.sh
index ae68b99..ed52ee1 100755
--- a/tests/da.sh
+++ b/tests/da.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # fill space with E
 printf '\033[69;1;1;25;80\044x'
@@ -43,4 +45,4 @@ printf '\033[=0c'
 printf '\033[=42c'
 
 # let it print
-sleep 0.2
+test_sleep 0.2
diff --git a/tests/dsr-cpr.sh b/tests/dsr-cpr.sh
index e154266..bb751bf 100755
--- a/tests/dsr-cpr.sh
+++ b/tests/dsr-cpr.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # fill space with E
 printf '\033#8'
@@ -12,7 +14,7 @@ printf '\033[6n'
 # Request cursor position (dec)
 printf '\033[?6n'
 
-sleep 0.2
+test_sleep 0.2
 
 # set top/bottom margins:
 printf '\033[10;20r'
@@ -29,7 +31,7 @@ printf '\033[6n'
 # Request cursor position (dec)
 printf '\033[?6n'
 
-sleep 0.2
+test_sleep 0.2
 
 # restrict cursor
 printf '\033[?6h'
diff --git a/tests/esc_term_name_version.sh b/tests/esc_term_name_version.sh
index 0c9f1ca..60da0c2 100755
--- a/tests/esc_term_name_version.sh
+++ b/tests/esc_term_name_version.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # fill space with E
 printf '\033[69;1;1;25;80\044x'
@@ -13,7 +15,7 @@ printf '\033[H'
 printf '\033[>0q'
 
 # let it print
-sleep 0.2
+test_sleep 0.2
 
 # move
 printf '\033[2H'
@@ -22,4 +24,4 @@ printf '\033[2H'
 printf '\033[>q'
 
 # let it print
-sleep 0.2
+test_sleep 0.2
diff --git a/tests/mouse_reporting_mode_all_ext_none.sh 
b/tests/mouse_reporting_mode_all_ext_none.sh
index 24a9185..8a5a961 100755
--- a/tests/mouse_reporting_mode_all_ext_none.sh
+++ b/tests/mouse_reporting_mode_all_ext_none.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[M"=)^[[MBQ)^[[MBe)^[[M#e)
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[M!=)^[[MAe)^[[M#e)
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[M`=)^[[Ma=)^[[M`e)^[[Mae)
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[M`=)^[[Ma=)^[[M`e)^[[Mae)
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_all_ext_sgr.sh 
b/tests/mouse_reporting_mode_all_ext_sgr.sh
index ee06ccf..62b1eae 100755
--- a/tests/mouse_reporting_mode_all_ext_sgr.sh
+++ b/tests/mouse_reporting_mode_all_ext_sgr.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[<64;29;9M^[[<65;29;9M^[[<64;69;9M^[[<65;69;9M
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[<72;29;9M^[[<73;29;9M^[[<72;69;9M^[[<73;69;9M
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_all_ext_urxvt.sh 
b/tests/mouse_reporting_mode_all_ext_urxvt.sh
index b8c8b59..7323fde 100755
--- a/tests/mouse_reporting_mode_all_ext_urxvt.sh
+++ b/tests/mouse_reporting_mode_all_ext_urxvt.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[96;29;9M^[[97;29;9M^[[96;69;9M^[[97;69;9M
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[104;29;9M^[[105;29;9M^[[104;69;9M^[[105;69;9M
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_all_ext_utf8.sh 
b/tests/mouse_reporting_mode_all_ext_utf8.sh
index 9005e45..30256ef 100755
--- a/tests/mouse_reporting_mode_all_ext_utf8.sh
+++ b/tests/mouse_reporting_mode_all_ext_utf8.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[M"=)^[[MBQ)^[[MBe)^[[M#e)
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[M!=)^[[MAe)^[[M#e)
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[M`=)^[[Ma=)^[[M`e)^[[Mae)
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[M`=)^[[M+e)
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_mouse_move_pressed_ext_none.sh 
b/tests/mouse_reporting_mode_mouse_move_pressed_ext_none.sh
index 11378c0..d4dfb06 100755
--- a/tests/mouse_reporting_mode_mouse_move_pressed_ext_none.sh
+++ b/tests/mouse_reporting_mode_mouse_move_pressed_ext_none.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[M"=)^[[MBQ)^[[MBe)^[[M#e)
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[M!=)^[[MAe)^[[M#e)
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[M`=)^[[Ma=)^[[M`e)^[[Mae)
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[M`=)^[[M+e)
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_mouse_move_pressed_ext_sgr.sh 
b/tests/mouse_reporting_mode_mouse_move_pressed_ext_sgr.sh
index 6946d32..5e8dd0f 100755
--- a/tests/mouse_reporting_mode_mouse_move_pressed_ext_sgr.sh
+++ b/tests/mouse_reporting_mode_mouse_move_pressed_ext_sgr.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[<64;29;9M^[[<65;29;9M^[[<64;69;9M^[[<65;69;9M
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[<72;29;9M^[[<73;29;9M^[[<72;69;9M^[[<73;69;9M
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_mouse_move_pressed_ext_urxvt.sh 
b/tests/mouse_reporting_mode_mouse_move_pressed_ext_urxvt.sh
index a00a12f..6f8a14f 100755
--- a/tests/mouse_reporting_mode_mouse_move_pressed_ext_urxvt.sh
+++ b/tests/mouse_reporting_mode_mouse_move_pressed_ext_urxvt.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[96;29;9M^[[97;29;9M^[[96;69;9M^[[97;69;9M
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[104;29;9M^[[105;29;9M^[[104;69;9M^[[105;69;9M
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_mouse_move_pressed_ext_utf8.sh 
b/tests/mouse_reporting_mode_mouse_move_pressed_ext_utf8.sh
index 8051b6e..bb86f42 100755
--- a/tests/mouse_reporting_mode_mouse_move_pressed_ext_utf8.sh
+++ b/tests/mouse_reporting_mode_mouse_move_pressed_ext_utf8.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[M"=)^[[MBQ)^[[MBe)^[[M#e)
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[M!=)^[[MAe)^[[M#e)
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[M`=)^[[Ma=)^[[M`e)^[[Mae)
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[M`=)^[[M+e)
@@ -189,4 +191,4 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
diff --git a/tests/mouse_reporting_mode_normal_ext_none.sh 
b/tests/mouse_reporting_mode_normal_ext_none.sh
index e488731..d511ed5 100755
--- a/tests/mouse_reporting_mode_normal_ext_none.sh
+++ b/tests/mouse_reporting_mode_normal_ext_none.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -59,7 +61,7 @@ printf '\033}tm;1230;130;0\0'
 printf '\033}tu;1230;130;1;0;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[M"=)^[[M#e)
@@ -73,7 +75,7 @@ printf '\033}tm;480;130;0\0'
 printf '\033}tu;480;130;3;0;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[M!=)^[[M#e)
@@ -87,7 +89,7 @@ printf '\033}tm;480;130;0\0'
 printf '\033}tu;480;130;2;0;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[M`=)^[[Ma=)^[[M`e)^[[Mae)
@@ -100,7 +102,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -120,7 +122,7 @@ printf '\033}tm;480;130;1\0'
 printf '\033}tu;480;130;1;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -135,7 +137,7 @@ printf '\033}tm;480;130;1\0'
 printf '\033}tu;480;130;3;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -150,7 +152,7 @@ printf '\033}tm;480;130;1\0'
 printf '\033}tu;480;130;2;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[Mh=)^[[Mi=)^[[Mhe)^[[Mie)
@@ -163,4 +165,4 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
diff --git a/tests/mouse_reporting_mode_normal_ext_sgr.sh 
b/tests/mouse_reporting_mode_normal_ext_sgr.sh
index 6fdaa84..c3153e8 100755
--- a/tests/mouse_reporting_mode_normal_ext_sgr.sh
+++ b/tests/mouse_reporting_mode_normal_ext_sgr.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[<2;29;9M;^[[<2;69;9m
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[<1;29;9M^[[<1;69;9m
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[<64;29;9M^[[<65;29;9M^[[<64;69;9M^[[<65;69;9M
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[<72;29;9M^[[<73;29;9M^[[<72;69;9M^[[<73;69;9M
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_normal_ext_urxvt.sh 
b/tests/mouse_reporting_mode_normal_ext_urxvt.sh
index 9c91b18..547e405 100755
--- a/tests/mouse_reporting_mode_normal_ext_urxvt.sh
+++ b/tests/mouse_reporting_mode_normal_ext_urxvt.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[34;29;9M^[[35;29;9M^[[34;69;9M^[[35;69;9M
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[33;29;9M^[[35;29;9M^[[33;69;9M^[[35;69;9M
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[96;29;9M^[[97;29;9M^[[96;69;9M^[[97;69;9M
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[104;29;9M^[[105;29;9M^[[104;69;9M^[[105;69;9M
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_normal_ext_utf8.sh 
b/tests/mouse_reporting_mode_normal_ext_utf8.sh
index 61bcc40..10abada 100755
--- a/tests/mouse_reporting_mode_normal_ext_utf8.sh
+++ b/tests/mouse_reporting_mode_normal_ext_utf8.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -62,7 +64,7 @@ printf '\033}tm;1230;130;0\0'
 printf '\033}tu;1230;130;1;0;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[M"=)^[[M#e)
@@ -78,7 +80,7 @@ printf '\033}tu;480;130;3;0;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[M!=)^[[M#e)
@@ -94,7 +96,7 @@ printf '\033}tu;480;130;2;0;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[M`=)^[[Ma=)^[[M`e)^[[Mae)
@@ -107,7 +109,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -129,7 +131,7 @@ printf '\033}tu;480;130;1;1;0\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -146,7 +148,7 @@ printf '\033}tu;480;130;3;1;0\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -163,7 +165,7 @@ printf '\033}tu;480;130;2;1;0\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints ^[[Mh=)^[[Mi=)^[[Mhe)^[[Mie)
@@ -176,4 +178,4 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
diff --git a/tests/mouse_reporting_mode_x10_ext_none.sh 
b/tests/mouse_reporting_mode_x10_ext_none.sh
index 4d86e79..ea1bf70 100755
--- a/tests/mouse_reporting_mode_x10_ext_none.sh
+++ b/tests/mouse_reporting_mode_x10_ext_none.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -59,7 +61,7 @@ printf '\033}tm;1230;130;0\0'
 printf '\033}tu;1230;130;1;0;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[M"=)
@@ -73,7 +75,7 @@ printf '\033}tm;480;130;0\0'
 printf '\033}tu;480;130;3;0;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[M!=)
@@ -87,7 +89,7 @@ printf '\033}tm;480;130;0\0'
 printf '\033}tu;480;130;2;0;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints nothing
@@ -98,7 +100,7 @@ printf '\033}tw;200;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -118,7 +120,7 @@ printf '\033}tm;480;130;1\0'
 printf '\033}tu;480;130;1;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -133,7 +135,7 @@ printf '\033}tm;480;130;1\0'
 printf '\033}tu;480;130;3;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -148,7 +150,7 @@ printf '\033}tm;480;130;1\0'
 printf '\033}tu;480;130;2;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints nothing
@@ -161,4 +163,4 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
diff --git a/tests/mouse_reporting_mode_x10_ext_sgr.sh 
b/tests/mouse_reporting_mode_x10_ext_sgr.sh
index c57b47d..0f38900 100755
--- a/tests/mouse_reporting_mode_x10_ext_sgr.sh
+++ b/tests/mouse_reporting_mode_x10_ext_sgr.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[<2;29;9M
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[<1;29;9M
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints nothing
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints nothing
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_x10_ext_urxvt.sh 
b/tests/mouse_reporting_mode_x10_ext_urxvt.sh
index 79e65b6..6e80f61 100755
--- a/tests/mouse_reporting_mode_x10_ext_urxvt.sh
+++ b/tests/mouse_reporting_mode_x10_ext_urxvt.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -69,7 +71,7 @@ printf '\033}tm;664;130;0\0'
 printf '\033}tm;657;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[34;29;9M
@@ -87,7 +89,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[33;29;9M
@@ -104,7 +106,7 @@ printf '\033}tm;340;130;0\0'
 printf '\033}tm;200;130;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints nothing
@@ -117,7 +119,7 @@ printf '\033}tw;480;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -140,7 +142,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -158,7 +160,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -176,7 +178,7 @@ printf '\033}tm;340;130;1\0'
 printf '\033}tm;200;130;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints nothing
@@ -189,5 +191,5 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 printf '\033[14H'
diff --git a/tests/mouse_reporting_mode_x10_ext_utf8.sh 
b/tests/mouse_reporting_mode_x10_ext_utf8.sh
index bc5333c..113c4d2 100755
--- a/tests/mouse_reporting_mode_x10_ext_utf8.sh
+++ b/tests/mouse_reporting_mode_x10_ext_utf8.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # char width: 7
 # char height: 15
@@ -8,7 +10,7 @@
 printf '\033[8;;180;t'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 # fill space with E
 printf '\033#8'
@@ -60,7 +62,7 @@ printf '\033}tm;1230;130;0\0'
 printf '\033}tu;1230;130;1;0;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## RIGHT CLICK
 # should print ^[[M"=)
@@ -74,7 +76,7 @@ printf '\033}tm;480;130;0\0'
 printf '\033}tu;480;130;3;0;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## MIDDLE CLICK
 # should print ^[[M!=)
@@ -88,7 +90,7 @@ printf '\033}tm;480;130;0\0'
 printf '\033}tu;480;130;2;0;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints nothing
@@ -99,7 +101,7 @@ printf '\033}tw;200;130;1;1;0\0'
 printf '\033}tw;480;130;0;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ##
@@ -119,7 +121,7 @@ printf '\033}tm;480;130;1\0'
 printf '\033}tu;480;130;1;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## RIGHT CLICK
@@ -134,7 +136,7 @@ printf '\033}tm;480;130;1\0'
 printf '\033}tu;480;130;3;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 
 ## MIDDLE CLICK
@@ -149,7 +151,7 @@ printf '\033}tm;480;130;1\0'
 printf '\033}tu;480;130;2;1;0\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
 
 ## WHEEL
 # prints nothing
@@ -162,4 +164,4 @@ printf '\033}tw;480;130;1;1;1\0'
 printf '\033}tw;480;130;0;1;1\0'
 # force render
 printf '\033}tr\0'
-sleep 0.2
+test_sleep 0.2
diff --git a/tests/osc-11-query.sh b/tests/osc-11-query.sh
index f26cdf8..334963e 100755
--- a/tests/osc-11-query.sh
+++ b/tests/osc-11-query.sh
@@ -1,6 +1,8 @@
 #!/bin/sh
+# shellcheck source=tests/utils.sh
+. "$(dirname "$0")/utils.sh"
 
 # query background color
 printf '\033]11;?\007'
-sleep 0.1
+test_sleep 0.1
 #should print ^]]11;rgb:83/84/85^G
diff --git a/tests/xterm-osc-10.sh b/tests/xterm-osc-10.sh
index eae8554..f0adcea 100755
--- a/tests/xterm-osc-10.sh
+++ b/tests/xterm-osc-10.sh
@@ -22,4 +22,3 @@ printf '\033]10;fff000\007'
 # change foreground color and then query it
 printf '\033]10;#ff00FF\007'
 printf '\033]10;?\007'
-sleep 0.1
diff --git a/tests/xterm-osc-11.sh b/tests/xterm-osc-11.sh
index 1130058..71ceaff 100755
--- a/tests/xterm-osc-11.sh
+++ b/tests/xterm-osc-11.sh
@@ -22,4 +22,3 @@ printf '\033]11;fff000\007'
 # change background color and then query it
 printf '\033]11;#ff00FF\007'
 printf '\033]11;?\007'
-sleep 0.1
diff --git a/tests/xterm-osc-12.sh b/tests/xterm-osc-12.sh
index 42fbb3a..1ecd9c1 100755
--- a/tests/xterm-osc-12.sh
+++ b/tests/xterm-osc-12.sh
@@ -22,4 +22,3 @@ printf '\033]12;fff000\007'
 # change cursor color and then query it
 printf '\033]12;#ff00FF\007'
 printf '\033]12;?\007'
-sleep 0.1

-- 


Reply via email to