From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74687 invoked by alias); 16 Sep 2017 12:08:52 -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 74676 invoked by uid 89); 16 Sep 2017 12:08:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 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; Sat, 16 Sep 2017 12:08:51 +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 v8GC8iKp008245 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Sep 2017 08:08:49 -0400 Received: by simark.ca (Postfix, from userid 112) id 2AA901ECF5; Sat, 16 Sep 2017 08:08:44 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 2A1051EA9D; Sat, 16 Sep 2017 08:08:43 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 16 Sep 2017 12:08: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: <73d0b31ae68d213e862d9d679511004a@polymtl.ca> References: <1504732838-6455-1-git-send-email-simon.marchi@ericsson.com> <1504796946-22276-1-git-send-email-simon.marchi@ericsson.com> <73d0b31ae68d213e862d9d679511004a@polymtl.ca> Message-ID: <48187a18559ae3d9ce5fd3f05c237ff1@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 Sat, 16 Sep 2017 12:08:44 +0000 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00431.txt.bz2 On 2017-09-07 17:11, Simon Marchi wrote: > 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. I pushed this patch, but I am still open to making changes if you have further comments. Simon