From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12825 invoked by alias); 7 Sep 2017 15:11:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 12810 invoked by uid 89); 7 Sep 2017 15:11:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=citizen X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Sep 2017 15:11:23 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v87FBGl0028044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 7 Sep 2017 11:11:21 -0400 Received: by simark.ca (Postfix, from userid 112) id 3C5171EB32; Thu, 7 Sep 2017 11:11:16 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id E35981EA18; Thu, 7 Sep 2017 11:11:13 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 07 Sep 2017 15:11:00 -0000 From: Simon Marchi To: Simon Marchi Cc: gdb-patches@sourceware.org, palves@redhat.com, eliz@gnu.org Subject: Re: [PATCH v3] Add selftests run filtering In-Reply-To: <1504796946-22276-1-git-send-email-simon.marchi@ericsson.com> References: <1504732838-6455-1-git-send-email-simon.marchi@ericsson.com> <1504796946-22276-1-git-send-email-simon.marchi@ericsson.com> Message-ID: <73d0b31ae68d213e862d9d679511004a@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 7 Sep 2017 15:11:16 +0000 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00185.txt.bz2 On 2017-09-07 17:09, Simon Marchi wrote: > New in v3: > > I realized I had forgotten help, news and doc, this patch adds those. > > Actual commit log: > > With the growing number of selftests, I think it would be useful to be > able to run only a subset of the tests. This patch associates a name > to > each registered selftest. It then allows doing something like: > > (gdb) maintenance selftest aarch64 > Running self-tests. > Running selftest aarch64-analyze-prologue. > Running selftest aarch64-process-record. > Ran 2 unit tests, 0 failed > > or with gdbserver: > > ./gdbserver --selftest=aarch64 > > In both cases, only the tests that contain "aarch64" in their name are > ran. To help validate that the tests you want to run were actually > ran, > it also prints a message with the test name before running each test. > > Right now, all the arch-dependent tests are registered as a single test > of the selftests. To be able to filter those too, I made them > "first-class citizen" selftests. The selftest type is an interface, > with different implementations for "simple selftests" and "arch > selftests". The run_tests function simply iterates on that an invokes > operator() on each test. > > I changed the tests data structure from a vector to a map, because > > - it allows iterating in a stable (alphabetical) order > - it allows to easily verify if a test with a given name has been > registered, to avoid duplicates > > There's also a new command "maintenance info selftests" that lists the > registered selftests. Arg, the subject should have said v3.