From patchwork Mon Sep 30 19:37:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 1169553 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-105516-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="lVVHOeZZ"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46ht2z0Bmsz9sDB for ; Tue, 1 Oct 2019 05:37:30 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; q=dns; s=default; b=ZwMgj1uU3cCAukiR vRzHJ3iU6T51EA4prv2JWD4XN/fqlkHRXwXskyWkVwHlhaXAI83TyhjgbqvINp+V HD9Kq6hH6UcvN8f0UVNAwrbbkISrSn4k+pp5D3Zaphu7QBYaig63IFuBYCNxXlMw 4BLxn9dVZ8BRa4fQ4o5Tr9IjwRQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=default; bh=9+CjYOP+JiOY83D3iVqM+s kMIEM=; b=lVVHOeZZ0aS7M8ZAWTK+nYBtzH2YFqHyS6OcUVlWZ1fXqpznHdxerQ EInZ3Be6RQOJFpI21gjbNyout84TGnfwv+uM6WThS/SD4GDUANvaBZ9LoTJ4FoTv zP4PyrqsI5WMKFngAdSMDJFi/0Hm8BoNNkycL1gODEvrJoPbTQWNE= Received: (qmail 12031 invoked by alias); 30 Sep 2019 19:37:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 12023 invoked by uid 89); 30 Sep 2019 19:37:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=invite, comprehensive, favorite X-HELO: mx1.redhat.com From: DJ Delorie To: Szabolcs Nagy Cc: libc-alpha@sourceware.org, nd@arm.com Subject: [v2, with help] Re: run one test In-Reply-To: <7a6ec478-c475-dde1-7e1a-8113978e1cdc@arm.com> (message from Szabolcs Nagy on Thu, 26 Sep 2019 09:10:06 +0000) Date: Mon, 30 Sep 2019 15:37:19 -0400 Message-ID: MIME-Version: 1.0 Szabolcs Nagy writes: > unfortunately there is currently no easy way to > discover such make targets. (maybe there could be a > make target that prints out usage information for > the most commonly used make targets) I added a help option, with mini-help. I do NOT volunteer to write a comprehensive one-page help doc for our Makefile, but invite everyone to add their favorite targets willy-nilly after the initial commit :-) The obvious next question is "how does the user know to run 'make help'?" but I tried to give them a hint there too. > it can be convenient to rerun a set of tests too, e.g. > by providing a list or pattern like 'math/test-double-*', > which can be implemented in a similar way. I think we can do that with wildcards and file matching, but I don't know off the top of my head how to wrap the onetest code into that kind of expansion. Is there a compelling case for needing more than one but less than a subdir of tests rerun? > same for benchmarks. I've not run the benchmarks myself, but... yeah, probably. > for now the proposed patch looks good enough though. Same patch, with help system, attached... Reviewed-by: Carlos O'Donell diff --git a/Makefile b/Makefile index 67ddd01bfe..0465609de0 100644 --- a/Makefile +++ b/Makefile @@ -26,8 +26,17 @@ include Makeconfig # This is the default target; it makes everything except the tests. -.PHONY: all -all: lib others +.PHONY: all help minihelp +all: minihelp lib others + +help: + @sed '0,/^help-starts-here$$/d' Makefile.help + +minihelp: + @echo + @echo type \"make help\" for help with common GLIBC makefile targets + @echo + ifneq ($(AUTOCONF),no) @@ -499,3 +508,11 @@ FORCE: iconvdata/% localedata/% po/%: FORCE $(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F) + +# Convenience target to rerun one test, from the top of the build tree +# Example: make onetest t=wcsmbs/test-wcsnlen +onetest : + @-rm -f $(objpfx)$t.out + $(MAKE) subdir=$(dir $t) -C $(dir $t) ..=../ $(objpfx)$t.out + @cat $(objpfx)$t.test-result + @cat $(objpfx)$t.out diff --git a/Makefile.help b/Makefile.help new file mode 100644 index 0000000000..76b3418adb --- /dev/null +++ b/Makefile.help @@ -0,0 +1,41 @@ +# Copyright (C) 2019 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# . + +This is the file that gets printed when the user runs "make help", +starting just after the "help-starts-here" line. + +help-starts-here + +all + The usual default; builds everything but doesn't run the + tests. +tests + Runs the testsuite. Also "make check" is a shortcut for this + +onetest + Runs one test. Use like this: + make onetest t=wcsmbs/test-wcsnlen + Note that this will rebuild the test if needed, but will not + rebuild what "make all" would have rebuilt. + +-- +Other useful hints: + +$ rm $(objpfx)testroot.pristine/install.stamp + Forces the testroot to be reinstalled the next time you run + the testsuite (or just rm -rf testroot.pristine) +