aboutsummaryrefslogtreecommitdiff
path: root/robot/org-drill-launch.el
diff options
context:
space:
mode:
authorPhillip Lord <phillip.lord@russet.org.uk>2019-06-12 22:28:38 +0100
committerPhillip Lord <phillip.lord@russet.org.uk>2019-06-12 22:28:38 +0100
commit11abbd27472d032f0f272cd45206f5af855aafea (patch)
tree8e3c36139451ac8ce8ab5c6cc5872d55613c7485 /robot/org-drill-launch.el
parentc58cb90ff0cd6bd6dc3a338fd2a8bc7392c06fec (diff)
downloadorg-drill-11abbd27472d032f0f272cd45206f5af855aafea.tar.gz
org-drill-11abbd27472d032f0f272cd45206f5af855aafea.zip
Add robotized test
Diffstat (limited to 'robot/org-drill-launch.el')
-rw-r--r--robot/org-drill-launch.el31
1 files changed, 31 insertions, 0 deletions
diff --git a/robot/org-drill-launch.el b/robot/org-drill-launch.el
new file mode 100644
index 0000000..bab57ec
--- /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))))