[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup 9dda405 320/340: Document use with Eldev
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup 9dda405 320/340: Document use with Eldev |
Date: |
Thu, 16 Dec 2021 14:59:59 -0500 (EST) |
branch: elpa/buttercup
commit 9dda40525ac044f20b1b8d76c4576d21e7d8ad17
Author: Paul Pogonyshev <pogonyshev@gmail.com>
Commit: Paul Pogonyshev <pogonyshev@gmail.com>
Document use with Eldev
---
docs/running-tests.md | 86 +++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 84 insertions(+), 2 deletions(-)
diff --git a/docs/running-tests.md b/docs/running-tests.md
index 2280241..4ce580d 100644
--- a/docs/running-tests.md
+++ b/docs/running-tests.md
@@ -16,7 +16,7 @@ only those, and test your project in a well-defined
environment.
Buttercup works best in such environments, so the following best
practices rely on Cask to be installed.
-## Project Directory Layout
+### Project Directory Layout
A basic project layout requires a project file, called `feature.el`
here, a `Cask` file to define dependencies, and a `tests/` directory
@@ -59,7 +59,7 @@ feature/feature.el
"It's not a bug, it's a feature")))
```
-## Running Tests
+### Running Tests
You can now use Cask to run your tests.
@@ -106,6 +106,65 @@ skipped tests.
You can run this command whichever way you like. Common choices
include a makefile or shell scripts.
+## Eldev
+
+[Eldev](https://github.com/doublep/eldev) is another Elisp build tool
+and has built-in supports for Buttercup. Like Cask, it installs
+dependencies of your project automatically, ensuring consistent
+environment.
+
+### Project Directory Layout
+
+Typical project layout used for Cask also works for Eldev. However,
+the tool is very liberal and with a couple of lines you can configure
+it to handle almost any layout a project could have (see [its
+documentation](https://github.com/doublep/eldev#testing) if needed).
+
+Unlike Cask, however, Eldev needs that your test files include form
+`(require 'buttercup)`. Otherwise you will get Elisp errors like
+“Symbol’s function definition is void: describe”. Basically, Eldev
+requires that the `.el` files are *self-contained* and do not depend
+on certain external tool.
+
+### Running Tests
+
+The tool installs project dependencies automatically when needed, so
+you don’t have to bother about that. All you need to do is to ensure
+the main file of the project correctly declares them.
+
+You also don’t need to declare that the project uses Buttercup for
+testing: Eldev will determine that on-the-fly.
+
+To run your test, just execute:
+
+````
+$ eldev test
+[1/1] Installing package ‘buttercup’ (1.23) from ‘melpa-stable’...
+Running 1 specs.
+
+The feature
+ can use bug and feature (2.58ms)
+
+Ran 1 specs, 0 failed, in 2.68ms.
+````
+
+You can also specify patterns on the command line, to avoid running
+all the tests at once, i.e.:
+
+````
+$ eldev test foo
+````
+
+If you have several test files, you can avoid running all the tests by
+specifying filename after `-f` (`--file`) option:
+
+````
+$ eldev test -f main.el
+````
+
+For more information, please see tool’s own documentation, especially
+[the section about testing](https://github.com/doublep/eldev#testing).
+
## Projectile
If you use [Projectile](https://github.com/bbatsov/projectile) for interacting
with your projects you can set the "default" project test command to be
available when you invoke `projectile-test-project`. Create a `.dir-locals.el`
file in the the root of your project tree (next to your Cask file). An example:
@@ -120,6 +179,9 @@ If you use
[Projectile](https://github.com/bbatsov/projectile) for interacting w
projectile-test-cmd-map))))))
```
+If you are using Eldev as build tool, Projectile should provide
+testing command on its own, so you don’t need any special steps.
+
## Travis
If your project is hosted on github, you can use
@@ -148,3 +210,23 @@ script:
Most of the complexity here is from installing
[EVM](https://github.com/rejeep/evm) and Cask to be able to test your
project using different Emacs versions.
+
+For Eldev, use the following `.travis.yml` file:
+
+````
+language: emacs-lisp
+dist: trusty
+
+env:
+ # Add more lines like this if you want to test on different Emacs versions.
+ - EVM_EMACS=emacs-26.3-travis
+
+install:
+ - curl -fsSL
https://raw.github.com/doublep/eldev/master/webinstall/travis-eldev-and-evm >
x.sh && source ./x.sh
+ - evm install $EVM_EMACS --use
+
+script:
+ - eldev -p -dtT test
+````
+
+For details, see [tool’s own
documentation](https://github.com/doublep/eldev#continuous-integration).
- [nongnu] elpa/buttercup 0dbd474 263/340: Bump version: 1.20 → 1.21, (continued)
- [nongnu] elpa/buttercup 0dbd474 263/340: Bump version: 1.20 → 1.21, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 1c9c82f 265/340: Fixed misspelling in the documentation, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 360953b 266/340: test: Only run tests found in the tests/ directory, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 25bc00d 273/340: test: Set up suite "The batch reporter" to use fake terminal, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 5c9f80d 279/340: test: Add color tests for buttercup-suite-started and -done, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 2be9ad3 280/340: test: Add color tests for spec-done, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 0e94f6e 303/340: Lift buttercup-done handling into buttercup-reporter-batch, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup f1f403b 308/340: Remove buttercup-reporter-batch-color, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup fce5fa5 313/340: Optionally fail when loading old elc files, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6c3bb75 318/340: Accept a list of regexes in buttercup-mark-skipped, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 9dda405 320/340: Document use with Eldev,
ELPA Syncer <=
- [nongnu] elpa/buttercup 06201f2 335/340: Print :to-have-been-called-with args as sexp for consistency, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 459bffb 282/340: test: Add color tests for buttercup-done, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a1c7bff 101/340: Do not ignore errors when after-each succeeds, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b120003 108/340: Merge pull request #60 from howdoicomputer/feature/windows-bin-support, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 06c9699 104/340: Merge pull request #58 from Fuco1/to-equal-as-set, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a6d9bde 105/340: Support more emacs parameters useful for pre-test initialization, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup abf2abe 109/340: Exclude hidden files and dirs in test root, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup f60ed2a 119/340: Bump version: 1.5 → 1.6, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 677d6d3 118/340: Merge pull request #70 from xendk/color-output, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d8dc80d 126/340: Bump version: 1.6 → 1.7, ELPA Syncer, 2021/12/16