0

What I'm doing:

If I define a test like:

(ert-deftest tmp-test ()   
  "failing test"   
  :expected-result :failed
  (should (eql (+ 1 0) 2)))

and then I run

M-x ert-run-tests-automatically ;; with selector t

My cursor jumps to the *ert* test buffer and I can view the failing test

f tmp-test
    failing test
    (ert-test-failed
     ((should
       (eql
        (+ 1 0)
        2))
      :form
      (eql 1 2)
      :value nil))

However when I move my cursor over the "tmp-test" link and press enter instead of switching windows/buffers and jumping the cursor to the test definition like I assume should happen I see the message "Don't know where 'tmp-test' is defined" printed in the minibuffer.

Question:

How do I tell ert where to find my test definitions?

0

I think this depends on how you did the "I define a test like". More specifically it depends if you do it by loading a file that contains this test or if you use M-: or M-C-x.

More specifically, it should work if you M-x load-file the file that contains the test, whereas I'm not surprised if it doesn't work when you define it via something like M-C-x or M-: or C-x C-e.

1
  • Yep, that was it. running load-file allows me to jump to the test like I expected. – user1854496 Jun 5 '19 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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