From 481ca480e8b7b6c90881f8bd8434addab1d33778 Mon Sep 17 00:00:00 2001 From: p4v4n Date: Sun, 5 Nov 2023 18:24:09 +0530 Subject: Use Eldev (#669) Closes https://github.com/clojure-emacs/clojure-mode/issues/666 --- test/clojure-mode-bytecomp-warnings.el | 40 ---------------------------- test/clojure-mode-convert-collection-test.el | 1 + test/clojure-mode-refactor-add-arity-test.el | 1 + test/clojure-mode-util-test.el | 2 +- test/test-checks.el | 30 --------------------- test/utils/test-helper.el | 2 +- 6 files changed, 4 insertions(+), 72 deletions(-) delete mode 100644 test/clojure-mode-bytecomp-warnings.el delete mode 100644 test/test-checks.el (limited to 'test') diff --git a/test/clojure-mode-bytecomp-warnings.el b/test/clojure-mode-bytecomp-warnings.el deleted file mode 100644 index 41b3230..0000000 --- a/test/clojure-mode-bytecomp-warnings.el +++ /dev/null @@ -1,40 +0,0 @@ -;;; clojure-mode-bytecomp-warnings.el --- Check for byte-compilation problems -*- lexical-binding: t; -*- - -;; Copyright © 2012-2021 Bozhidar Batsov and contributors -;; -;; 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 . - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; This is a script to be loaded while visiting a `clojure-mode' source file. -;; It will prepare all requirements and then byte-compile the file and signal an -;; error on any warning. For example: -;; -;; emacs -Q --batch -l test/clojure-mode-bytecomp-warnings.el clojure-mode.el - -;; This assumes that all `clojure-mode' dependencies are already on the package -;; dir (probably from running `cask install'). - -(setq load-prefer-newer t) -(add-to-list 'load-path (expand-file-name "./")) -(require 'package) -(package-generate-autoloads 'clojure-mode default-directory) -(package-initialize) -(load-file "clojure-mode-autoloads.el") -(setq byte-compile-error-on-warn t) -(batch-byte-compile) - -;;; clojure-mode-bytecomp-warnings.el ends here diff --git a/test/clojure-mode-convert-collection-test.el b/test/clojure-mode-convert-collection-test.el index 28c5977..14e5291 100644 --- a/test/clojure-mode-convert-collection-test.el +++ b/test/clojure-mode-convert-collection-test.el @@ -27,6 +27,7 @@ (require 'clojure-mode) (require 'buttercup) +(require 'test-helper "test/utils/test-helper") (describe "clojure-convert-collection-to-map" (when-refactoring-it "should convert a list to a map" diff --git a/test/clojure-mode-refactor-add-arity-test.el b/test/clojure-mode-refactor-add-arity-test.el index 9c75f12..5f1c5fb 100644 --- a/test/clojure-mode-refactor-add-arity-test.el +++ b/test/clojure-mode-refactor-add-arity-test.el @@ -24,6 +24,7 @@ (require 'clojure-mode) (require 'buttercup) +(require 'test-helper "test/utils/test-helper") (describe "clojure-add-arity" diff --git a/test/clojure-mode-util-test.el b/test/clojure-mode-util-test.el index 565773d..6157a3d 100644 --- a/test/clojure-mode-util-test.el +++ b/test/clojure-mode-util-test.el @@ -46,7 +46,7 @@ (bb-edn-src (expand-file-name "src" temp-dir))) (write-region "{}" nil bb-edn) (make-directory bb-edn-src) - (expect (clojure-project-dir bb-edn-src) + (expect (expand-file-name (clojure-project-dir bb-edn-src)) :to-equal (file-name-as-directory temp-dir)))))) (describe "clojure-project-relative-path" diff --git a/test/test-checks.el b/test/test-checks.el deleted file mode 100644 index a4b4208..0000000 --- a/test/test-checks.el +++ /dev/null @@ -1,30 +0,0 @@ -;; This is a script to be loaded from the root `clojure-mode' directory. It will -*- lexical-binding: t; -*- -;; prepare all requirements and then run `check-declare-directory' on -;; `default-directory'. For example: emacs -Q --batch -l test/test-checkdoc.el - -;; This assumes that all `clojure-mode' dependencies are already on the package -;; dir (probably from running `cask install'). - -(add-to-list 'load-path (expand-file-name "./")) -(require 'package) -(require 'check-declare) -(package-initialize) - -;; disable some annoying (or non-applicable) checkdoc checks -(setq checkdoc-package-keywords-flag nil) -(setq checkdoc-arguments-in-order-flag nil) -(setq checkdoc-verb-check-experimental-flag nil) - -(let ((files (directory-files default-directory t - "\\`[^.].*\\.el\\'" t))) - - ;; `checkdoc-file' was introduced in Emacs 25 - (when (fboundp 'checkdoc-file) - (dolist (file files) - (checkdoc-file file)) - (when (get-buffer "*Warnings*") - (message "Failing due to checkdoc warnings...") - (kill-emacs 1))) - - (when (apply #'check-declare-files files) - (kill-emacs 1))) diff --git a/test/utils/test-helper.el b/test/utils/test-helper.el index b359277..e7894f0 100644 --- a/test/utils/test-helper.el +++ b/test/utils/test-helper.el @@ -26,7 +26,7 @@ (message "Running tests on Emacs %s" emacs-version) (let* ((current-file (if load-in-progress load-file-name (buffer-file-name))) - (source-directory (locate-dominating-file current-file "Cask")) + (source-directory (locate-dominating-file current-file "Eldev")) ;; Do not load outdated byte code for tests (load-prefer-newer t)) ;; Load the file under test -- cgit v1.2.3