unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Troy Brown <brownts@troybrown.dev>
To: 62471@debbugs.gnu.org
Subject: bug#62471: 29.0.60; `erts-run-test' results inconsistent with batch mode
Date: Sun, 26 Mar 2023 18:28:27 -0400	[thread overview]
Message-ID: <CABvCZ41xUozoZGWAW88HMD0HFfBWW=0DG2H=CVqaVNAaScB0Bw@mail.gmail.com> (raw)

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	other threads:[~2023-03-26 22:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABvCZ41xUozoZGWAW88HMD0HFfBWW=0DG2H=CVqaVNAaScB0Bw@mail.gmail.com' \
    --to=brownts@troybrown.dev \
    --cc=62471@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).