aboutsummaryrefslogtreecommitdiff
path: root/robot
diff options
context:
space:
mode:
authorPhillip Lord <phillip.lord@russet.org.uk>2019-06-17 23:11:59 +0100
committerPhillip Lord <phillip.lord@russet.org.uk>2019-06-17 23:11:59 +0100
commit02b507b839205982f36e3b0ee455168ecda8cb51 (patch)
tree5ff8250a67cdcef7318f86b291a0a698f44f7ec1 /robot
parent01842209269e290676e38b764d23b408850cb747 (diff)
downloadorg-drill-02b507b839205982f36e3b0ee455168ecda8cb51.tar.gz
org-drill-02b507b839205982f36e3b0ee455168ecda8cb51.zip
Add leitner robot test and fix
Diffstat (limited to 'robot')
-rw-r--r--robot/basic-run.el4
-rw-r--r--robot/basic-run.org (renamed from robot/main-test.org)0
-rw-r--r--robot/leitner-run.el12
-rw-r--r--robot/leitner-run.org12
-rwxr-xr-xrobot/leitner-run.sh35
-rw-r--r--robot/robot.sh2
6 files changed, 62 insertions, 3 deletions
diff --git a/robot/basic-run.el b/robot/basic-run.el
index 2059d7b..8ce4346 100644
--- a/robot/basic-run.el
+++ b/robot/basic-run.el
@@ -2,8 +2,8 @@
(load-file "org-drill.el")
(defun org-drill-do-drill ()
- (copy "main-test.org" "main-test-copy.org")
- (find "main-test-copy.org")
+ (copy "basic-run.org" "basic-run-copy.org")
+ (find "basic-run-copy.org")
(org-drill)
(set-buffer-modified-p nil)
diff --git a/robot/main-test.org b/robot/basic-run.org
index 28a3efb..28a3efb 100644
--- a/robot/main-test.org
+++ b/robot/basic-run.org
diff --git a/robot/leitner-run.el b/robot/leitner-run.el
new file mode 100644
index 0000000..668e3ac
--- /dev/null
+++ b/robot/leitner-run.el
@@ -0,0 +1,12 @@
+(load-file "robot/robot.el")
+(load-file "org-drill.el")
+
+(copy "leitner-run.org" "leitner-run-copy.org")
+(find "leitner-run-copy.org")
+
+(org-drill-leitner)
+(set-buffer-modified-p nil)
+(kill-buffer)
+
+
+(robot-check-cards-seen-and-die 3)
diff --git a/robot/leitner-run.org b/robot/leitner-run.org
new file mode 100644
index 0000000..da3f92a
--- /dev/null
+++ b/robot/leitner-run.org
@@ -0,0 +1,12 @@
+
+* One :leitner:
+
+One body
+
+* Two :leitner:
+
+Two body
+
+* Three :leitner:
+
+Three body
diff --git a/robot/leitner-run.sh b/robot/leitner-run.sh
new file mode 100755
index 0000000..7c76291
--- /dev/null
+++ b/robot/leitner-run.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+set -e
+
+function run_drill {
+ ## Org-drill should be running at this point, so give three answers
+ ## with a score of file
+ sleep_big
+
+ echo answer one
+ send_answer
+
+ echo answer two
+ send_answer
+
+ echo answer three
+ send_answer
+}
+
+this_dir="$(dirname "$0")"
+source $this_dir/robot.sh
+
+##small_sleep=3
+
+launch_emacs $this_dir/leitner-run.el
+
+{
+ sleep 2
+ find_bot
+
+ ## Run once with default options
+ run_drill
+
+ wait_emacs
+} || cat robot/failure.txt
diff --git a/robot/robot.sh b/robot/robot.sh
index e0c3e6a..c9a6169 100644
--- a/robot/robot.sh
+++ b/robot/robot.sh
@@ -7,7 +7,7 @@ window_id=
## This is the small sleep between key presses. Change for debugging
## when you are not sure what is happening
-small_sleep=0.25
+small_sleep=0.1
big_sleep=1
emacs_process_pid=