Browse Source

Switch from Cask to Eldev

Ryan C. Thompson 5 years ago
parent
commit
fcec4c6f1e
11 changed files with 45 additions and 74 deletions
  1. 3 1
      .gitignore
  2. 8 19
      .travis.yml
  3. 10 0
      001-setup-undercover.el
  4. 0 13
      Cask
  5. 13 0
      Eldev
  6. 5 0
      Eldev-flx-ido
  7. 0 28
      Makefile
  8. 4 8
      README.md
  9. 1 1
      ido-completing-read+.el
  10. 1 1
      ido-ubiquitous.el
  11. 0 3
      tests/setup-undercover.el

+ 3 - 1
.gitignore

@@ -1 +1,3 @@
-/.cask
+# Added automatically by `eldev init'.
+/.eldev
+/Eldev-local

+ 8 - 19
.travis.yml

@@ -10,7 +10,7 @@ env:
     - EMACS_CI=emacs-26-1
     - EMACS_CI=emacs-26-2
     - EMACS_CI=emacs-26-3
-    - EMACS_CI=emacs-snapshot
+    # - EMACS_CI=emacs-snapshot
 
 matrix:
   allow_failures:
@@ -24,24 +24,13 @@ before_script:
     travis-wait-enhanced --version
   # Install nix-emacs-ci
   - bash <(curl https://raw.githubusercontent.com/purcell/nix-emacs-ci/master/travis-install)
-  # Install cask
-  - curl -fsSkL https://raw.github.com/cask/cask/master/go | python
-  - export PATH="$HOME/.cask/bin:$PATH"
-  # Fix cask (See https://github.com/cask/cask/issues/399#issuecomment-331640427)
-  - perl -ibak -lape 's{#!/usr/bin/env python}{#!/usr/bin/python}' "$(which cask)"
-  # Check that cask is finding the right emacs
-  - cask emacs --version
-  # Use version-specific Cask file if it exists
-  - if [ -e "Cask-$EMACS_CI" ]; then cp "Cask-$EMACS_CI" "Cask"; fi
+  # Install Eldev
+  - curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/travis-eldev > x.sh && source ./x.sh
   # Install elisp dependencies
-  - cask install
+  - eldev prepare test
 
 script:
-  - travis-wait-enhanced --timeout=3m -- make compile
-  # Don't send redundant coverage info
-  - UNDERCOVER_CONFIG='((:send-report nil))' travis-wait-enhanced --timeout=3m -- make test
-  # For some reason emacs-git-snapshot hangs forever on this step
-  - |
-    if [ "$EMACS_CI" != emacs-snapshot ]; then
-      travis-wait-enhanced --timeout=3m -- make test-with-flx;
-    fi
+  # Run flx-ido tests in source mode for undercover's benefit
+  - travis-wait-enhanced --timeout=3m -- eldev -s -dtT -S '(load-file "Eldev-flx-ido")' test
+  # Packaged mode, don't run undercover or flx-ido
+  - travis-wait-enhanced --timeout=3m -- eldev -p -dtT test

+ 10 - 0
001-setup-undercover.el

@@ -0,0 +1,10 @@
+;; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*-
+
+
+(when (featurep 'ido-completing-read+)
+  (error "Undercover loaded too late"))
+(message "Setting up undercover")
+(require 'undercover)
+(defadvice undercover--edebug-files (before echo-instrumented-files activate)
+  (message "Undercover instrumenting the following files: %S" files))
+(undercover "ido-completing-read+.el")

+ 0 - 13
Cask

@@ -1,13 +0,0 @@
-(source gnu)
-(source melpa)
-
-(package-file "ido-completing-read+.el")
-(files "ido-completing-read+.el" "ido-ubiquitous.el")
-
-(depends-on "memoize" "1.1")
-
-(development
- (depends-on "flx-ido")
- (depends-on "with-simulated-input" "2.2")
- (depends-on "buttercup" "1.9")
- (depends-on "undercover"))

+ 13 - 0
Eldev

@@ -0,0 +1,13 @@
+;; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*-
+
+(eldev-use-package-archive 'gnu)
+(eldev-use-package-archive 'melpa-stable)
+
+(setq eldev-project-main-file "ido-completing-read+.el")
+(setq eldev-main-fileset '("ido-completing-read+.el" "ido-ubiquitous.el"))
+
+(setq eldev-test-framework 'buttercup)
+
+(eldev-add-extra-dependencies 'test 'flx-ido)
+(eldev-add-extra-dependencies 'test 'with-simulated-input)
+(eldev-add-extra-dependencies 'test 'undercover)

+ 5 - 0
Eldev-flx-ido

@@ -0,0 +1,5 @@
+;; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*-
+
+;; This file is meant to be loaded with `eldev -S' to run the flx-ido
+;; tests instead of the regular ones.
+(setq eldev-test-fileset '("./001-setup-undercover.el" "./tests-with-flx-ido/" "./tests/"))

+ 0 - 28
Makefile

@@ -1,28 +0,0 @@
-ELISP_FILES := $(shell cask files)
-ELC_FILES := $(patsubst %.el,%.elc,$(ELISP_FILES))
-
-.PHONY: test compile clean
-.INTERMEDIATE: .compile.intermediate
-
-all: test
-
-# We run clean-elc first because undercover.el doesn't support elc
-# files. We run the tests first without loading flx-ido, and then with
-# it. We only send the coverage report when running the full test
-# suite.
-test: clean
-	cask exec buttercup -L . tests
-
-test-with-flx: clean
-	cask exec buttercup -l tests/setup-undercover.el -L . tests tests-with-flx-ido
-
-all-tests: test test-with-flx
-
-compile: $(ELC_FILES)
-
-$(ELC_FILES): .compile.intermediate
-.compile.intermediate: $(ELISP_FILES)
-	cask build
-
-clean:
-	cask clean-elc

+ 4 - 8
README.md

@@ -250,11 +250,7 @@ Otherwise, normal users don't need to think about this branch.
 ## Running the tests
 
 This package comes with a test suite. If you want to run it yourself,
-first install the [cask](http://cask.readthedocs.io/en/latest/)
-dependency manager. Then, from the package directory, run `cask
-install` to install all the development dependencies, in
-particular
-[buttercup](https://github.com/jorgenschaefer/emacs-buttercup).
-Finally, to run the tests, execute `cask exec buttercup -L .`. Please
-run this test suite before submitting any pull requests, and note in
-the pull request whether any of the tests fail.
+first install the [Eldev](https://github.com/doublep/eldev), then use
+`eldev test` to run the tests. Please run this test suite before
+submitting any pull requests, and note in the pull request whether any
+of the tests fail.

+ 1 - 1
ido-completing-read+.el

@@ -6,7 +6,7 @@
 ;; Author: Ryan Thompson
 ;; Created: Sat Apr  4 13:41:20 2015 (-0700)
 ;; Version: 4.13
-;; Package-Requires: ((emacs "24.4") (cl-lib "0.5") (s "0.1") (memoize "1.1"))
+;; Package-Requires: ((emacs "24.4") (cl-lib "0.5") (memoize "1.1"))
 ;; URL: https://github.com/DarwinAwardWinner/ido-completing-read-plus
 ;; Keywords: ido, completion, convenience
 

+ 1 - 1
ido-ubiquitous.el

@@ -8,7 +8,7 @@
 ;; Created: 2011-09-01
 ;; Keywords: convenience, completion, ido
 ;; EmacsWiki: InteractivelyDoThings
-;; Package-Requires: ((ido-completing-read+ "4.13") (cl-lib "0.5"))
+;; Package-Requires: ((ido-completing-read+ "4.13"))
 ;; Filename: ido-ubiquitous.el
 
 ;; This file is NOT part of GNU Emacs.

+ 0 - 3
tests/setup-undercover.el

@@ -1,3 +0,0 @@
-(require 'undercover)
-(undercover "*.el"
-            (:exclude "test-*.el"))