-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from tonini/introduce-testing
Introduce testing
- Loading branch information
Showing
6 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
language: emacs-lisp | ||
|
||
env: | ||
- EMACS=emacs24 | ||
- EMACS=emacs-snapshot | ||
|
||
before_script: | ||
- export DEBIAN_FRONTEND='noninteractive' | ||
- sudo apt-add-repository -y ppa:cassou/emacs | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -yy emacs24 emacs24-el emacs24-common-non-dfsg emacs-snapshot emacs-snapshot-el | ||
|
||
script: | ||
- make EMACS=${EMACS} test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
EMACS=emacs | ||
|
||
.PHONY: show-version test | ||
|
||
show-version: | ||
@ echo "### Emacs Information ###" | ||
@ echo "PATH = `which ${EMACS}`" | ||
${EMACS} --version | ||
|
||
test: show-version | ||
@ echo "### elixir-mix test suite ###" | ||
${EMACS} -batch -Q -l test/test-runner.el |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
;;; elixir-mix-tests.el --- elixir-mix ert unit tests | ||
|
||
;; Copyright © 2013 Samuel Tonini | ||
|
||
;; Author: Samuel Tonini | ||
;; Maintainer: Samuel Tonini | ||
;; Description: Integration of Elixir's building and deployment tool: mix into Emacs. | ||
;; Created: So Jun 9 10:01:02 2013 (+0200) | ||
;; URL: https://github.com/tonini/elixir-mix | ||
|
||
;; This file is NOT part of GNU Emacs. | ||
|
||
;; The MIT License (MIT) | ||
;; | ||
;; Copyright (c) Samuel Tonini | ||
;; | ||
;; Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
;; this software and associated documentation files (the "Software"), to deal in | ||
;; the Software without restriction, including without limitation the rights to | ||
;; use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
;; the Software, and to permit persons to whom the Software is furnished to do so, | ||
;; subject to the following conditions: | ||
;; | ||
;; The above copyright notice and this permission notice shall be included in all | ||
;; copies or substantial portions of the Software. | ||
;; | ||
;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
;; FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
;; COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
;; IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
;;; Commentary: | ||
|
||
;;; Code: | ||
|
||
(provide 'elixir-mix-tests) | ||
|
||
(require 'ert) | ||
(require 'elixir-mix) | ||
|
||
(ert-deftest test-flatten-of-list () | ||
(should (equal (elixir-mix-flatten '(1 2 (3 4) 5)) | ||
'(1 2 3 4 5))) | ||
(should (equal (elixir-mix-flatten '(1 2 ("wood" "fire" (3)) 4 5)) | ||
'(1 2 "wood" "fire" 3 4 5)))) | ||
|
||
|
||
;;; elixir-mix-tests.el ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
;; Usage: | ||
;; | ||
;; emacs -Q -l test/test-runner.el # interactive mode | ||
;; emacs -batch -Q -l test/test-runner.el # batch mode | ||
|
||
(let ((current-directory (file-name-directory load-file-name))) | ||
(setq elixir-mix-test-path (expand-file-name "." current-directory)) | ||
(setq elixir-mix-root-path (expand-file-name ".." current-directory))) | ||
|
||
(add-to-list 'load-path elixir-mix-root-path) | ||
(add-to-list 'load-path elixir-mix-test-path) | ||
|
||
(require 'elixir-mix) | ||
|
||
(dolist (test-file (or argv (directory-files elixir-mix-test-path t "-tests.el$"))) | ||
(load test-file nil t)) | ||
|
||
(ert-run-tests-batch-and-exit t) |