From nobody Tue Feb 10 20:48:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529095452052283.3807489959768; Fri, 15 Jun 2018 13:44:12 -0700 (PDT) Received: from localhost ([::1]:49310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTvZr-0004Tb-At for importer@patchew.org; Fri, 15 Jun 2018 16:44:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTuyL-0000e2-JV for qemu-devel@nongnu.org; Fri, 15 Jun 2018 16:05:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTuyI-0007p1-1I for qemu-devel@nongnu.org; Fri, 15 Jun 2018 16:05:25 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:40368) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTuyH-0007oA-LI for qemu-devel@nongnu.org; Fri, 15 Jun 2018 16:05:21 -0400 Received: by mail-wm0-x235.google.com with SMTP id n5-v6so5756228wmc.5 for ; Fri, 15 Jun 2018 13:05:21 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t124-v6sm1806263wmt.29.2018.06.15.13.05.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jun 2018 13:05:14 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 76AB23E0FA9; Fri, 15 Jun 2018 20:47:09 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Wh2wk02MK4iYtp/RWzY2WpOp3D+0lt8WtErhgVyAemI=; b=Gj2GKi1SSKjaz5r1E4FA/UmmLgHyR+JG7emN6y/OetdGylfoPLgaH3BfycI3na4X+Y ZqGVtSiACXwJwL4SZS2mmmOlBmY8f0zoSaNf4J6SSrCuOcPTdCXCTWWXcCUO62kAR5ds erT0X0ap05cpMcdb7ZgaFIoB0xyrkiQiImBp4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Wh2wk02MK4iYtp/RWzY2WpOp3D+0lt8WtErhgVyAemI=; b=tHyfLfvssOTYzXNJKCgo+os6N++6pwfrtRS02yMYJV1NCCwCOuoWjlWPWoORTW2ceJ MR0QDc7lYZlicC2a38Rt6KIXw7dPWXhC7hKfvavEfkif0/o01LvqNfyQmsUNBafVQ4LD YkxAvPy92VfFjoqT1El4jdtsIMKYAmLKGOAQJrfrnDuIlnIGxX+TZuE5IvU58c3jlz3a Q/7731A/wV1nkYnG0EhOtuOWcHW/bMBZpxMLOxv3/urhh7dFmU0MxAYOC3ZX5DFeztD9 0X6wqA7fy1WwETWFFzEy1JP0jI/VRCh+dGgROOEFBy4VY6O1KLDxN5EfMIISd/8lITPt 1m3Q== X-Gm-Message-State: APt69E10cfQ/ibXTz9qMr7KHODnIhOIgdP4eFog4PECPO3BoYk5hIwqf XCoThHkD/+SWCgHoFgBfap5iPI3vI/8= X-Google-Smtp-Source: ADUXVKLHB+YpZz/Ad+TeHTfhm5jQF5n4Ej38CaYxQi1zPMr2PqU6RxLY++l7iwV7qgDWly2JvjY2lw== X-Received: by 2002:a1c:4189:: with SMTP id o131-v6mr2115705wma.7.1529093120482; Fri, 15 Jun 2018 13:05:20 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de, peter.maydell@linaro.org Date: Fri, 15 Jun 2018 20:46:57 +0100 Message-Id: <20180615194705.28019-47-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180615194705.28019-1-alex.bennee@linaro.org> References: <20180615194705.28019-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::235 Subject: [Qemu-devel] [PATCH v7 46/54] tests/tcg: add run, diff, and skip helper macros X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , qemu-devel@nongnu.org, "open list:ARM" , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 As we aren't using the default runners for all the test cases it is easy to miss out things like timeouts. To help with this we add some helpers and use them so we only need to make core changes in one place. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- v5 - new for v5 v5.1 - diff-test->diff-out v7 - mention $(TARGET_NAME) when skipping --- tests/tcg/Makefile | 13 ++++++++++--- tests/tcg/aarch64/Makefile.target | 6 ++---- tests/tcg/arm/Makefile.target | 6 ++---- tests/tcg/i386/Makefile.target | 10 ++++------ tests/tcg/multiarch/Makefile.target | 4 ++-- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index e7dbcdb5bf..bf06415390 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -34,6 +34,15 @@ =20 quiet-command =3D $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1= , @$1)) =20 +# $1 =3D test name, $2 =3D cmd, $3 =3D desc +run-test =3D $(call quiet-command, timeout $(TIMEOUT) $2 > $1.out,"TEST",$= 3) + +# $1 =3D test name, $2 =3D reference +diff-out =3D $(call quiet-command, diff -u $1.out $2 | head -n 10,"DIFF","= $1.out with $2") + +# $1 =3D test name, $2 =3D reason +skip-test =3D @printf " SKIPPED %s on $(TARGET_NAME) because %s\n" $1 $2 + # Tests we are building TESTS=3D =20 @@ -84,9 +93,7 @@ RUN_TESTS=3D$(patsubst %,run-%, $(TESTS)) RUN_TESTS+=3D$(EXTRA_RUNS) =20 run-%: % - $(call quiet-command, \ - timeout $(TIMEOUT) $(QEMU) $< > $<.out, \ - "TEST", "$< on $(TARGET_NAME)") + $(call run-test, $<, $(QEMU) $<, "$< on $(TARGET_NAME)") =20 .PHONY: run run: $(RUN_TESTS) diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile= .target index 7dba32138d..08c45b8470 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -13,7 +13,5 @@ TESTS:=3D$(AARCH64_TESTS) fcvt: LDFLAGS+=3D-lm =20 run-fcvt: fcvt - $(call quiet-command, \ - $(QEMU) $< > fcvt.out && \ - diff -u $(AARCH64_SRC)/fcvt.ref fcvt.out, \ - "TEST", "$< (default) on $(TARGET_NAME)") + $(call run-test,$<,$(QEMU) $<, "$< on $(TARGET_NAME)") + $(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref) diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index 14b5435fc6..aa4e4e3782 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -24,10 +24,8 @@ fcvt: LDFLAGS+=3D-lm # fcvt: CFLAGS+=3D-march=3Darmv8.2-a+fp16 -mfpu=3Dneon-fp-armv8 =20 run-fcvt: fcvt - $(call quiet-command, \ - $(QEMU) $< > fcvt.out && \ - diff -u $(ARM_SRC)/fcvt.ref fcvt.out, \ - "TEST", "$< (default) on $(TARGET_NAME)") + $(call run-test,fcvt,$(QEMU) $<,"$< on $(TARGET_NAME)") + $(call diff-out,fcvt,$(ARM_SRC)/fcvt.ref) endif =20 # On ARM Linux only supports 4k pages diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index cd173363ee..97b7c23cf1 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -31,7 +31,7 @@ test-i386: test-i386.c test-i386-code16.S test-i386-vm86.= S test-i386.h test-i386 =20 # Specialist test runners run-runcom: runcom pi_10.com - $(call quiet-command, $(QEMU) ./runcom $(I386_SRC)/pi_10.com > runcom.out= , "TEST", "$< on $(TARGET_NAME)") + $(call run-test,$<,$(QEMU) ./runcom $(I386_SRC)/pi_10.com,"$< on $(TARGET= _NAME)") =20 ifeq ($(SPEED), slow) =20 @@ -40,13 +40,11 @@ test-i386-fprem.ref: test-i386-fprem =20 run-test-i386-fprem: TIMEOUT=3D60 run-test-i386-fprem: test-i386-fprem - $(call quiet-command, \ - $(QEMU) $< > $<.out && \ - diff -u $(I386_SRC)/$<.ref $<.out, \ - "TEST", "$< (default) on $(TARGET_NAME)") + $(call run-test,test-i386-fprem, $(QEMU) $<,"$< on $(TARGET_NAME)") + $(call diff-out,test-i386-fprem, $(I386_SRC)/$<.ref) else run-test-i386-fprem: test-i386-fprem - $(call quiet-command, /bin/true, "SLOW TEST", "$< SKIPPED on $(TARGET_NAM= E)") + $(call skip-test, $<, "SLOW") endif =20 # On i386 and x86_64 Linux only supports 4k pages (large pages are a diffe= rent hack) diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Make= file.target index 90e45a881e..b77084c146 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -27,10 +27,10 @@ testthread: LDFLAGS+=3D-lpthread =20 # default case (host page size) run-test-mmap: test-mmap - $(call quiet-command, $(QEMU) $< > test-mmap.out, "TEST", \ + $(call run-test, test-mmap, $(QEMU) $<, \ "$< (default) on $(TARGET_NAME)") =20 # additional page sizes (defined by each architecture adding to EXTRA_RUNS) run-test-mmap-%: test-mmap - $(call quiet-command, $(QEMU) -p $* $< > test-mmap-$*.out, "TEST", \ + $(call run-test, test-mmap-$*, $(QEMU) -p $* $<,\ "$< ($* byte pages) on $(TARGET_NAME)") --=20 2.17.1