From patchwork Fri Sep 8 09:17:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 811412 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=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xpWzC4zZxz9s82 for ; Fri, 8 Sep 2017 19:21:27 +1000 (AEST) Received: from localhost ([::1]:44052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqFTZ-0000JA-Nj for incoming@patchwork.ozlabs.org; Fri, 08 Sep 2017 05:21:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqFQ6-0006Rj-SA for qemu-devel@nongnu.org; Fri, 08 Sep 2017 05:17:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqFQ0-000138-8E for qemu-devel@nongnu.org; Fri, 08 Sep 2017 05:17:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57646) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dqFPz-00011a-W4 for qemu-devel@nongnu.org; Fri, 08 Sep 2017 05:17:44 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 19DBF81DE4; Fri, 8 Sep 2017 09:17:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 19DBF81DE4 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=famz@redhat.com Received: from lemon.redhat.com (ovpn-12-98.pek2.redhat.com [10.72.12.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67F1E60241; Fri, 8 Sep 2017 09:17:38 +0000 (UTC) From: Fam Zheng To: qemu-devel@nongnu.org Date: Fri, 8 Sep 2017 17:17:00 +0800 Message-Id: <20170908091700.14867-8-famz@redhat.com> In-Reply-To: <20170908091700.14867-1-famz@redhat.com> References: <20170908091700.14867-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 08 Sep 2017 09:17:43 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH RFC 7/7] tests: Move i386 tcg tests to check-tcg 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: peter.maydell@linaro.org, thuth@redhat.com, Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , programmingkidx@gmail.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , rth@twiddle.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Only enable the tests if i386-linux-user is a specified target in configure, and build the test programs with "docker.py cc" command. Also change the "diff -u" to "cmp -s" because we have really huge output to compare. Signed-off-by: Fam Zheng --- tests/tcg/Makefile | 60 ------------------------------------- tests/tcg/Makefile.include | 74 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 61 deletions(-) diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 89e3342f3d..4a2b069304 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -17,15 +17,6 @@ LDFLAGS= # runcom maps page 0, so it requires root privileges # also, pi_10.com runs indefinitely -I386_TESTS=hello-i386 \ - linux-test \ - testthread \ - sha1-i386 \ - test-i386 \ - test-i386-fprem \ - test-mmap \ - # runcom - # native i386 compilers sometimes are not biarch. assume cross-compilers are ifneq ($(ARCH),i386) I386_TESTS+=run-test-x86_64 @@ -46,35 +37,11 @@ test: all run-%: % -$(QEMU) ./$* -run-hello-i386: hello-i386 -run-linux-test: linux-test -run-testthread: testthread -run-sha1-i386: sha1-i386 - -run-test-i386: test-i386 - ./test-i386 > test-i386.ref - -$(QEMU) test-i386 > test-i386.out - @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi - -run-test-i386-fprem: test-i386-fprem - ./test-i386-fprem > test-i386-fprem.ref - -$(QEMU) test-i386-fprem > test-i386-fprem.out - @if diff -u test-i386-fprem.ref test-i386-fprem.out ; then echo "Auto Test OK"; fi - run-test-x86_64: test-x86_64 ./test-x86_64 > test-x86_64.ref -$(QEMU_X86_64) test-x86_64 > test-x86_64.out @if diff -u test-x86_64.ref test-x86_64.out ; then echo "Auto Test OK"; fi -run-test-mmap: test-mmap - -$(QEMU) ./test-mmap - -$(QEMU) -p 8192 ./test-mmap 8192 - -$(QEMU) -p 16384 ./test-mmap 16384 - -$(QEMU) -p 32768 ./test-mmap 32768 - -run-runcom: runcom - -$(QEMU) ./runcom $(SRC_PATH)/tests/pi_10.com - run-test_path: test_path ./test_path @@ -84,37 +51,10 @@ test_path: test_path.o test_path.o: test_path.c -hello-i386: hello-i386.c - $(CC_I386) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $< - strip $@ - -testthread: testthread.c - $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread - -# i386/x86_64 emulation test (test various opcodes) */ -test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \ - test-i386.h test-i386-shift.h test-i386-muldiv.h - $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ \ - $( $<.ref + -$(QEMU) $< > $<.out + @if cmp -s $<.ref $<.out ; then echo "Auto Test OK"; fi + +tcg-run-test-mmap: tests/tcg/test-mmap + -$(QEMU) $< + -$(QEMU) -p 8192 $< 8192 + -$(QEMU) -p 16384 $< 16384 + -$(QEMU) -p 32768 $< 32768 + +tcg-run-runcom: tests/tcg/runcom + -$(QEMU) $< $(SRC_PATH)/tests/tcg/pi_10.com + +TCG_TESTS = $(if $(filter i386-linux-user, $(TARGET_LIST)), $(TCG_I386_TESTS)) + +$(addprefix tests/tcg/, $(TCG_TESTS)): CXX := +$(addprefix tests/tcg/, $(TCG_TESTS)): CC := \ + $(SRC_PATH)/tests/docker/docker.py cc -i qemu:$(DOCKER_IMAGE) -s $(SRC_PATH) -- + +tests/tcg/hello-i386: LDFLAGS := -nostdlib + +tests/tcg/sha1-i386: tests/tcg/sha1.o + $(call LINK, $^) + +tests/tcg/test-i386: $(addprefix $(SRC_PATH)/tests/tcg/, \ + test-i386.c test-i386-code16.S test-i386-vm86.S \ + test-i386.h test-i386-shift.h test-i386-muldiv.h) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ \ + $(