public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Jakob Hasse <jakob.hasse@espressif.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Need help building and executing specific run tests for libstdc++
Date: Thu, 28 Apr 2022 12:57:58 +0100	[thread overview]
Message-ID: <CAH6eHdQ_dM2vZqpn=8k7yq4u11kcy4A=oyqwcY7BwRw4VRerHA@mail.gmail.com> (raw)
In-Reply-To: <HK0PR04MB2530E40558C4179F94E8BC40E4FD9@HK0PR04MB2530.apcprd04.prod.outlook.com>

On Thu, 28 Apr 2022 at 12:37, Jakob Hasse via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hello, I'm stuck building and running the tests for gcc, in particular the run-tests (not compile tests) for just one test case I added myself.
>
> I found an issue in libstdc++ (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105387) and now want to write a test for it to prove that the patch I created works and that the libstdc++ code breaks without the patch. I added the test application into libstdc++-v3/testsuite/abi/.

It should be in testsuite/18_support

> Now how do I run this very application and via the test suite and how do I confirm that it successfully ran?
>
> I've been looking into the libstdc++ test doc page: libstdc++-v3/doc/html/manual/test.html in the repository, but it is still not clear to me how to do the aforementioned task.

https://gcc.gnu.org/onlinedocs/libstdc++/manual/test.html#test.run
should be clear, no?

> After successfully building the entire gcc, I stayed in the build directory and tried this: make check-c++ RUNTESTFLAGS="libstdc++.exp". But all I got was a bunch of output without any of the files in libstdc++-v3/testsuite/abi/ listed.

That's not what the docs say to do though.

You want conformance.exp not libstdc++.exp and it's easier to run it
from the $target/libstdc++-v3 directory not the top-level build
directory.

The test output goes to the logs, not to stdout.

>
> How do I run the tests (with stdout output, because using gdb is another story) for a particular .cc file in any of the directories in libstdc++-v3/testsuite/ ?

make check RUNTESTFLAGS=conformance.exp=yourfile.cc

You should not rely on stdout output, because that can't be automated.
You should #include <testsuite_hooks.h> and use the VERIFY macro,
which is equivalent to the standard 'assert' macro.

The results can be checked in the testsuite/libstdc++.log file.

      reply	other threads:[~2022-04-28 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 11:36 Jakob Hasse
2022-04-28 11:57 ` Jonathan Wakely [this message]

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='CAH6eHdQ_dM2vZqpn=8k7yq4u11kcy4A=oyqwcY7BwRw4VRerHA@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jakob.hasse@espressif.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).