public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Need help building and executing specific run tests for libstdc++
@ 2022-04-28 11:36 Jakob Hasse
  2022-04-28 11:57 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Jakob Hasse @ 2022-04-28 11:36 UTC (permalink / raw)
  To: gcc-help

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/. 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. 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.

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/ ?

Thanks,
Jakob

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Need help building and executing specific run tests for libstdc++
  2022-04-28 11:36 Need help building and executing specific run tests for libstdc++ Jakob Hasse
@ 2022-04-28 11:57 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2022-04-28 11:57 UTC (permalink / raw)
  To: Jakob Hasse; +Cc: gcc-help

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-28 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 11:36 Need help building and executing specific run tests for libstdc++ Jakob Hasse
2022-04-28 11:57 ` Jonathan Wakely

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).