public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: David Malcolm <dmalcolm@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Expensive selftests: torture testing for fix-it boundary conditions (PR c/82050)
Date: Mon, 11 Dec 2017 23:14:00 -0000	[thread overview]
Message-ID: <c3e92eb7-915b-2b08-3770-3c9a5da79cb1@redhat.com> (raw)
In-Reply-To: <1511897507-26241-1-git-send-email-dmalcolm@redhat.com>

On 11/28/2017 12:31 PM, David Malcolm wrote:
> This patch adds selftest coverage for the fix for PR c/82050 (r255214).
> 
> The selftest iterates over various "interesting" column and line-width
> values to try to shake out bugs in the fix-it printing routines, a kind
> of "torture" selftest.
> 
> Unfortunately this selftest is noticably slower than the other selftests;
> adding it to diagnostic-show-locus.c led to:
>   -fself-test: 40218 pass(es) in 0.172000 seconds
> slowing down to:
>   -fself-test: 97315 pass(es) in 6.109000 seconds
> for an unoptimized build (e.g. when hacking with --disable-bootstrap).
> 
> Given that this affects the compile-edit-test cycle of the "gcc"
> subdirectory, this felt like an unacceptable amount of overhead to add.
> 
> I attempted to optimize the test by reducing the amount of coverage, but
> the test seems useful, and there seems to be a valid role for "torture"
> selftests.
> 
> Hence this patch adds a:
>   gcc.dg/plugin/expensive_selftests_plugin.c
> with the responsibility for running "expensive" selftests, and adds the
> expensive test there.  The patch moves a small amount of code from
> selftest::run_tests into a helper class so that the plugin can print
> a useful summary line (to reassure us that the tests are actually being
> run).
> 
> With that, the compile-edit-test cycle of the "gcc" subdir is unaffected;
> the plugin takes:
>   expensive_selftests_plugin: 26641 pass(es) in 3.127000 seconds
> which seems reasonable within the much longer time taken by "make check"
> (I optimized some of the overhead away, hence the reduction from 6 seconds
> above down to 3 seconds).
> 
> Successfully bootstrapped&regrtested on x86_64-pc-linux-gnu.
> 
> OK for trunk?
> 
> gcc/ChangeLog:
> 	PR c/82050
> 	* selftest-run-tests.c (selftest::run_tests): Move start/finish code
> 	to...
> 	* selftest.c (selftest::test_runner::test_runner): New ctor.
> 	(selftest::test_runner::~test_runner): New dtor.
> 	* selftest.h (class selftest::test_runner): New class.
> 
> gcc/testsuite/ChangeLog:
> 	PR c/82050
> 	* gcc.dg/plugin/expensive-selftests-1.c: New file.
> 	* gcc.dg/plugin/expensive_selftests_plugin.c: New file.
> 	* gcc.dg/plugin/plugin.exp (plugin_test_list): Add the above.
OK.
jeff

  parent reply	other threads:[~2017-12-11 23:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 20:30 David Malcolm
2017-12-11 16:11 ` PING: " David Malcolm
2017-12-11 23:14 ` Jeff Law [this message]
2018-01-02 20:25 ` Andreas Schwab
2018-01-03 19:10   ` [committed] Fix warning in gcc.dg/plugin/expensive_selftests_plugin.c with !CHECKING_P David Malcolm

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=c3e92eb7-915b-2b08-3770-3c9a5da79cb1@redhat.com \
    --to=law@redhat.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.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.
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).