emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/gnuplot 1dd661e 180/184: Fix testing in Github CI. Simplif


From: ELPA Syncer
Subject: [nongnu] elpa/gnuplot 1dd661e 180/184: Fix testing in Github CI. Simplify compilation and testing process.
Date: Sun, 29 Aug 2021 11:03:41 -0400 (EDT)

branch: elpa/gnuplot
commit 1dd661eb40afc6d70167d24b6b5277ecf873d936
Author: mtreca <maxime.treca@gmail.com>
Commit: mtreca <maxime.treca@gmail.com>

    Fix testing in Github CI. Simplify compilation and testing process.
    
    Remove Cask and its dependencies for now, and simplify the
    compilation/testing process. Make compile byte-compiles all files,
    make test runs ERT tests. Fix various imports and warnings.
---
 .github/workflows/test.yml |  7 +++++--
 Cask                       |  7 -------
 Makefile                   | 43 +++++++++++++------------------------------
 dot.el                     |  8 --------
 gnuplot-context.el         | 35 ++++++++++++-----------------------
 gnuplot-debug-context.el   |  6 +++---
 gnuplot-gui.el             |  4 ++--
 gnuplot-test-context.el    |  2 +-
 gnuplot-tests.el           |  3 +--
 gnuplot.el                 |  4 ++--
 tests/gnuplot-test.el      | 40 ----------------------------------------
 11 files changed, 39 insertions(+), 120 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index c02ec5c..79bb4eb 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -28,10 +28,13 @@ jobs:
         version: ${{ matrix.emacs_version }}
     - uses: conao3/setup-cask@master
 
+    - name: Install Gnuplot
+      run: sudo apt update && sudo apt install gnuplot
+
     - name: Run tests
       if: matrix.allow_failure != true
-      run: 'cask && cask build && cask exec buttercup -L .'
+      run: 'make && make test'
 
     - name: Run tests (allow failure)
       if: matrix.allow_failure == true
-      run: 'cask && cask build && cask exec buttercup -L . || true'
+      run: 'make && make test || true'
diff --git a/Cask b/Cask
deleted file mode 100644
index aab2b91..0000000
--- a/Cask
+++ /dev/null
@@ -1,7 +0,0 @@
-(source gnu)
-(source melpa)
-
-(package-file "gnuplot.el")
-
-(development
- (depends-on "buttercup"))
diff --git a/Makefile b/Makefile
index f18d0b8..5e21cb2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,38 +1,21 @@
-# -*- mode: makefile -*-
-
 EMACS ?= emacs
 
-## You will probably not need to change anything below this line
-
-BYTE = $(EMACS) -batch -q -no-site-file -l dot.el -f batch-byte-compile
-
-.PHONY: all default clean pdf ps
-
-default: gnuplot.elc gnuplot-gui.elc gnuplot-context.elc
-
-pdf: gpelcard.pdf
-
-ps: gpelcard.ps
-
-all: gnuplot.elc gnuplot-gui.elc gnuplot-context.elc gpelcard.pdf gpelcard.ps
-
-%.elc: %.el
-       $(BYTE) "$<"
+LOAD = -l gnuplot \
+       -l gnuplot-context \
+       -l gnuplot-debug-context \
+       -l gnuplot-gui \
+       -l gnuplot-tests \
+       -l gnuplot-test-context
 
-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-")'
+.PHONY: all default clean
 
-gpelcard.ps: gpelcard.dvi
-       dvips -o gpelcard.ps gpelcard.dvi
+default: compile
 
-gpelcard.pdf: gpelcard.tex
-       pdflatex gpelcard.tex
+test:
+       $(EMACS) -batch -L . $(LOAD) -f ert-run-tests-batch-and-exit
 
-gpelcard.dvi: gpelcard.tex
-        latex gpelcard.tex
+compile:
+       $(EMACS) -batch -L . -f batch-byte-compile *.el
 
 clean:
-       rm -f *.elc gpelcard.dvi gpelcard.log gpelcard.aux
+       rm -f *.elc
diff --git a/dot.el b/dot.el
deleted file mode 100644
index 1d6b88b..0000000
--- a/dot.el
+++ /dev/null
@@ -1,8 +0,0 @@
-;; These are some lines to help compilation of gnuplot-mode proceed
-;; with fewer warning messages
-(setq load-path             (append (list ".") load-path)
-      byte-compile-verbose  nil
-      byte-compile-warnings nil)
-
-(load "gnuplot")
-(load "gnuplot-context")
diff --git a/gnuplot-context.el b/gnuplot-context.el
index e688cff..8911003 100644
--- a/gnuplot-context.el
+++ b/gnuplot-context.el
@@ -230,22 +230,11 @@
 
 ;;; Code:
 
-
-;; Library dependencies
-(eval-when-compile
-  (require 'cl-lib)
-
-  ;; Prevent compiler warnings about undefined functions
-  (require 'gnuplot))
-
-;; We need ElDoc support
+(require 'cl-lib)
+(require 'gnuplot)
 (require 'eldoc)
-
-;; Compatibility for Emacs version < 23
-(eval-when-compile
-  (when (not (fboundp 'string-match-p))
-    (defmacro string-match-p (&rest args)
-      `(save-match-data (string-match ,@args)))))
+(require 'info)
+(require 'info-look)
 
 
 ;;;; The tokenizer.
@@ -498,7 +487,7 @@ name; otherwise continues tokenizing up to the token at 
point.  FIXME."
 
             (t              ; two patterns
              (let* ((pat1 (cadr pat))
-                    (pat2 (caddr pat))
+                    (pat2 (cl-caddr pat))
                     (pat1-c (gnuplot-compile-pattern pat1))
                     (pat2-c (gnuplot-compile-pattern pat2))
                     (pat1-l (length pat1-c))
@@ -536,7 +525,7 @@ name; otherwise continues tokenizing up to the token at 
point.  FIXME."
           ;; Syntactic sugar for delimited lists
           ((delimited-list)
            (let* ((item (cadr pat))
-                  (sep (caddr pat)))
+                  (sep (cl-caddr pat)))
              (gnuplot-compile-pattern
               `(sequence ,item (many (sequence ,sep ,item))))))
 
@@ -1827,7 +1816,7 @@ there."
               ;; (literal LITERAL NO-COMPLETE)
               ((literal)
                (let ((expect (cadr inst))
-                     (no-complete (caddr inst)))
+                     (no-complete (cl-caddr inst)))
                  (cond (end-of-tokens
                         (unless no-complete
                           (gnuplot-trace "\tpushing \"%s\" to completions\n" 
expect)
@@ -1852,7 +1841,7 @@ there."
               ;; regexp-matches REGEXP, use NAME for completions
               ((keyword)
                (let ((regexp (cadr inst))
-                     (name (caddr inst)))
+                     (name (cl-caddr inst)))
                  (cond (end-of-tokens
                         (gnuplot-trace "\tpushing \"%s\" to completions\n" 
name)
                         (push name gnuplot-completions)
@@ -1929,7 +1918,7 @@ there."
               ;; onto the stack
               ((push)
                (let* ((type (cadr inst))
-                      (value (caddr inst)))
+                      (value (cl-caddr inst)))
                  (push `(,type ,value ,tokens) stack)))
 
               ;; (pop TYPE): pop something off the stack
@@ -1953,7 +1942,7 @@ there."
                       (record (assoc name gnuplot-captures)))
                  (if (not record)
                      (error "Gnuplot-match-tokens: no open capture group named 
%s" name)
-                   (setf (caddr record) tokens)
+                   (setf (cl-caddr record) tokens)
                    (gnuplot-debug (gnuplot-dump-captures)))))
 
               ;; (check-progress): make sure not stuck in an infinite loop
@@ -2003,7 +1992,7 @@ there."
                 (not (and gnuplot-info-at-point gnuplot-eldoc)))
       (let* ((item (car stack))
              (type (car item))
-             (position (caddr item))) ; must progress by at least one token
+             (position (cl-caddr item))) ; must progress by at least one token
         (if (and (memq type '(info eldoc no-scan))
                  (not (eq position tokens)))
             (cl-case type
@@ -2041,7 +2030,7 @@ there."
   (let ((record (assoc name gnuplot-captures)))
     (if (not record) nil
       (let ((begin (cadr record))
-            (end (caddr record))
+            (end (cl-caddr record))
             (accum '()))
         (while (and begin (not (eq begin end)))
           (push (pop begin) accum))
diff --git a/gnuplot-debug-context.el b/gnuplot-debug-context.el
index 8bca418..8ac2dbd 100644
--- a/gnuplot-debug-context.el
+++ b/gnuplot-debug-context.el
@@ -2,7 +2,7 @@
 ;; debugging utilities for the gnuplot-mode context matcher
 ;;
 
-(require 'gnuplot-test-context)        ; for gnuplot-simplify-tokens
+(require 'gnuplot-test-context) ; for gnuplot-simplify-tokens
 
 (defun gnuplot-unload ()
   (interactive)
@@ -65,7 +65,7 @@
                          (if (eq (car x) 'return)
                              x
                            (list (car x) (cadr x)
-                                 (gnuplot-simplify-tokens (caddr x)))))))
+                                 (gnuplot-simplify-tokens (cl-caddr x)))))))
        (insert "-- end backtrace  --\n"))))
 
 (defun gnuplot-dump-backtrack (backtrack)
@@ -73,7 +73,7 @@
       (with-gnuplot-trace-buffer
        (insert "\n-- * backtrack records: * --\n")
        (dolist (x backtrack)
-         (insert (format "%s\t%s\n" (caddr x) (gnuplot-simplify-tokens (cadr 
x)))))
+         (insert (format "%s\t%s\n" (cl-caddr x) (gnuplot-simplify-tokens 
(cadr x)))))
        (insert "-- end backtrack records  --\n\n"))))
 
 (defun gnuplot-dump-progress (progress)
diff --git a/gnuplot-gui.el b/gnuplot-gui.el
index 7a6ca67..8194cc6 100644
--- a/gnuplot-gui.el
+++ b/gnuplot-gui.el
@@ -1110,8 +1110,8 @@ arguments."
             (if (and (string= prefix (car temp-list))
                      (string-match "^[-0-9.]+$" (cadr temp-list)))
                 (let ((this-car (cadr temp-list))
-                      (this-cdr (if (string-match "^[-0-9.]+$" (caddr 
temp-list))
-                                    (caddr temp-list) "")))
+                      (this-cdr (if (string-match "^[-0-9.]+$" (cl-caddr 
temp-list))
+                                    (cl-caddr temp-list) "")))
                   (setq this-cons (cons tag (cons this-car this-cdr))
                         temp-list nil))
               (setq temp-list (cdr temp-list))))
diff --git a/gnuplot-test-context.el b/gnuplot-test-context.el
index 2efe7c1..baa0eef 100644
--- a/gnuplot-test-context.el
+++ b/gnuplot-test-context.el
@@ -32,7 +32,7 @@
 (defun gnuplot-simplify-tokens (tokens)
   (mapcar
    (lambda (token)
-     (case (gnuplot-token-type token)
+     (cl-case (gnuplot-token-type token)
        (number
         (string-to-number (gnuplot-token-id token)))
 
diff --git a/gnuplot-tests.el b/gnuplot-tests.el
index 46b5962..858000b 100644
--- a/gnuplot-tests.el
+++ b/gnuplot-tests.el
@@ -3,9 +3,8 @@
 ;;; Currently these attempt to cover the correct identification of
 ;;; string and comment syntax.
 
-(require 'gnuplot)
 (require 'ert)
-(eval-when-compile (require 'cl-lib))
+(require 'cl-lib)
 
 ;; Hide an annoying interactive message during batch testing
 (when (require 'nadvice nil t)
diff --git a/gnuplot.el b/gnuplot.el
index be18573..6ffa1a8 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -1777,7 +1777,7 @@ updates Gnuplot with the appropriate 'set output' 
command."
             (when (and size (> size 0))
               (gnuplot-send-hiding-output "set output\n") ; Flush output file
               (sit-for 0.1)             ; Hack: wait for Gnuplot IO to finish
-              (ecase gnuplot-inline-image-mode
+              (cl-ecase gnuplot-inline-image-mode
                 (nil nil)
                 (inline
                   (ignore-errors
@@ -2324,7 +2324,7 @@ the height of the frame.
 
 The *info* buffer should already exist when this function is
 called."
-  (case gnuplot-info-display
+  (cl-case gnuplot-info-display
     (window
      (switch-to-buffer-other-window "*info*")
      ;; Adjust window height only if the frame is split
diff --git a/tests/gnuplot-test.el b/tests/gnuplot-test.el
deleted file mode 100644
index e08de85..0000000
--- a/tests/gnuplot-test.el
+++ /dev/null
@@ -1,40 +0,0 @@
-;;; gnuplot-test.el ---                             -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2020  Naoya Yamashita
-
-;; Author: Naoya Yamashita <conao3@gmail.com>
-
-;; 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:
-
-;;
-
-
-;;; Code:
-
-(require 'buttercup)
-(require 'gnuplot)
-
-(describe "A suite"
-  (it "contains a spec with an expectation"
-      (expect t :to-be t)))
-
-;; (provide 'gnuplot-test)
-
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; End:
-
-;;; gnuplot-test.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]