1

I have written a few simple tests, when I run them on the buffer inside emacs everything passes.

However, when I run them in batch mode as shown below, it fails. What can explain this?

emacs -batch -l ert -l mytests.el -f ert-run-tests-batch-and-exit

Here's the output from one of the failing tests:

Test pp-test-docker-container-names backtrace:
  (let ((container_ids (split-string (dc-docker-run-return "ps -q" "" 
  dc-docker-names()
  (list (dc-docker-names) (quote (nil)))
  (let ((fn-89805 (function equal)) (args-89806 (list (dc-docker-names
  (progn (fset (quote shell-command-to-string) vnew) (let ((fn-89805 (
  (unwind-protect (progn (fset (quote shell-command-to-string) vnew) (
  (let* ((vnew (function (lambda (_) ""))) (old (symbol-function (quot
  (closure (t) nil (let* ((vnew (function (lambda (_) ""))) (old (symb
  #[0 "\306\307!r\211q\210\310\311\312\313\314\315!\316\"\317\320%DC
  funcall(#[0 "\306\307!r\211q\210\310\311\312\313\314\315!\316\"\31
  ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
  #[0 "r\304 q\210\305 )\306\307\310\311\312\313!\314\"\315\316%DC\2
  funcall(#[0 "r\304 q\210\305 )\306\307\310\311\312\313!\314\"\315\
  ert-run-test([cl-struct-ert-test pp-test-docker-container-names "Tes
  ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test p
  ert-run-tests(t #[385 "\306\307\"\203D\211\211G\310U\203\211@\20
  ert-run-tests-batch(nil)
  ert-run-tests-batch-and-exit()
  command-line-1(("-l" "ert" "-l" "docker-compose.el" "-f" "ert-run-te
  command-line()
  normal-top-level()
Test pp-test-docker-container-names condition:
    (void-function loop)
   FAILED  2/2  pp-test-docker-container-names

Any ideas ?

1 Answer 1

2
(void-function loop)

loop is not available, which comes from cl.el. In your code/tests, you should load this library before using loop. When you launch Emacs interactively with your own init.el, it is usually already loaded since it is a common library used by many other packages.

1
  • Great that makes sense i have 1 test passing now the other is likely a similar issue, I know what to look forward i had assumed it would have been the same environment.
    – Oly
    Commented Oct 29, 2016 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.