aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyril Anaclet2020-04-21 17:31:41 +0200
committerErik Martin-Dorel2020-04-29 01:59:50 +0200
commit977429b4501a6e5b7c0949ddf258f160e90fe48d (patch)
treedbfaf94cee92496e734079e79a47859183156a09
parent84b81a84db632a97cc978494f2a5609525034223 (diff)
Add a test
-rw-r--r--ci/coq-tests.el19
1 files changed, 17 insertions, 2 deletions
diff --git a/ci/coq-tests.el b/ci/coq-tests.el
index 057f918e..616e3cd4 100644
--- a/ci/coq-tests.el
+++ b/ci/coq-tests.el
@@ -9,7 +9,7 @@
(setq debug-on-error t) ; open the debugger on error -- may be commented-out
-(require 'ert-async)
+; (require 'ert-async)
;(setq ert-async-timeout 2)
;;; Code:
@@ -57,6 +57,8 @@
"Exit the Coq process."
(proof-shell-exit t))
+
+
;; AVOID THE FOLLOWING ERROR:
;; Starting: -emacs
;; Debugger entered--Lisp error: (wrong-type-argument stringp nil)
@@ -123,12 +125,25 @@
#'proof-done-invisible
'no-error-display 'no-response-display 'no-goals-display)))
+; Fixture for init and exit coq
+(defun coq-init-exit (body)
+ (unwind-protect
+ (progn (coq-test-init)
+ (funcall body))
+ (coq-test-exit)))
+
(defun coq-test-001 ()
;; TODO: retrieve the test status, maybe by changing the function above
- (coq-test-cmd "Print nat."))
+ (coq-test-cmd (process-list)))
;; TODO: Use https://github.com/rejeep/ert-async.el
;; and/or ERT https://www.gnu.org/software/emacs/manual/html_node/ert/index.html
+(ert-deftest coq-test-running ()
+ (coq-init-exit
+ (lambda ()
+ (coq-test-cmd "Check 0.")
+ (should (get-process "coq")))))
+
(defun coq-test-main ()
(coq-mock #'coq-test-001))