From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45485 invoked by alias); 2 Jun 2016 23:21:44 -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 45470 invoked by uid 89); 2 Jun 2016 23:21:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Thu, 02 Jun 2016 23:21:33 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B858EC00E7D6 for ; Thu, 2 Jun 2016 23:21:31 +0000 (UTC) Received: from localhost.localdomain (vpn1-7-194.ams2.redhat.com [10.36.7.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u52NLUur002094; Thu, 2 Jun 2016 19:21:30 -0400 Subject: Re: [PATCH 01/16] Core of selftest framework (v6) To: David Malcolm , gcc-patches@gcc.gnu.org References: <1464874868.11895.41.camel@redhat.com> <1464901625-54547-1-git-send-email-dmalcolm@redhat.com> <1464901625-54547-2-git-send-email-dmalcolm@redhat.com> Cc: Jeff Law From: Bernd Schmidt Message-ID: <5750BF79.20201@redhat.com> Date: Thu, 02 Jun 2016 23:21:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <1464901625-54547-2-git-send-email-dmalcolm@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00234.txt.bz2 On 06/02/2016 11:06 PM, David Malcolm wrote: > gcc/ChangeLog: > * Makefile.in (OBJS): Add function-tests.o, > hash-map-tests.o, hash-set-tests.o, rtl-tests.o, > selftest-run-tests.o. > (OBJS-libcommon): Add selftest.o. > (OBJS-libcommon-target): Add selftest.o. > (all.internal): Add "selftests". > (all.cross): Likewise. > (selftests): New phony target. > (s-selftests): New target. > (selftests-gdb): New phony target. > (COLLECT2_OBJS): Add selftest.o. > * common.opt (fself-test): New. > * selftest-run-tests.c: New file. > * selftest.c: New file. > * selftest.h: New file. > * toplev.c: Include selftest.h. > (toplev::run_self_tests): New. > (toplev::main): Handle -fself-test. > * toplev.h (toplev::run_self_tests): New. This one looks good to me. I kind of liked the auto-registration, but I guess manually calling functions is preferrable to including C files and similar in effort required. So it's probably better this way. > + fprintf (stderr, > + "%s:%i: FAIL: %s\n", > + file, line, msg); > + /* TODO: add calling function name as well? */ > + abort (); > +} That'll fit on one line. Otherwise OK. Likewise for anything Jeff has already approved in a different form - but please make another pass and add brief function comments for new functions, and please ensure every step you commit actually compiles (this patch alone won't). Let me know which patches still need approval after that. Bernd