From patchwork Mon Jun 27 09:33:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 55430 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B8445386F0F1 for ; Mon, 27 Jun 2022 09:35:00 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [IPv6:2a01:e0c:1:1599::12]) by sourceware.org (Postfix) with ESMTPS id 0895F3841898 for ; Mon, 27 Jun 2022 09:33:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0895F3841898 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=opteya.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=opteya.com Received: from localhost (unknown [IPv6:2a01:e35:39f2:1220:faf6:baaf:a916:b303]) by smtp3-g21.free.fr (Postfix) with ESMTPS id 45BFD13F80A; Mon, 27 Jun 2022 11:33:41 +0200 (CEST) From: Yann Droneaud To: libc-alpha@sourceware.org Subject: [PATCH] build: report an error message when missing test name Date: Mon, 27 Jun 2022 11:33:31 +0200 Message-Id: <20220627093331.4069894-1-ydroneaud@opteya.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yann Droneaud Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Running "make test" without a test name fails with a surprising unhelpful error message: $ make test make -r PARALLELMFLAGS="" -C .. objdir=`pwd` test make[1]: Entering directory '.../glibc' make subdir= -C ..=../ .../glibc/build/.out make[2]: Entering directory '.../glibc' make[2]: *** ..=../: No such file or directory. Stop. make[2]: Leaving directory '.../glibc' make[1]: *** [Makefile:743: test] Error 2 make[1]: Leaving directory '.../glibc' make: *** [Makefile:9: test] Error 2 It's better to report a useful error message: $ make test make -r PARALLELMFLAGS="" -C .. objdir=`pwd` test make[1]: Entering directory '/home/ydroneaud/src/UPSTREAM/glibc' Makefile:742: *** Missing test name: usage make test t=. Stop. make[1]: Leaving directory '/home/ydroneaud/src/UPSTREAM/glibc' make: *** [Makefile:9: test] Error 2 Signed-off-by: Yann Droneaud --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 179dd478ffa8..a4a7b3aae1b8 100644 --- a/Makefile +++ b/Makefile @@ -739,6 +739,7 @@ iconvdata/% localedata/% po/%: FORCE # Example: make test t=wcsmbs/test-wcsnlen .PHONY: test test : + @$(if $t,:,$(error Missing test name: usage make test t=)) @-rm -f $(objpfx)$t.out $(MAKE) subdir=$(patsubst %/,%,$(dir $t)) -C $(dir $t) ..=../ $(objpfx)$t.out @cat $(objpfx)$t.test-result