unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: 58984@debbugs.gnu.org
Subject: bug#58984: 29.0.50; M-x compile misinterprets libcheck error message format
Date: Sun, 06 Nov 2022 14:10:56 +0200	[thread overview]
Message-ID: <87zgd4uvu7.fsf@tcd.ie> (raw)
In-Reply-To: <D4ED21A2-24F7-4484-BF8E-29B220026D44@acm.org> ("Mattias Engdegård"'s message of "Fri, 4 Nov 2022 18:49:08 +0100")

[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]

Mattias Engdegård [2022-11-04 18:49 +0100] wrote:

> 4 nov. 2022 kl. 18.08 skrev Basil L. Contovounesios <contovob@tcd.ie>:
>> itree-tests.c:71:F:insert1:test_insert_1:0: Assertion 'N_50.red' failed
>
> This doesn't quite conform to GNU message standards, does it? For it to have the
>
>   [PROGRAM:]FILE:LINE: MESSAGE
>
> form, there should be a space before the message (that is, before the
> 'F'). Otherwise parsing these things become almost impossible with all the
> possible variations, file names containing spaces and colons and so
> on.

I imagined as much, which is why I pinged you for comment from the
outset ;).

> Currently, the machinery interprets "tree-tests.c" as the program name and
> "71:F:insert1:test_insert_1" as the file which is of course nonsense.
>
> Any hope the tool can have its output format adjusted?

The only alternative format I'm aware of is after compiling the test
runner in CK_SUBUNIT mode instead of CK_NORMAL or CK_ENV.  I.e. with the
following patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: errors.diff --]
[-- Type: text/x-diff, Size: 2158 bytes --]

diff --git a/test/manual/noverlay/Makefile.in b/test/manual/noverlay/Makefile.in
index 3c8dba1ce1..c0fa705174 100644
--- a/test/manual/noverlay/Makefile.in
+++ b/test/manual/noverlay/Makefile.in
@@ -33,7 +33,7 @@ .PHONY:
 all: check
 
 check: $(PROGRAM)
-	./check-sanitize.sh ./$(PROGRAM)
+	./$(PROGRAM)
 
 itree-tests.o: emacs-compat.h $(top_srcdir)/src/itree.c $(top_srcdir)/src/itree.h
 
diff --git a/test/manual/noverlay/itree-tests.c b/test/manual/noverlay/itree-tests.c
index 278e65f9bf..a8c69c79be 100644
--- a/test/manual/noverlay/itree-tests.c
+++ b/test/manual/noverlay/itree-tests.c
@@ -68,8 +68,8 @@ START_TEST (test_insert_1)
    */
 
   interval_tree_insert (&tree, &N_50);
-  ck_assert (! N_50.red);
-  ck_assert_ptr_eq (&N_50, tree.root);
+  ck_assert (N_50.red);
+  ck_assert_ptr_ne (&N_50, tree.root);
 }
 END_TEST
 
@@ -88,7 +88,7 @@ START_TEST (test_insert_2)
   ck_assert_ptr_eq (&N_50, tree.root);
   ck_assert_ptr_eq (N_30.parent, &N_50);
   ck_assert_ptr_eq (N_50.left, &N_30);
-  ck_assert_ptr_null (N_50.right);
+  ck_assert_ptr_nonnull (N_50.right);
   ck_assert_ptr_null (N_30.left);
   ck_assert_ptr_null (N_30.right);
 }
@@ -737,7 +737,7 @@ START_TEST (test_remove_10)
       itree_remove (&tree, &nodes[index[i]]);
     }
   ck_assert_ptr_null (tree.root);
-  ck_assert_int_eq (tree.size, 0);
+  ck_assert_int_ne (tree.size, 0);
 }
 END_TEST
 
@@ -749,11 +749,11 @@ START_TEST (test_remove_10)
 START_TEST (test_generator_1)
 {
   struct itree_node node, *n;
-  struct itree_iterator *g;
+  struct itree_iterator *g = NULL;
   interval_tree_init (&tree);
 
   itree_insert (&tree, &node, 10, 20);
-  g = itree_iterator_start (&tree, 0, 30, ITREE_ASCENDING, NULL, 0);
+  /* g = itree_iterator_start (&tree, 0, 30, ITREE_ASCENDING, NULL, 0); */
   n = itree_iterator_next (g);
   ck_assert_ptr_eq (n, &node);
   ck_assert_int_eq (n->begin, 10);
@@ -1282,7 +1282,7 @@ main (void)
   SRunner *sr = srunner_create (s);
 
   init_itree ();
-  srunner_run_all (sr, CK_ENV);
+  srunner_run_all (sr, CK_SUBUNIT);
   int nfailed = srunner_ntests_failed (sr);
   srunner_free (sr);
   return (nfailed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;

[-- Attachment #3: Type: text/plain, Size: 30 bytes --]


I get the following output:


[-- Attachment #4: errors.txt --]
[-- Type: text/plain, Size: 4128 bytes --]

-*- mode: compilation; default-directory: "~/.local/src/emacs/test/manual/noverlay/" -*-
Compilation started at Sun Nov  6 14:08:38

make
gcc -O0 -g3 -pthread -I ../../../src  -c -o itree-tests.o itree-tests.c
gcc   itree-tests.o  -lcheck_pic -pthread -lrt -lm -lsubunit -lm -o itree-tests
./itree-tests
test: insert1:test_insert_1
failure: insert1:test_insert_1 [
itree-tests.c:71: Assertion 'N_50.red' failed
]
test: insert1:test_insert_2
failure: insert1:test_insert_2 [
itree-tests.c:91: Assertion 'N_50.right != NULL' failed: N_50.right == 0
]
test: insert1:test_insert_3
success: insert1:test_insert_3
test: insert1:test_insert_4
success: insert1:test_insert_4
test: insert1:test_insert_5
success: insert1:test_insert_5
test: insert1:test_insert_6
success: insert1:test_insert_6
test: insert2:test_insert_7
success: insert2:test_insert_7
test: insert2:test_insert_8
success: insert2:test_insert_8
test: insert2:test_insert_9
success: insert2:test_insert_9
test: insert2:test_insert_10
success: insert2:test_insert_10
test: insert2:test_insert_11
success: insert2:test_insert_11
test: insert2:test_insert_12
success: insert2:test_insert_12
test: insert3:test_insert_13
success: insert3:test_insert_13
test: insert3:test_insert_14
success: insert3:test_insert_14
test: remove1:test_remove_1
success: remove1:test_remove_1
test: remove1:test_remove_2
success: remove1:test_remove_2
test: remove1:test_remove_3
success: remove1:test_remove_3
test: remove1:test_remove_4
success: remove1:test_remove_4
test: remove2:test_remove_5
success: remove2:test_remove_5
test: remove2:test_remove_6
success: remove2:test_remove_6
test: remove2:test_remove_7
success: remove2:test_remove_7
test: remove2:test_remove_8
success: remove2:test_remove_8
test: remove3:test_remove_9
success: remove3:test_remove_9
test: remove3:test_remove_10
failure: remove3:test_remove_10 [
itree-tests.c:740: Assertion 'tree.size != 0' failed: tree.size == 0, 0 == 0
]
test: generator:test_generator_1
../../../src/itree.c:1370:eassert condition failed: g && g->running
error: generator:test_generator_1 [
itree-tests.c:749: (after this point) Early exit with return value 1
]
test: generator:test_generator_2
success: generator:test_generator_2
test: generator:test_generator_3
success: generator:test_generator_3
test: generator:test_generator_5
success: generator:test_generator_5
test: generator:test_generator_6
success: generator:test_generator_6
test: generator:test_generator_7
success: generator:test_generator_7
test: generator:test_generator_8
success: generator:test_generator_8
test: generator:test_generator_9
success: generator:test_generator_9
test: insert_gap:test_gap_insert_1
success: insert_gap:test_gap_insert_1
test: insert_gap:test_gap_insert_2
success: insert_gap:test_gap_insert_2
test: insert_gap:test_gap_insert_3
success: insert_gap:test_gap_insert_3
test: insert_gap:test_gap_insert_4
success: insert_gap:test_gap_insert_4
test: insert_gap:test_gap_insert_5
success: insert_gap:test_gap_insert_5
test: insert_gap:test_gap_insert_6
success: insert_gap:test_gap_insert_6
test: insert_gap:test_gap_insert_7
success: insert_gap:test_gap_insert_7
test: insert_gap:test_gap_insert_8
success: insert_gap:test_gap_insert_8
test: insert_gap:test_gap_insert_9
success: insert_gap:test_gap_insert_9
test: insert_gap:test_gap_insert_10
success: insert_gap:test_gap_insert_10
test: insert_gap:test_gap_insert_11
success: insert_gap:test_gap_insert_11
test: delete_gap:test_gap_delete_1
success: delete_gap:test_gap_delete_1
test: delete_gap:test_gap_delete_2
success: delete_gap:test_gap_delete_2
test: delete_gap:test_gap_delete_3
success: delete_gap:test_gap_delete_3
test: delete_gap:test_gap_delete_4
success: delete_gap:test_gap_delete_4
test: delete_gap:test_gap_delete_5
success: delete_gap:test_gap_delete_5
test: delete_gap:test_gap_delete_6
success: delete_gap:test_gap_delete_6
test: delete_gap:test_gap_delete_7
success: delete_gap:test_gap_delete_7
test: delete_gap:test_gap_delete_8
success: delete_gap:test_gap_delete_8

make: *** [Makefile:36: check] Error 1

Compilation exited abnormally with code 2 at Sun Nov  6 14:08:39

[-- Attachment #5: Type: text/plain, Size: 439 bytes --]


This is much more verbose, but the error messages are in a more readily
grokked format.  Not sure which is preferable between that and the
status quo (filtering through check-sanitize.sh).

In any case the feature request was to support Check's default output
(what we do with our small manual test suite is largely
inconsequential), so if that's too difficult and brittle for few gains,
we can close this as wontfix.

Thanks,

-- 
Basil

  reply	other threads:[~2022-11-06 12:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 13:07 bug#58984: 29.0.50; M-x compile misinterprets libcheck error message format Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-04 11:30 ` Mattias Engdegård
2022-11-04 17:08   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-04 17:49     ` Mattias Engdegård
2022-11-06 12:10       ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-11-06 14:26         ` Mattias Engdegård
2022-11-08 18:24           ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-09 11:14             ` Mattias Engdegård

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=87zgd4uvu7.fsf@tcd.ie \
    --to=bug-gnu-emacs@gnu.org \
    --cc=58984@debbugs.gnu.org \
    --cc=contovob@tcd.ie \
    --cc=mattiase@acm.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).