Skip to content

Add CLI for running elixir-mode tests. #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ert-bootstrap.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
;; Add the current directory to load path.
(add-to-list 'load-path (file-name-directory
(or load-file-name buffer-file-name)))
;; The test fixtures assume an indentation width of 2, so we need to set that
;; up for the tests.
(setq-default default-tab-width 2)
(setq-default indent-tabs-mode nil)
(require 'elixir-mode)
25 changes: 25 additions & 0 deletions run_tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# -*- shell-script -*-
OUTPUT=/tmp/test-output.txt
emacs -batch -l ert-bootstrap.el -l elixir-mode-tests.el -f ert-run-tests-batch-and-exit 2> $OUTPUT

if [ $? == 0 ]; then
echo "Success -- All tests passed."
rm $OUTPUT
else
# Give the user to re-do the tests in emacs proper
cat /tmp/test-output.txt
while [[ 1 ]]
do
read -p "There were test failures. Re-run in regular Emacs? [Yn]" choice
case $choice in
n|N)
break
;;
*)
emacs -l elixir-mode-tests.el -f elixir-mode-run-tests
;;
esac
done
fi