diff options
| author | Phillip Lord <phillip.lord@russet.org.uk> | 2019-06-22 16:37:42 +0100 |
|---|---|---|
| committer | Phillip Lord <phillip.lord@russet.org.uk> | 2019-06-22 16:37:42 +0100 |
| commit | 20c90836aa10045db330699439416197df9fc761 (patch) | |
| tree | cbb6d35e26565e91ce67df5cb34b749eaf4eef37 | |
| parent | 4300ef9d4c70ce47bee196ee49b873fe8603ff66 (diff) | |
| download | org-drill-20c90836aa10045db330699439416197df9fc761.tar.gz org-drill-20c90836aa10045db330699439416197df9fc761.zip | |
Speed up robot tests with polling
| -rwxr-xr-x | robot/all-card-run.sh | 1 | ||||
| -rwxr-xr-x | robot/basic-run.sh | 4 | ||||
| -rwxr-xr-x | robot/leitner-run.sh | 1 | ||||
| -rw-r--r-- | robot/robot.sh | 18 | ||||
| -rwxr-xr-x | robot/spanish-run.sh | 1 |
5 files changed, 13 insertions, 12 deletions
diff --git a/robot/all-card-run.sh b/robot/all-card-run.sh index 3d70fc0..059f7d4 100755 --- a/robot/all-card-run.sh +++ b/robot/all-card-run.sh @@ -31,7 +31,6 @@ function run_drill { launch_emacs $this_dir/all-card-run.el $card_no { - sleep 1 find_bot ## Run once with default options diff --git a/robot/basic-run.sh b/robot/basic-run.sh index 9e0d69c..0eb5d11 100755 --- a/robot/basic-run.sh +++ b/robot/basic-run.sh @@ -5,7 +5,7 @@ set -e function run_drill { ## Org-drill should be running at this point, so give three answers ## with a score of file - sleep_big + sleep_small echo answer one send_answer @@ -19,7 +19,6 @@ function run_drill { ## Press any key to continue echo press any key to continue retn - sleep_small echo Save file key y @@ -32,7 +31,6 @@ source $this_dir/robot.sh launch_emacs $this_dir/basic-run.el { - sleep 1 find_bot ## Run once with default options diff --git a/robot/leitner-run.sh b/robot/leitner-run.sh index d91dd78..270d743 100755 --- a/robot/leitner-run.sh +++ b/robot/leitner-run.sh @@ -25,7 +25,6 @@ source $this_dir/robot.sh launch_emacs $this_dir/leitner-run.el { - sleep 1 find_bot ## Run once with default options diff --git a/robot/robot.sh b/robot/robot.sh index 8b7e9a3..c5cc33d 100644 --- a/robot/robot.sh +++ b/robot/robot.sh @@ -69,10 +69,16 @@ function wait_emacs { } function find_bot { - window_id=`xdotool search --name "emacs-bot"` - if [ -z "$window_id" ] - then - echo "Could not find window ID for Emacs-bot" - exit 1 - fi + for i in `seq 1 20`; + do + window_id=`xdotool search --name "emacs-bot"` + if [ -z "$window_id" ] + then + sleep 0.1 + else + return + fi + done + echo "Could not find window ID for Emacs-bot" + exit 1 } diff --git a/robot/spanish-run.sh b/robot/spanish-run.sh index c8cf19a..9f20c08 100755 --- a/robot/spanish-run.sh +++ b/robot/spanish-run.sh @@ -31,7 +31,6 @@ function run_drill { launch_emacs $this_dir/spanish-run.el { - sleep 1 find_bot ## Run once with default options |
