aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Lord <phillip.lord@russet.org.uk>2019-06-02 17:25:56 +0100
committerPhillip Lord <phillip.lord@russet.org.uk>2019-06-02 17:25:56 +0100
commit939f2a65b2e5097d56d3c4422aa3a11e4d71d6ff (patch)
tree9118ee405563fb869a7c8a1d0e5350c4ea365184
parent6959903b99fce6cbf4db93711e95117fd5cd879d (diff)
downloadorg-drill-939f2a65b2e5097d56d3c4422aa3a11e4d71d6ff.tar.gz
org-drill-939f2a65b2e5097d56d3c4422aa3a11e4d71d6ff.zip
Enable cask testing
- Update headers to standard - Add Makefile, Cask and docker scripts - Add test directory - .gitignore
-rw-r--r--.gitignore1
-rw-r--r--Cask8
-rw-r--r--Makefile36
-rw-r--r--org-drill.el97
-rw-r--r--test-by-cp9
-rw-r--r--test-from-git7
-rw-r--r--test/org-drill-test.el32
7 files changed, 145 insertions, 45 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..176df11
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/.cask
diff --git a/Cask b/Cask
new file mode 100644
index 0000000..e0eabf8
--- /dev/null
+++ b/Cask
@@ -0,0 +1,8 @@
+(source gnu)
+(source melpa)
+(source org)
+
+(package-file "org-drill.el")
+
+(development
+ (depends-on "assess" "org-mode-plus-contrib"))
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..68a9ccf
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+EMACS ?= emacs
+CASK ?= cask
+
+-include makefile-local
+
+ifdef EMACS
+EMACS_ENV=EMACS=$(EMACS)
+endif
+
+all:
+
+install:
+ $(EMACS_ENV) $(CASK) install
+
+test: install just-test
+
+just-test:
+ $(EMACS_ENV) $(CASK) emacs --batch -q \
+ --directory=. \
+ --load assess-discover.el \
+ --eval '(assess-discover-run-and-exit-batch t)'
+
+DOCKER_TAG=26
+test-cp:
+ docker run -it --rm --name docker-cp -v $(PWD):/usr/src/app -w /usr/src/app --entrypoint=/bin/bash silex/emacs:$(DOCKER_TAG)-dev ./test-by-cp
+
+test-git:
+ docker run -it --rm --name docker-git -v $(PWD):/usr/src/app -w /usr/src/app --entrypoint=/bin/bash silex/emacs:$(DOCKER_TAG)-dev ./test-from-git
+
+docker-test:
+ $(MAKE) test-git DOCKER_TAG=26.2
+ $(MAKE) test-cp DOCKER_TAG=26.2
+ $(MAKE) test-git DOCKER_TAG=25.3
+ $(MAKE) test-cp DOCKER_TAG=25.3
+
+.PHONY: test
diff --git a/org-drill.el b/org-drill.el
index 4bc8dde..1d47aa0 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -1,48 +1,54 @@
-;;; -*- coding: utf-8-unix -*-
-;;; org-drill.el - Self-testing using spaced repetition
-;;;
-;;; Copyright (C) 2010-2015 Paul Sexton
-;;;
-;;; Author: Paul Sexton <eeeickythump@gmail.com>
-;;; Version: 2.6.1
-;;; Keywords: flashcards, memory, learning, memorization
-;;; Repository at http://bitbucket.org/eeeickythump/org-drill/
-;;;
-;;; This file is not part of GNU Emacs.
-;;;
-;;; This program is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation, either version 3 of the License, or
-;;; (at your option) any later version.
-;;;
-;;; This program is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-;;;
-;;;
-;;; Synopsis
-;;; ========
-;;;
-;;; Within an Org mode outline or outlines, headings and associated content are
-;;; treated as "flashcards". Spaced repetition algorithms are used to conduct
-;;; interactive "drill sessions", where a selection of these flashcards is
-;;; presented to the student in random order. The student rates his or her
-;;; recall of each item, and this information is used to schedule the item for
-;;; later revision.
-;;;
-;;; Each drill session can be restricted to topics in the current buffer
-;;; (default), one or several files, all agenda files, or a subtree. A single
-;;; topic can also be tested.
-;;;
-;;; Different "card types" can be defined, which present their information to
-;;; the student in different ways.
-;;;
-;;; See the file README.org for more detailed documentation.
+;;; org-drill.el --- Self-testing using spaced repetition -*- coding: utf-8-unix -*-
+;;; Header:
+
+;; Maintainer: Phillip Lord <phillip.lord@russet.org.uk>
+;; Author: Paul Sexton <eeeickythump@gmail.com>
+;; Version: 2.7
+;; Package-Requires: ((emacs "25.3") (seq "2.14"))
+;; Keywords: flashcards, memory, learning, memorization
+;; Repository at https://gitlab.com/phillord/org-drill/issues
+;;
+;; This file is not part of GNU Emacs.
+;;
+;; Copyright (C) 2018-2019 Phillip Lord
+;; Copyright (C) 2010-2015 Paul Sexton
+;;
+;;
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+;;
+;;
+
+;;; Commentary:
+;;
+;; Within an Org mode outline or outlines, headings and associated content are
+;; treated as "flashcards". Spaced repetition algorithms are used to conduct
+;; interactive "drill sessions", where a selection of these flashcards is
+;; presented to the student in random order. The student rates his or her
+;; recall of each item, and this information is used to schedule the item for
+;; later revision.
+;;
+;; Each drill session can be restricted to topics in the current buffer
+;; (default), one or several files, all agenda files, or a subtree. A single
+;; topic can also be tested.
+;;
+;; Different "card types" can be defined, which present their information to
+;; the student in different ways.
+;;
+;; See the file README.org for more detailed documentation.
+
+;;; Code:
(eval-when-compile (require 'cl))
(eval-when-compile (require 'hi-lock))
@@ -50,7 +56,7 @@
(require 'hi-lock)
(require 'org)
(require 'org-id)
-(require 'org-learn)
+;;(require 'org-learn)
(require 'savehist)
(require 'seq)
@@ -3996,3 +4002,4 @@ shuffling is done in place."
(sit-for 0.3))
(provide 'org-drill)
+;;; org-drill.el ends here
diff --git a/test-by-cp b/test-by-cp
new file mode 100644
index 0000000..9b73f56
--- /dev/null
+++ b/test-by-cp
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+cd ..
+mkdir copy
+cd copy
+cp -rf ../app/* .
+rm makefile-local
+
+make test
diff --git a/test-from-git b/test-from-git
new file mode 100644
index 0000000..681f81e
--- /dev/null
+++ b/test-from-git
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+cd ..
+mkdir git
+cd git
+git clone ../app .
+make test \ No newline at end of file
diff --git a/test/org-drill-test.el b/test/org-drill-test.el
new file mode 100644
index 0000000..74df027
--- /dev/null
+++ b/test/org-drill-test.el
@@ -0,0 +1,32 @@
+;;; lentic-test.el --- Tests
+
+;;; Header:
+
+;; This file is not part of Emacs
+
+;; Author: Phillip Lord <phillip.lord@russet.org.uk>
+;; Maintainer: Phillip Lord <phillip.lord@russet.org.uk>
+
+;; The contents of this file are subject to the GPL License, Version 3.0.
+
+;; Copyright (C) 2014, 2015, 2016, Phillip Lord, Newcastle University
+
+;; This program is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'org-drill)
+
+(ert-deftest hello-world ()
+ (should t))