From 02b507b839205982f36e3b0ee455168ecda8cb51 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Mon, 17 Jun 2019 23:11:59 +0100 Subject: Add leitner robot test and fix --- robot/basic-run.el | 4 ++-- robot/basic-run.org | 12 ++++++++++++ robot/leitner-run.el | 12 ++++++++++++ robot/leitner-run.org | 12 ++++++++++++ robot/leitner-run.sh | 35 +++++++++++++++++++++++++++++++++++ robot/main-test.org | 12 ------------ robot/robot.sh | 2 +- 7 files changed, 74 insertions(+), 15 deletions(-) create mode 100644 robot/basic-run.org create mode 100644 robot/leitner-run.el create mode 100644 robot/leitner-run.org create mode 100755 robot/leitner-run.sh delete mode 100644 robot/main-test.org (limited to 'robot') 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/basic-run.org b/robot/basic-run.org new file mode 100644 index 0000000..28a3efb --- /dev/null +++ b/robot/basic-run.org @@ -0,0 +1,12 @@ + +* One :drill: + +One body + +* Two :drill: + +Two body + +* Three :drill: + +Three body 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/main-test.org b/robot/main-test.org deleted file mode 100644 index 28a3efb..0000000 --- a/robot/main-test.org +++ /dev/null @@ -1,12 +0,0 @@ - -* One :drill: - -One body - -* Two :drill: - -Two body - -* Three :drill: - -Three body 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= -- cgit v1.2.3