bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62471: 29.0.60; `erts-run-test' results inconsistent with batch mode


From: Troy Brown
Subject: bug#62471: 29.0.60; `erts-run-test' results inconsistent with batch mode
Date: Sun, 26 Mar 2023 18:28:27 -0400

Interactively running `erts-run-test' provides different (i.e.,
incorrect) results as when the test is run in batch mode.  I noticed
this happens when a new "code" block is introduced.  In the following
situation, there are two ERTS tests, each one supplies its own "code"
block associated with the test case.  When I interactively attempt to
execute the second test case (i.e., C-c C-c from within `erts-mode'),
the test fails and the expected results match the output from the first
case.

I used the following two test files.  `hi-test.el' is used to run the
test in batch mode (emacs -batch -l ert -l hi-test.el -f
ert-run-tests-batch-and-exit).  This just runs the ERTS test cases.
The second file (located relatively from `hi-test.el' in
resources/hi.erts) contains the two test cases.

hi-test.el:

(require 'ert)
(require 'ert-x)

(ert-deftest hi-test-run ()
  (ert-test-erts-file (ert-resource-file "hi.erts")))


resources/hi.erts:

Code:
  (lambda ()
    (fundamental-mode)
    (goto-char (point-max))
    (insert "there\n"))

Name: Hi there

=-=
Hi
=-=
Hi
there
=-=-=

Code:
  (lambda ()
    (fundamental-mode)
    (goto-char (point-max))
    (insert "you\n"))

Name: Hi you

=-=
Hi
=-=
Hi
you
=-=-=

Running in batch mode, I get the following result:

Running 1 tests (2023-03-26 18:10:33-0400, selector ‘t’)
   passed  1/1  hi-test-run (0.000384 sec)

Ran 1 tests, 1 results as expected, 0 unexpected (2023-03-26
18:10:33-0400, 0.000493 sec)

Running interactively in the `erts-mode' buffer, I get the following
result:

Test failure; result:
Hi
there





reply via email to

[Prev in Thread] Current Thread [Next in Thread]