From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51603 invoked by alias); 16 Nov 2015 21:22:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 50841 invoked by uid 89); 16 Nov 2015 21:22:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 16 Nov 2015 21:22:46 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id D5F208E232 for ; Mon, 16 Nov 2015 21:22:44 +0000 (UTC) Received: from localhost.localdomain (vpn1-5-35.ams2.redhat.com [10.36.5.35]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAGLMh41012404; Mon, 16 Nov 2015 16:22:44 -0500 Subject: Re: [PATCH 00/16] Unit tests framework (v3) To: David Malcolm References: <5589B2FB.8010500@redhat.com> <1445975355-37660-1-git-send-email-dmalcolm@redhat.com> <5630B3C9.10409@redhat.com> <563271AF.1000500@redhat.com> <56334C5D.1070000@redhat.com> <56339342.4000101@redhat.com> <564A1DAB.1030700@redhat.com> <1447699711.19594.50.camel@surprise> Cc: Jeff Law , gcc-patches@gcc.gnu.org From: Bernd Schmidt Message-ID: <564A4923.4000706@redhat.com> Date: Mon, 16 Nov 2015 21:22:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447699711.19594.50.camel@surprise> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg01996.txt.bz2 >> For some of the simpler infrastructure tests such as the ones in this >> patch kit (bitmap, vec or wide-int functionality testing and such), we >> had the idea of putting these into every ENABLE_CHECKING compiler, and >> run them after building stage1, controlled by a -fself-test flag. It's >> better to detect such basic failures early rather than complete a full >> bootstrap and test cycle. It also keeps the tests alongside the rest of >> the implementation, which I consider desirable for such relatively >> simple data structures. > > Would it be reasonable to run them at each stage? My hope is that they > will be fast. Depends on how fast, I guess. I don't think testing them more than once gains very much; if there's a suspicion that stage3 was miscompiled one could still run -fself-test manually. > If we're building the tests into the compiler itself, guarded by > #if ENABLE_CHECKING > then presumably it makes sense to put the tests directly into the > pertinent source files? (rather than in a "foo-tests.c" file). Possibly > even to interleave them, to be next to the code in question. Yes, I was thinking same source file for the most part. I don't think there has to be any kind of rule, we just do whatever makes sense. > Given that this patch kit has seen a fair amount of discussion, and > parts of it are already approved, and that it's designed to improve our > test coverage, is it reasonable to continue pursuing this within stage > 3? (I hope so) Should I attempt a patch for the above? (once I've > fixed the AIX bootstrap issue, of course) As far as I'm concerned this can still proceed given that it was submitted well in advance of stage 3 (unless someone objects). > Any thoughts on embedded gtest vs external gtest vs building our own? I think for -fself-test we can mostly operate with gcc_assert, IMO there's no need to use an elaborate framework. We can revisit this issue when we get to more extensive tests that require multiple compiler invocations. Bernd