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 From: Fam Zheng 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> Subject: [Qemu-devel] [PATCH RFC 7/7] tests: Move i386 tcg tests to check-tcg List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, thuth@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , programmingkidx@gmail.com, crosa@redhat.com, pbonzini@redhat.com, rth@twiddle.net 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 $@ \ + $(