Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, Simon Marchi <simon.marchi@efficios.com>
Cc: gcc-patches@sourceware.org, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 1/2] gdb: add selftests for split_name
Date: Thu, 15 Oct 2026 14:33:55 -0400	[thread overview]
Message-ID: <a2453bce-0c6b-46de-a96a-6832c2ee274c@simark.ca> (raw)
In-Reply-To: <878q3z2cd7.fsf@tromey.com>

On 10/15/26 11:48 AM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> +  if (result != expected)
> Simon> +    debug_printf ("split_name (\"%s\"): got %s, expected %s\n", name,
> Simon> +		  components_to_string (result).c_str (),
> Simon> +		  components_to_string (expected).c_str ());
> Simon> +
> Simon> +  SELF_CHECK (result == expected);
> 
> I've often regretted not adding a SELF_CHECK variant that takes two
> arguments, and then prints them both when the comparison fails.

It's funny that you say that because yesterday I was thinking how our
SELF_CHECK macro could do like catch2's CHECK/REQUIRE macro and automatically do
that.  I don't know if you have used catch2 before, but the output of a
failing test is:

catch2.cpp:26: FAILED:
  CHECK( reverse_string("hello") == "bonjour" )
with expansion:
  "olleh" == "bonjour"

I dismissed the idea because I thought people would find it's too much
complexity for nothing, but if you are interested I'd be happy to look
into it.

Simon

  reply	other threads:[~2026-10-15 18:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05  5:25 [PATCH 1/3] gdb/testsuite: fix rust compiler selection in gdb_default_target_compile simon.marchi
2026-10-05  5:25 ` [PATCH 2/3] gdb/testsuite: wrap rustc in cc-with-tweaks.exp simon.marchi
2026-10-06 10:56   ` Andrew Burgess
2026-10-05  5:25 ` [PATCH 3/3] gdb/dwarf: fix crash when .gdb_index contains Rust legacy mangled names simon.marchi
2026-10-06 11:01   ` Andrew Burgess
2026-10-06 13:39     ` Simon Marchi
2026-10-14 13:01   ` Tom Tromey
2026-10-14 13:22     ` Simon Marchi
2026-10-14 14:59       ` Tom Tromey
2026-10-14 16:13       ` Tom Tromey
2026-10-14 16:26         ` Simon Marchi
2026-10-14 16:46   ` [PATCH v2 0/2] Fix " Simon Marchi
2026-10-15 15:47     ` Tom Tromey
2026-10-18  3:45       ` Simon Marchi
2026-10-14 16:46   ` [PATCH v2 1/2] gdb: add selftests for split_name Simon Marchi
2026-10-15 15:48     ` Tom Tromey
2026-10-15 18:33       ` Simon Marchi [this message]
2026-10-16  3:15         ` Tom Tromey
2026-10-14 16:46   ` [PATCH v2 2/2] gdb/dwarf: fix crash when .gdb_index contains Rust legacy mangled names Simon Marchi
2026-10-06 10:56 ` [PATCH 1/3] gdb/testsuite: fix rust compiler selection in gdb_default_target_compile Andrew Burgess

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

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

  git send-email \
    --in-reply-to=a2453bce-0c6b-46de-a96a-6832c2ee274c@simark.ca \
    --to=simark@simark.ca \
    --cc=gcc-patches@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    --cc=tom@tromey.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox