[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gnuplot 5efb8a9 112/184: Add Makefile targets to run all t
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gnuplot 5efb8a9 112/184: Add Makefile targets to run all tests |
Date: |
Sun, 29 Aug 2021 11:03:26 -0400 (EDT) |
branch: elpa/gnuplot
commit 5efb8a904039001ecf962f936b6f24576e34d2df
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Add Makefile targets to run all tests
---
Makefile.am | 6 ++++++
Makefile.dst | 16 ++++++++--------
gnuplot-test-context.el | 29 +++++++++++++++++++----------
3 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 32c2620..b500d48 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,4 +31,10 @@ DISTCLEANFILES =
pdf: gpelcard.pdf
ps: gpelcard.ps
+test: gnuplot.elc gnuplot-context.elc gnuplot-tests.elc
gnuplot-test-context.elc
+ emacs --batch -L . \
+ --load=gnuplot-tests \
+ --load=gnuplot-test-context \
+ --eval='(ert-run-tests-batch "^gnuplot-")'
+
SUFFIXES = .el .elc .pdf .ps .tex
diff --git a/Makefile.dst b/Makefile.dst
index 1f22dc4..1d70915 100644
--- a/Makefile.dst
+++ b/Makefile.dst
@@ -1,7 +1,7 @@
# -*- mode: makefile -*-
## Set this variable to "xemacs" if you use XEmacs
-EMACS = emacs
+EMACS ?= emacs
## You will probably not need to change anything below this line
@@ -17,14 +17,14 @@ ps: gpelcard.ps
all: gnuplot.elc gnuplot-gui.elc gnuplot-context.elc gpelcard.pdf gpelcard.ps
-gnuplot.elc: gnuplot.el
- $(BYTE) gnuplot.el
+%.elc: %.el
+ $(BYTE) "$<"
-gnuplot-gui.elc: gnuplot-gui.el
- $(BYTE) gnuplot-gui.el
-
-gnuplot-context.elc: gnuplot-context.el
- $(BYTE) gnuplot-context.el
+test: gnuplot.elc gnuplot-context.elc gnuplot-tests.elc
gnuplot-test-context.elc
+ $(EMACS) --batch -L . \
+ --load=gnuplot-tests \
+ --load=gnuplot-test-context \
+ --eval='(ert-run-tests-batch "^gnuplot-")'
gpelcard.ps: gpelcard.dvi
dvips -o gpelcard.ps gpelcard.dvi
diff --git a/gnuplot-test-context.el b/gnuplot-test-context.el
index af19afa..e4a1314 100644
--- a/gnuplot-test-context.el
+++ b/gnuplot-test-context.el
@@ -2,12 +2,19 @@
;; automated tests for gnuplot-mode context matching
;;
-(require 'gnuplot-context)
+;; Because of eval-when-compile clauses, these tests only run when the
+;; interpreted version of "gnuplot-context" is loaded. TODO: Fix
+;; this. :-/
+(require 'gnuplot-context "gnuplot-context.el")
+
(require 'ert)
(eval-when-compile
(if (not (fboundp 'ert-deftest))
- (defalias 'ert-deftest 'deftest)))
+ (defalias 'ert-deftest 'deftest))
+
+ (if (not (fboundp 'line-number-at-pos))
+ (defalias 'line-number-at-pos 'line-number)))
(defun gnuplot-run-tests ()
(interactive)
@@ -331,11 +338,6 @@
("cntrparam levels 10")
("cntrparam levels incremental 100,50")))
-;;; parse all the demos
-(ert-deftest gnuplot-test-all-demos ()
- (should (> (gnuplot-test-parse-all-demos)
- .83)))
-
;;
@@ -347,14 +349,21 @@
;;
;; Set this to wherever the gnuplot demos are
-(defvar gnuplot-demo-dir "~/dev/gnuplot/demo/")
+(defvar gnuplot-demo-dir (getenv "GNUPLOT_DEMO_DIR"))
(defvar gnuplot-test-result-buffer "*gnuplot parse test results*")
(defvar gnuplot-test-count 0)
(defvar gnuplot-test-success-count 0)
-(if (not (fboundp 'line-number-at-pos))
- (defalias 'line-number-at-pos 'line-number))
+(ert-deftest gnuplot-test-all-demos ()
+ (let ((demo-dir-exists (and (stringp gnuplot-demo-dir)
+ (file-directory-p gnuplot-demo-dir))))
+ (unless demo-dir-exists
+ (message "Directory `%s' not found, skipping test" gnuplot-demo-dir)
+ (message "(Set the environment variable GNUPLOT_DEMO_DIR to run it.)"))
+ (skip-unless demo-dir-exists)
+ (should (> (gnuplot-test-parse-all-demos)
+ .83))))
(defun gnuplot-test-parse-all-demos ()
(interactive)
- [nongnu] elpa/gnuplot 7e33d0d 087/184: three fixes: indentation, require cl macros, fix defc, (continued)
- [nongnu] elpa/gnuplot 7e33d0d 087/184: three fixes: indentation, require cl macros, fix defc, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 9dd0e15 096/184: Avoid having text syntax-property changes mark buffer as modified, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot c52bb6c 089/184: grammar fixes for new-style if statement and blocks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot e457287 099/184: Add aclocal.m4 into repository, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot f5c4437 100/184: Reduce autotools dependency to version 2.61, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot e1ee092 097/184: Merge branch 'devel' containing 0.7 release candidate., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot d9ed05b 105/184: remove broken link from readme, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot aefd4f6 106/184: Cleanup version numbers and copyright dates, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 4858b0d 110/184: Set syntax table in comint buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot c2aedf8 111/184: Add ERT tests to check comment and string syntax., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 5efb8a9 112/184: Add Makefile targets to run all tests,
ELPA Syncer <=
- [nongnu] elpa/gnuplot ed930f3 116/184: Fix compile errors when testing from command line, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 2f36b36 118/184: Update Makefile.in, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot a50ac2b 119/184: Add autoloaded `run-gnuplot` command, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot d0828c0 126/184: Make gnuplot-context-sensitive-mode a normal minor mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 71e3174 129/184: Remove un-needed run-after-load hackery, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot d899379 123/184: Clarify comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 536f2c3 122/184: Put alias for missing syntax-ppss with the other workarounds, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot b6eea0b 133/184: Add :set function for customizing context-sensitive mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot c4d464a 125/184: Use `gnuplot-completion-at-point-function' instead of advice hackery, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot da11bfa 128/184: New customize option `gnuplot-use-context-sensitive-completion', ELPA Syncer, 2021/08/29