[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill 11abbd2747 124/251: Add robotized test
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill 11abbd2747 124/251: Add robotized test |
Date: |
Mon, 17 Jan 2022 18:59:08 -0500 (EST) |
branch: elpa/org-drill
commit 11abbd27472d032f0f272cd45206f5af855aafea
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>
Add robotized test
---
Makefile | 5 +++++
robot/main-test-copy.org | 48 ++++++++++++++++++++++++++++++++++++++++++++++
robot/main-test.org | 12 ++++++++++++
robot/org-drill-launch.el | 31 ++++++++++++++++++++++++++++++
robot/robot-test.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++
test/org-drill-test.el | 1 +
6 files changed, 146 insertions(+)
diff --git a/Makefile b/Makefile
index 68a9ccf44b..345710f3ca 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,8 @@ install:
test: install just-test
+robot-and-test: robot-test just-test
+
just-test:
$(EMACS_ENV) $(CASK) emacs --batch -q \
--directory=. \
@@ -33,4 +35,7 @@ docker-test:
$(MAKE) test-git DOCKER_TAG=25.3
$(MAKE) test-cp DOCKER_TAG=25.3
+robot-test:
+ $(EMACS_ENV) ./robot/robot-test.sh
+
.PHONY: test
diff --git a/robot/main-test-copy.org b/robot/main-test-copy.org
new file mode 100644
index 0000000000..e57adcc480
--- /dev/null
+++ b/robot/main-test-copy.org
@@ -0,0 +1,48 @@
+
+* One :drill:
+ SCHEDULED: <2019-06-16 Sun>
+ :PROPERTIES:
+ :ID: 8ac0c150-4bda-4d52-aadf-c09b6568076e
+ :DRILL_LAST_INTERVAL: 3.56
+ :DRILL_REPEATS_SINCE_FAIL: 2
+ :DRILL_TOTAL_REPEATS: 1
+ :DRILL_FAILURE_COUNT: 0
+ :DRILL_AVERAGE_QUALITY: 5.0
+ :DRILL_EASE: 2.6
+ :DRILL_LAST_QUALITY: 5
+ :DRILL_LAST_REVIEWED: [2019-06-12 Wed 22:27]
+ :END:
+
+One body
+
+* Two :drill:
+ SCHEDULED: <2019-06-16 Sun>
+ :PROPERTIES:
+ :ID: 20b11d4a-68f4-4afa-b7b4-93aef89de9d4
+ :DRILL_LAST_INTERVAL: 3.56
+ :DRILL_REPEATS_SINCE_FAIL: 2
+ :DRILL_TOTAL_REPEATS: 1
+ :DRILL_FAILURE_COUNT: 0
+ :DRILL_AVERAGE_QUALITY: 5.0
+ :DRILL_EASE: 2.6
+ :DRILL_LAST_QUALITY: 5
+ :DRILL_LAST_REVIEWED: [2019-06-12 Wed 22:27]
+ :END:
+
+Two body
+
+* Three :drill:
+ SCHEDULED: <2019-06-16 Sun>
+ :PROPERTIES:
+ :ID: 253358dc-ce97-4c01-bdbb-ad97f7b16d3a
+ :DRILL_LAST_INTERVAL: 3.56
+ :DRILL_REPEATS_SINCE_FAIL: 2
+ :DRILL_TOTAL_REPEATS: 1
+ :DRILL_FAILURE_COUNT: 0
+ :DRILL_AVERAGE_QUALITY: 5.0
+ :DRILL_EASE: 2.6
+ :DRILL_LAST_QUALITY: 5
+ :DRILL_LAST_REVIEWED: [2019-06-12 Wed 22:26]
+ :END:
+
+Three body
diff --git a/robot/main-test.org b/robot/main-test.org
new file mode 100644
index 0000000000..28a3efb7ff
--- /dev/null
+++ b/robot/main-test.org
@@ -0,0 +1,12 @@
+
+* One :drill:
+
+One body
+
+* Two :drill:
+
+Two body
+
+* Three :drill:
+
+Three body
diff --git a/robot/org-drill-launch.el b/robot/org-drill-launch.el
new file mode 100644
index 0000000000..bab57ecfba
--- /dev/null
+++ b/robot/org-drill-launch.el
@@ -0,0 +1,31 @@
+;; Shutup
+(setq make-backup-files nil)
+(setq auto-save-default nil)
+
+;; Clean up
+(delete-file "./robot/failure.txt")
+
+(set-frame-name "emacs-bot")
+
+(condition-case e
+ (progn (load-file "org-learn.el")
+ (load-file "org-drill.el"))
+ (error
+ (with-temp-buffer
+ (insert (format "%s" (error-message-string e)))
+ (write-region (point-min) (point-max) "./robot/failure.txt"))
+ (let ((kill-emacs-hook nil))
+ (kill-emacs))))
+
+(copy-file "robot/main-test.org" "robot/main-test-copy.org" t)
+(find-file "robot/main-test-copy.org")
+
+(condition-case e
+ (org-drill)
+ (error
+ (with-temp-buffer
+ (insert (format "%s" (error-message-string e)))
+ ;; write to ./ now because we have changed directory
+ (write-region (point-min) (point-max) "./failure.txt"))
+ (let ((kill-emacs-hook nil))
+ (kill-emacs))))
diff --git a/robot/robot-test.sh b/robot/robot-test.sh
new file mode 100755
index 0000000000..31a6f09a93
--- /dev/null
+++ b/robot/robot-test.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+set -e
+
+$EMACS -Q -l ./robot/org-drill-launch.el &
+
+sleep 1
+
+window_id=`xdotool search --name "emacs-bot"`
+if [ -z "$window_id" ]
+then
+ echo "Could not find window ID for Emacs-bot"
+ exit 1
+fi
+
+## Org-drill should be running at this point, so give three answers
+## with a score of file
+echo answer one
+xdotool key --window $window_id KP_Enter
+sleep 0.25
+xdotool key --window $window_id 5
+sleep 0.25
+
+
+echo answer two
+xdotool key --window $window_id KP_Enter
+sleep 0.25
+xdotool key --window $window_id 5
+sleep 0.25
+
+echo answer three
+xdotool key --window $window_id KP_Enter
+sleep 0.25
+xdotool key --window $window_id 5
+sleep 0.25
+
+# ## Press any key to continue
+echo press any key to continue
+xdotool key --window $window_id KP_Enter
+sleep 0.25
+
+echo Save file
+xdotool key --window $window_id y
+sleep 0.25
+
+echo Goodnight Emacs
+xdotool key --window $window_id alt+x
+xdotool type --window $window_id kill-emacs
+xdotool key --window $window_id KP_Enter
diff --git a/test/org-drill-test.el b/test/org-drill-test.el
index 26e60c0aa4..a469ab215a 100644
--- a/test/org-drill-test.el
+++ b/test/org-drill-test.el
@@ -43,3 +43,4 @@
(assess-make-related-file
(concat this-directory "one-two-three.org"))
(org-map-drill-entries (lambda () (point)) 'file nil)))))
+
- [nongnu] elpa/org-drill 0f0ee9f188 241/251: Allow Creating New Session in Cram Mode, (continued)
- [nongnu] elpa/org-drill 0f0ee9f188 241/251: Allow Creating New Session in Cram Mode, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ace0cf0dcd 250/251: Update CI., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 7b9b7f1323 209/251: Update documentation, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 546336d207 225/251: Update documentation., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 602f5c4d96 243/251: Fix use of cl.el, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 94ae5d684d 244/251: update gitignore to exclude all org files in robots dir ending in -copy, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill c65430b71a 045/251: Oops! some some nasty discrepancies have now been fixed.(something went wrong, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 7a3bf3ef30 092/251: Update version in header to 2.4.10., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b02735bde7 094/251: New option 'org-drill-cloze-length-matches-hidden-text': If non-nil, when, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 6c14bd6c50 129/251: Update robot, Fix remaining CL dependencies, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 11abbd2747 124/251: Add robotized test,
ELPA Syncer <=
- [nongnu] elpa/org-drill 46d71b5218 141/251: Add lexical-binding, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2b44b36284 197/251: Fix prompt, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 1429c675e8 191/251: Fix compatability call again!, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 9eb8d72776 163/251: Update README, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 9f9e5e7170 193/251: Renamespace all macros, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 508f2dde21 202/251: Use persist, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 04923e6c38 214/251: Update gitignore for generated file, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill c0ee1780de 222/251: Update documentation, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 11dd2d4e23 235/251: Merge branch 'master' into 'fix/latex-overlays', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 6ad53cdf21 217/251: Update documentation, ELPA Syncer, 2022/01/17