branch: elpa/bash-completion
commit 3210a4408191e47d3dba63f604a7d5a3367fa1e0
Author: Stephane Zermatten <[email protected]>
Commit: Stephane Zermatten <[email protected]>
Makefile allows specifying the path to bash.
With this change, setting the env variable BASH before running make
allows pointing the tests to a specific version of bash.
---
.gitignore | 2 +-
Makefile | 4 +++-
test/bash-completion-integration-test.el | 39 ++++++++++++++++----------------
3 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/.gitignore b/.gitignore
index 7a0f02ff0c..90fdcfb681 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
*.elc
.cask
-
+test/.set-bash-prog.el
diff --git a/Makefile b/Makefile
index a7838802bf..1d414beaf9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
CASK ?= cask
EMACS ?= emacs
+BASH ?= bash
all: test
@@ -10,7 +11,8 @@ test: clean-elc
${MAKE} clean-elc
unit:
- ${CASK} exec ert-runner
+ @echo '(setq bash-completion-prog "${BASH}")' >test/.set-bash-prog.el
+ ${CASK} exec ert-runner -l test/.set-bash-prog.el
compile:
${CASK} build
diff --git a/test/bash-completion-integration-test.el
b/test/bash-completion-integration-test.el
index ae3751d415..cfd338d862 100644
--- a/test/bash-completion-integration-test.el
+++ b/test/bash-completion-integration-test.el
@@ -34,26 +34,25 @@
(require 'ert)
(defmacro bash-completion_test-harness (bashrc &rest body)
- `(if (file-executable-p bash-completion-prog)
- (let ((test-env-dir (bash-completion_test-setup-env ,bashrc)))
- (let ((bash-completion-processes nil)
- (bash-completion-nospace nil)
- (bash-completion-start-files nil)
- (bash-completion-args
- (list "--noediting"
- "--noprofile"
- "--rcfile" (expand-file-name "bashrc" test-env-dir)))
- (kill-buffer-query-functions '())
- (minibuffer-message-timeout 0)
- (default-directory test-env-dir))
- ;; Give Emacs time to process any input or process state
- ;; change from bash-completion-reset.
- (while (accept-process-output nil 0.1))
- (unwind-protect
- (progn ,@body)
- (progn
- (bash-completion_test-teardown-env test-env-dir)
- (bash-completion-reset-all)))))))
+ `(let ((test-env-dir (bash-completion_test-setup-env ,bashrc)))
+ (let ((bash-completion-processes nil)
+ (bash-completion-nospace nil)
+ (bash-completion-start-files nil)
+ (bash-completion-args
+ (list "--noediting"
+ "--noprofile"
+ "--rcfile" (expand-file-name "bashrc" test-env-dir)))
+ (kill-buffer-query-functions '())
+ (minibuffer-message-timeout 0)
+ (default-directory test-env-dir))
+ ;; Give Emacs time to process any input or process state
+ ;; change from bash-completion-reset.
+ (while (accept-process-output nil 0.1))
+ (unwind-protect
+ (progn ,@body)
+ (progn
+ (bash-completion_test-teardown-env test-env-dir)
+ (bash-completion-reset-all))))))
(defmacro bash-completion_test-with-shell-harness (bashrc &rest body)
`(bash-completion_test-harness