* [Qemu-devel] [PATCH 1/6] tests/tcg: Move i386 tests to arch specific folder
2016-09-17 14:03 [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests Pranith Kumar
@ 2016-09-17 14:03 ` Pranith Kumar
2016-09-19 8:44 ` Marc-André Lureau
2016-09-17 14:03 ` [Qemu-devel] [PATCH 2/6] tests/tcg: Move arm " Pranith Kumar
` (5 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Pranith Kumar @ 2016-09-17 14:03 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, rth
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
tests/tcg/Makefile | 156 --------------------------------
tests/tcg/i386/Makefile | 88 ++++++++++++++++++
tests/tcg/{ => i386}/hello-i386.c | 9 +-
tests/tcg/{ => i386}/pi_10.com | Bin
tests/tcg/{ => i386}/runcom.c | 0
tests/tcg/{ => i386}/test-i386-code16.S | 0
tests/tcg/{ => i386}/test-i386-fprem.c | 0
tests/tcg/{ => i386}/test-i386-muldiv.h | 0
tests/tcg/{ => i386}/test-i386-shift.h | 0
tests/tcg/{ => i386}/test-i386-ssse3.c | 0
tests/tcg/{ => i386}/test-i386-vm86.S | 0
tests/tcg/{ => i386}/test-i386.c | 0
tests/tcg/{ => i386}/test-i386.h | 0
13 files changed, 93 insertions(+), 160 deletions(-)
delete mode 100644 tests/tcg/Makefile
create mode 100644 tests/tcg/i386/Makefile
rename tests/tcg/{ => i386}/hello-i386.c (71%)
rename tests/tcg/{ => i386}/pi_10.com (100%)
rename tests/tcg/{ => i386}/runcom.c (100%)
rename tests/tcg/{ => i386}/test-i386-code16.S (100%)
rename tests/tcg/{ => i386}/test-i386-fprem.c (100%)
rename tests/tcg/{ => i386}/test-i386-muldiv.h (100%)
rename tests/tcg/{ => i386}/test-i386-shift.h (100%)
rename tests/tcg/{ => i386}/test-i386-ssse3.c (100%)
rename tests/tcg/{ => i386}/test-i386-vm86.S (100%)
rename tests/tcg/{ => i386}/test-i386.c (100%)
rename tests/tcg/{ => i386}/test-i386.h (100%)
diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile
deleted file mode 100644
index 89e3342..0000000
--- a/tests/tcg/Makefile
+++ /dev/null
@@ -1,156 +0,0 @@
--include ../../config-host.mak
--include $(SRC_PATH)/rules.mak
-
-$(call set-vpath, $(SRC_PATH)/tests/tcg)
-
-QEMU=../../i386-linux-user/qemu-i386
-QEMU_X86_64=../../x86_64-linux-user/qemu-x86_64
-CC_X86_64=$(CC_I386) -m64
-
-QEMU_INCLUDES += -I../..
-CFLAGS=-Wall -O2 -g -fno-strict-aliasing
-#CFLAGS+=-msse2
-LDFLAGS=
-
-# TODO: automatically detect ARM and MIPS compilers, and run those too
-
-# 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
-endif
-
-TESTS = test_path
-ifneq ($(call find-in-path, $(CC_I386)),)
-TESTS += $(I386_TESTS)
-endif
-
-all: $(patsubst %,run-%,$(TESTS))
-test: all
-
-# rules to run tests
-
-.PHONY: $(patsubst %,run-%,$(TESTS))
-
-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
-
-# rules to compile tests
-
-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 $@ \
- $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm
-
-test-i386-fprem: test-i386-fprem.c
- $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $^
-
-test-x86_64: test-i386.c \
- test-i386.h test-i386-shift.h test-i386-muldiv.h
- $(CC_X86_64) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $(<D)/test-i386.c -lm
-
-# generic Linux and CPU test
-linux-test: linux-test.c
- $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
-
-# vm86 test
-runcom: runcom.c
- $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $<
-
-test-mmap: test-mmap.c
- $(CC_I386) -m32 $(CFLAGS) -Wall -O2 $(LDFLAGS) -o $@ $<
-
-# speed test
-sha1-i386: sha1.c
- $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $<
-
-sha1: sha1.c
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
-
-speed: sha1 sha1-i386
- time ./sha1
- time $(QEMU) ./sha1-i386
-
-# arm test
-hello-arm: hello-arm.o
- arm-linux-ld -o $@ $<
-
-hello-arm.o: hello-arm.c
- arm-linux-gcc -Wall -g -O2 -c -o $@ $<
-
-test-arm-iwmmxt: test-arm-iwmmxt.s
- cpp < $< | arm-linux-gnu-gcc -Wall -static -march=iwmmxt -mabi=aapcs -x assembler - -o $@
-
-# MIPS test
-hello-mips: hello-mips.c
- mips-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
-
-hello-mipsel: hello-mips.c
- mipsel-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
-
-# testsuite for the CRIS port.
-test-cris:
- $(MAKE) -C cris check
-
-# testsuite for the LM32 port.
-test-lm32:
- $(MAKE) -C lm32 check
-
-clean:
- rm -f *~ *.o test-i386.out test-i386.ref \
- test-x86_64.log test-x86_64.ref qruncom $(TESTS)
diff --git a/tests/tcg/i386/Makefile b/tests/tcg/i386/Makefile
new file mode 100644
index 0000000..15f77af
--- /dev/null
+++ b/tests/tcg/i386/Makefile
@@ -0,0 +1,88 @@
+BUILD_DIR=../../../build/
+SRC_PATH=../../../
+include $(BUILD_DIR)/config-host.mak
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/i386)
+
+QEMU=$(BUILD_DIR)/i386-linux-user/qemu-i386
+QEMU_X86_64=$(BUILD_DIR)/x86_64-linux-user/qemu-x86_64
+CC_X86_64=$(CC_I386) -m64
+
+QEMU_INCLUDES += -I$(BUILD_DIR)
+CFLAGS=-Wall -O2 -g -fno-strict-aliasing
+#CFLAGS+=-msse2
+LDFLAGS=
+
+# TODO: automatically detect ARM and MIPS compilers, and run those too
+
+# runcom maps page 0, so it requires root privileges
+# also, pi_10.com runs indefinitely
+
+I386_TESTS=hello-i386 \
+ test-i386 \
+ test-i386-fprem
+ # runcom
+
+# native i386 compilers sometimes are not biarch. assume cross-compilers are
+ifneq ($(ARCH),i386)
+I386_TESTS+=run-test-x86_64
+endif
+
+all: $(patsubst %,run-%,$(I386_TESTS))
+test: all
+
+# rules to run tests
+
+.PHONY: $(patsubst %,run-%,$(I386_TESTS))
+
+run-%: %
+ -$(QEMU) ./$*
+
+run-hello-i386: hello-i386
+ $(QEMU) ./hello-i386
+
+run-test-i386: test-i386
+ ./test-i386 > test-i386.ref
+ -$(QEMU) test-i386 > test-i386.out
+ @if cmp -s 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_X86_64) test-i386-fprem > test-i386-fprem.out
+ @if cmp -s 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-runcom: runcom
+ -$(QEMU) ./runcom $(SRC_PATH)/tests/pi_10.com
+
+# rules to compile tests
+
+hello-i386: hello-i386.c
+ $(CC_I386) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
+ strip $@
+
+# 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 $@ \
+ $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm
+
+test-i386-fprem: test-i386-fprem.c
+ $(CC) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $^ `pkg-config --cflags --libs glib-2.0`
+
+test-x86_64: test-i386.c \
+ test-i386.h test-i386-shift.h test-i386-muldiv.h
+ $(CC_X86_64) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $(<D)/test-i386.c -lm
+
+# vm86 test
+runcom: runcom.c
+ $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+clean:
+ rm -f *~ *.o test-i386.out test-i386.ref test-i386-fprem.out test-i386-fprem.ref \
+ test-x86_64.log test-x86_64.ref qruncom $(I386_TESTS)
diff --git a/tests/tcg/hello-i386.c b/tests/tcg/i386/hello-i386.c
similarity index 71%
rename from tests/tcg/hello-i386.c
rename to tests/tcg/i386/hello-i386.c
index fa00380..ab55922 100644
--- a/tests/tcg/hello-i386.c
+++ b/tests/tcg/i386/hello-i386.c
@@ -1,6 +1,7 @@
#include <asm/unistd.h>
+#include <stddef.h>
-static inline void exit(int status)
+static inline void _exit(int status)
{
int __res;
__asm__ volatile ("movl %%ecx,%%ebx\n"\
@@ -8,7 +9,7 @@ static inline void exit(int status)
: "=a" (__res) : "0" (__NR_exit),"c" ((long)(status)));
}
-static inline int write(int fd, const char * buf, int len)
+static inline size_t _write(int fd, const void * buf, size_t len)
{
int status;
__asm__ volatile ("pushl %%ebx\n"\
@@ -22,6 +23,6 @@ static inline int write(int fd, const char * buf, int len)
void _start(void)
{
- write(1, "Hello World\n", 12);
- exit(0);
+ _write(1, "Hello World\n", 12);
+ _exit(0);
}
diff --git a/tests/tcg/pi_10.com b/tests/tcg/i386/pi_10.com
similarity index 100%
rename from tests/tcg/pi_10.com
rename to tests/tcg/i386/pi_10.com
diff --git a/tests/tcg/runcom.c b/tests/tcg/i386/runcom.c
similarity index 100%
rename from tests/tcg/runcom.c
rename to tests/tcg/i386/runcom.c
diff --git a/tests/tcg/test-i386-code16.S b/tests/tcg/i386/test-i386-code16.S
similarity index 100%
rename from tests/tcg/test-i386-code16.S
rename to tests/tcg/i386/test-i386-code16.S
diff --git a/tests/tcg/test-i386-fprem.c b/tests/tcg/i386/test-i386-fprem.c
similarity index 100%
rename from tests/tcg/test-i386-fprem.c
rename to tests/tcg/i386/test-i386-fprem.c
diff --git a/tests/tcg/test-i386-muldiv.h b/tests/tcg/i386/test-i386-muldiv.h
similarity index 100%
rename from tests/tcg/test-i386-muldiv.h
rename to tests/tcg/i386/test-i386-muldiv.h
diff --git a/tests/tcg/test-i386-shift.h b/tests/tcg/i386/test-i386-shift.h
similarity index 100%
rename from tests/tcg/test-i386-shift.h
rename to tests/tcg/i386/test-i386-shift.h
diff --git a/tests/tcg/test-i386-ssse3.c b/tests/tcg/i386/test-i386-ssse3.c
similarity index 100%
rename from tests/tcg/test-i386-ssse3.c
rename to tests/tcg/i386/test-i386-ssse3.c
diff --git a/tests/tcg/test-i386-vm86.S b/tests/tcg/i386/test-i386-vm86.S
similarity index 100%
rename from tests/tcg/test-i386-vm86.S
rename to tests/tcg/i386/test-i386-vm86.S
diff --git a/tests/tcg/test-i386.c b/tests/tcg/i386/test-i386.c
similarity index 100%
rename from tests/tcg/test-i386.c
rename to tests/tcg/i386/test-i386.c
diff --git a/tests/tcg/test-i386.h b/tests/tcg/i386/test-i386.h
similarity index 100%
rename from tests/tcg/test-i386.h
rename to tests/tcg/i386/test-i386.h
--
2.9.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [Qemu-devel] [PATCH 1/6] tests/tcg: Move i386 tests to arch specific folder
2016-09-17 14:03 ` [Qemu-devel] [PATCH 1/6] tests/tcg: Move i386 tests to arch specific folder Pranith Kumar
@ 2016-09-19 8:44 ` Marc-André Lureau
2016-09-19 16:01 ` Pranith Kumar
0 siblings, 1 reply; 15+ messages in thread
From: Marc-André Lureau @ 2016-09-19 8:44 UTC (permalink / raw)
To: Pranith Kumar, qemu-devel; +Cc: alex.bennee, rth
Hi
On Sat, Sep 17, 2016 at 6:05 PM Pranith Kumar <bobby.prani@gmail.com> wrote:
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> ---
> tests/tcg/Makefile | 156
> --------------------------------
> tests/tcg/i386/Makefile | 88 ++++++++++++++++++
> tests/tcg/{ => i386}/hello-i386.c | 9 +-
> tests/tcg/{ => i386}/pi_10.com | Bin
> tests/tcg/{ => i386}/runcom.c | 0
> tests/tcg/{ => i386}/test-i386-code16.S | 0
> tests/tcg/{ => i386}/test-i386-fprem.c | 0
> tests/tcg/{ => i386}/test-i386-muldiv.h | 0
> tests/tcg/{ => i386}/test-i386-shift.h | 0
> tests/tcg/{ => i386}/test-i386-ssse3.c | 0
> tests/tcg/{ => i386}/test-i386-vm86.S | 0
> tests/tcg/{ => i386}/test-i386.c | 0
> tests/tcg/{ => i386}/test-i386.h | 0
>
Moving i386 specific files to their own subdir like the rest of the archs
is a good idea to me.
13 files changed, 93 insertions(+), 160 deletions(-)
> delete mode 100644 tests/tcg/Makefile
> create mode 100644 tests/tcg/i386/Makefile
> rename tests/tcg/{ => i386}/hello-i386.c (71%)
> rename tests/tcg/{ => i386}/pi_10.com (100%)
> rename tests/tcg/{ => i386}/runcom.c (100%)
> rename tests/tcg/{ => i386}/test-i386-code16.S (100%)
> rename tests/tcg/{ => i386}/test-i386-fprem.c (100%)
> rename tests/tcg/{ => i386}/test-i386-muldiv.h (100%)
> rename tests/tcg/{ => i386}/test-i386-shift.h (100%)
> rename tests/tcg/{ => i386}/test-i386-ssse3.c (100%)
> rename tests/tcg/{ => i386}/test-i386-vm86.S (100%)
> rename tests/tcg/{ => i386}/test-i386.c (100%)
> rename tests/tcg/{ => i386}/test-i386.h (100%)
>
> diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile
> deleted file mode 100644
> index 89e3342..0000000
> --- a/tests/tcg/Makefile
> +++ /dev/null
> @@ -1,156 +0,0 @@
> --include ../../config-host.mak
> --include $(SRC_PATH)/rules.mak
> -
> -$(call set-vpath, $(SRC_PATH)/tests/tcg)
> -
> -QEMU=../../i386-linux-user/qemu-i386
> -QEMU_X86_64=../../x86_64-linux-user/qemu-x86_64
> -CC_X86_64=$(CC_I386) -m64
> -
> -QEMU_INCLUDES += -I../..
> -CFLAGS=-Wall -O2 -g -fno-strict-aliasing
> -#CFLAGS+=-msse2
> -LDFLAGS=
> -
> -# TODO: automatically detect ARM and MIPS compilers, and run those too
> -
> -# 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
> -endif
> -
> -TESTS = test_path
> -ifneq ($(call find-in-path, $(CC_I386)),)
> -TESTS += $(I386_TESTS)
> -endif
> -
> -all: $(patsubst %,run-%,$(TESTS))
> -test: all
> -
> -# rules to run tests
> -
> -.PHONY: $(patsubst %,run-%,$(TESTS))
> -
> -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
> -
> -# rules to compile tests
> -
> -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 $@ \
> - $(<D)/test-i386.c $(<D)/test-i386-code16.S
> $(<D)/test-i386-vm86.S -lm
> -
> -test-i386-fprem: test-i386-fprem.c
> - $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $^
> -
> -test-x86_64: test-i386.c \
> - test-i386.h test-i386-shift.h test-i386-muldiv.h
> - $(CC_X86_64) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@
> $(<D)/test-i386.c -lm
> -
> -# generic Linux and CPU test
> -linux-test: linux-test.c
> - $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
> -
> -# vm86 test
> -runcom: runcom.c
> - $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $<
> -
> -test-mmap: test-mmap.c
> - $(CC_I386) -m32 $(CFLAGS) -Wall -O2 $(LDFLAGS) -o $@ $<
> -
> -# speed test
> -sha1-i386: sha1.c
> - $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $<
> -
> -sha1: sha1.c
> - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
> -
> -speed: sha1 sha1-i386
> - time ./sha1
> - time $(QEMU) ./sha1-i386
> -
> -# arm test
> -hello-arm: hello-arm.o
> - arm-linux-ld -o $@ $<
> -
> -hello-arm.o: hello-arm.c
> - arm-linux-gcc -Wall -g -O2 -c -o $@ $<
> -
> -test-arm-iwmmxt: test-arm-iwmmxt.s
> - cpp < $< | arm-linux-gnu-gcc -Wall -static -march=iwmmxt
> -mabi=aapcs -x assembler - -o $@
> -
> -# MIPS test
> -hello-mips: hello-mips.c
> - mips-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC
> -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
> -
> -hello-mipsel: hello-mips.c
> - mipsel-linux-gnu-gcc -nostdlib -static -mno-abicalls -fno-PIC
> -mabi=32 -Wall -Wextra -g -O2 -o $@ $<
> -
> -# testsuite for the CRIS port.
> -test-cris:
> - $(MAKE) -C cris check
> -
> -# testsuite for the LM32 port.
> -test-lm32:
> - $(MAKE) -C lm32 check
> -
> -clean:
> - rm -f *~ *.o test-i386.out test-i386.ref \
> - test-x86_64.log test-x86_64.ref qruncom $(TESTS)
> diff --git a/tests/tcg/i386/Makefile b/tests/tcg/i386/Makefile
> new file mode 100644
> index 0000000..15f77af
> --- /dev/null
> +++ b/tests/tcg/i386/Makefile
> @@ -0,0 +1,88 @@
> +BUILD_DIR=../../../build/
>
Looks like you are hardcoding a custom path here.
There are many Makefile changes that I think you should split to help
review.
+SRC_PATH=../../../
> +include $(BUILD_DIR)/config-host.mak
> +include $(SRC_PATH)/rules.mak
> +
> +$(call set-vpath, $(SRC_PATH)/tests/tcg/i386)
> +
> +QEMU=$(BUILD_DIR)/i386-linux-user/qemu-i386
> +QEMU_X86_64=$(BUILD_DIR)/x86_64-linux-user/qemu-x86_64
> +CC_X86_64=$(CC_I386) -m64
> +
> +QEMU_INCLUDES += -I$(BUILD_DIR)
> +CFLAGS=-Wall -O2 -g -fno-strict-aliasing
> +#CFLAGS+=-msse2
> +LDFLAGS=
> +
> +# TODO: automatically detect ARM and MIPS compilers, and run those too
> +
>
Not relevant anymore
> +# runcom maps page 0, so it requires root privileges
> +# also, pi_10.com runs indefinitely
> +
>
+I386_TESTS=hello-i386 \
> + test-i386 \
> + test-i386-fprem
> + # runcom
> +
> +# native i386 compilers sometimes are not biarch. assume cross-compilers
> are
> +ifneq ($(ARCH),i386)
> +I386_TESTS+=run-test-x86_64
>
btw this is wrong, it should be test-x86_64, since run- is prepended later
+endif
> +
> +all: $(patsubst %,run-%,$(I386_TESTS))
> +test: all
> +
> +# rules to run tests
> +
> +.PHONY: $(patsubst %,run-%,$(I386_TESTS))
> +
> +run-%: %
> + -$(QEMU) ./$*
> +
> +run-hello-i386: hello-i386
> + $(QEMU) ./hello-i386
> +
> +run-test-i386: test-i386
> + ./test-i386 > test-i386.ref
> + -$(QEMU) test-i386 > test-i386.out
> + @if cmp -s 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_X86_64) test-i386-fprem > test-i386-fprem.out
> + @if cmp -s 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-runcom: runcom
> + -$(QEMU) ./runcom $(SRC_PATH)/tests/pi_10.com
> +
> +# rules to compile tests
> +
> +hello-i386: hello-i386.c
> + $(CC_I386) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
> + strip $@
> +
> +# 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 $@ \
> + $(<D)/test-i386.c $(<D)/test-i386-code16.S
> $(<D)/test-i386-vm86.S -lm
> +
> +test-i386-fprem: test-i386-fprem.c
> + $(CC) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $^ `pkg-config
> --cflags --libs glib-2.0`
> +
> +test-x86_64: test-i386.c \
> + test-i386.h test-i386-shift.h test-i386-muldiv.h
> + $(CC_X86_64) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@
> $(<D)/test-i386.c -lm
> +
> +# vm86 test
> +runcom: runcom.c
> + $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $<
> +
> +clean:
> + rm -f *~ *.o test-i386.out test-i386.ref test-i386-fprem.out
> test-i386-fprem.ref \
> + test-x86_64.log test-x86_64.ref qruncom $(I386_TESTS)
> diff --git a/tests/tcg/hello-i386.c b/tests/tcg/i386/hello-i386.c
> similarity index 71%
> rename from tests/tcg/hello-i386.c
> rename to tests/tcg/i386/hello-i386.c
> index fa00380..ab55922 100644
> --- a/tests/tcg/hello-i386.c
> +++ b/tests/tcg/i386/hello-i386.c
> @@ -1,6 +1,7 @@
> #include <asm/unistd.h>
> +#include <stddef.h>
>
> -static inline void exit(int status)
> +static inline void _exit(int status)
> {
> int __res;
> __asm__ volatile ("movl %%ecx,%%ebx\n"\
> @@ -8,7 +9,7 @@ static inline void exit(int status)
> : "=a" (__res) : "0" (__NR_exit),"c"
> ((long)(status)));
> }
>
> -static inline int write(int fd, const char * buf, int len)
> +static inline size_t _write(int fd, const void * buf, size_t len)
> {
> int status;
> __asm__ volatile ("pushl %%ebx\n"\
> @@ -22,6 +23,6 @@ static inline int write(int fd, const char * buf, int
> len)
>
> void _start(void)
> {
> - write(1, "Hello World\n", 12);
> - exit(0);
> + _write(1, "Hello World\n", 12);
> + _exit(0);
> }
>
This could be a seperate patch
> diff --git a/tests/tcg/pi_10.com b/tests/tcg/i386/pi_10.com
> similarity index 100%
> rename from tests/tcg/pi_10.com
> rename to tests/tcg/i386/pi_10.com
> diff --git a/tests/tcg/runcom.c b/tests/tcg/i386/runcom.c
> similarity index 100%
> rename from tests/tcg/runcom.c
> rename to tests/tcg/i386/runcom.c
> diff --git a/tests/tcg/test-i386-code16.S
> b/tests/tcg/i386/test-i386-code16.S
> similarity index 100%
> rename from tests/tcg/test-i386-code16.S
> rename to tests/tcg/i386/test-i386-code16.S
> diff --git a/tests/tcg/test-i386-fprem.c b/tests/tcg/i386/test-i386-fprem.c
> similarity index 100%
> rename from tests/tcg/test-i386-fprem.c
> rename to tests/tcg/i386/test-i386-fprem.c
> diff --git a/tests/tcg/test-i386-muldiv.h
> b/tests/tcg/i386/test-i386-muldiv.h
> similarity index 100%
> rename from tests/tcg/test-i386-muldiv.h
> rename to tests/tcg/i386/test-i386-muldiv.h
> diff --git a/tests/tcg/test-i386-shift.h b/tests/tcg/i386/test-i386-shift.h
> similarity index 100%
> rename from tests/tcg/test-i386-shift.h
> rename to tests/tcg/i386/test-i386-shift.h
> diff --git a/tests/tcg/test-i386-ssse3.c b/tests/tcg/i386/test-i386-ssse3.c
> similarity index 100%
> rename from tests/tcg/test-i386-ssse3.c
> rename to tests/tcg/i386/test-i386-ssse3.c
> diff --git a/tests/tcg/test-i386-vm86.S b/tests/tcg/i386/test-i386-vm86.S
> similarity index 100%
> rename from tests/tcg/test-i386-vm86.S
> rename to tests/tcg/i386/test-i386-vm86.S
> diff --git a/tests/tcg/test-i386.c b/tests/tcg/i386/test-i386.c
> similarity index 100%
> rename from tests/tcg/test-i386.c
> rename to tests/tcg/i386/test-i386.c
> diff --git a/tests/tcg/test-i386.h b/tests/tcg/i386/test-i386.h
> similarity index 100%
> rename from tests/tcg/test-i386.h
> rename to tests/tcg/i386/test-i386.h
> --
> 2.9.3
>
>
> --
Marc-André Lureau
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [Qemu-devel] [PATCH 1/6] tests/tcg: Move i386 tests to arch specific folder
2016-09-19 8:44 ` Marc-André Lureau
@ 2016-09-19 16:01 ` Pranith Kumar
0 siblings, 0 replies; 15+ messages in thread
From: Pranith Kumar @ 2016-09-19 16:01 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: qemu-devel, alex.bennee, rth
Marc-André Lureau writes:
>> index 0000000..15f77af
>> --- /dev/null
>> +++ b/tests/tcg/i386/Makefile
>> @@ -0,0 +1,88 @@
>> +BUILD_DIR=../../../build/
>>
>
> Looks like you are hardcoding a custom path here.
Missed this one. Will fix it up.
>
> There are many Makefile changes that I think you should split to help
> review.
OK, I will do that. I did not think it was worth splitting it up since I was
being lazy, but yes, it will help make the review easier I guess.
>
> +SRC_PATH=../../../
>> +include $(BUILD_DIR)/config-host.mak
>> +include $(SRC_PATH)/rules.mak
>> +
>> +$(call set-vpath, $(SRC_PATH)/tests/tcg/i386)
>> +
>> +QEMU=$(BUILD_DIR)/i386-linux-user/qemu-i386
>> +QEMU_X86_64=$(BUILD_DIR)/x86_64-linux-user/qemu-x86_64
>> +CC_X86_64=$(CC_I386) -m64
>> +
>> +QEMU_INCLUDES += -I$(BUILD_DIR)
>> +CFLAGS=-Wall -O2 -g -fno-strict-aliasing
>> +#CFLAGS+=-msse2
>> +LDFLAGS=
>> +
>> +# TODO: automatically detect ARM and MIPS compilers, and run those too
>> +
>>
>
> Not relevant anymore
Noted.
>
>
>> +# runcom maps page 0, so it requires root privileges
>> +# also, pi_10.com runs indefinitely
>> +
>>
> +I386_TESTS=hello-i386 \
>> + test-i386 \
>> + test-i386-fprem
>> + # runcom
>> +
>> +# native i386 compilers sometimes are not biarch. assume cross-compilers
>> are
>> +ifneq ($(ARCH),i386)
>> +I386_TESTS+=run-test-x86_64
>>
>
> btw this is wrong, it should be test-x86_64, since run- is prepended later
>
Will fix.
>> --- a/tests/tcg/hello-i386.c
>> +++ b/tests/tcg/i386/hello-i386.c
>> @@ -1,6 +1,7 @@
>> #include <asm/unistd.h>
>> +#include <stddef.h>
>>
>> -static inline void exit(int status)
>> +static inline void _exit(int status)
>> {
>> int __res;
>> __asm__ volatile ("movl %%ecx,%%ebx\n"\
>> @@ -8,7 +9,7 @@ static inline void exit(int status)
>> : "=a" (__res) : "0" (__NR_exit),"c"
>> ((long)(status)));
>> }
>>
>> -static inline int write(int fd, const char * buf, int len)
>> +static inline size_t _write(int fd, const void * buf, size_t len)
>> {
>> int status;
>> __asm__ volatile ("pushl %%ebx\n"\
>> @@ -22,6 +23,6 @@ static inline int write(int fd, const char * buf, int
>> len)
>>
>> void _start(void)
>> {
>> - write(1, "Hello World\n", 12);
>> - exit(0);
>> + _write(1, "Hello World\n", 12);
>> + _exit(0);
>> }
>>
>
> This could be a seperate patch
>
OK, will do.
--
Pranith
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Qemu-devel] [PATCH 2/6] tests/tcg: Move arm tests to arch specific folder
2016-09-17 14:03 [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests Pranith Kumar
2016-09-17 14:03 ` [Qemu-devel] [PATCH 1/6] tests/tcg: Move i386 tests to arch specific folder Pranith Kumar
@ 2016-09-17 14:03 ` Pranith Kumar
2016-09-17 14:03 ` [Qemu-devel] [PATCH 3/6] tests/tcg: Move mips test " Pranith Kumar
` (4 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Pranith Kumar @ 2016-09-17 14:03 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, rth
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
tests/tcg/arm/Makefile | 45 +++++++++++++++++++++++++++++++++++
tests/tcg/{ => arm}/hello-arm.c | 0
tests/tcg/{ => arm}/test-arm-iwmmxt.s | 0
3 files changed, 45 insertions(+)
create mode 100644 tests/tcg/arm/Makefile
rename tests/tcg/{ => arm}/hello-arm.c (100%)
rename tests/tcg/{ => arm}/test-arm-iwmmxt.s (100%)
diff --git a/tests/tcg/arm/Makefile b/tests/tcg/arm/Makefile
new file mode 100644
index 0000000..c2ae491
--- /dev/null
+++ b/tests/tcg/arm/Makefile
@@ -0,0 +1,45 @@
+BUILD_DIR?=$(CURDIR)
+SRC_PATH=../../../
+include $(BUILD_DIR)/config-host.mak
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/arm)
+
+QEMU=$(BUILD_DIR)/arm-linux-user/qemu-arm
+
+QEMU_INCLUDES += -I$(BUILD_DIR)
+CFLAGS=-Wall -O2 -g -fno-strict-aliasing
+LDFLAGS=
+
+# TODO: automatically detect ARM and MIPS compilers, and run those too
+
+# runcom maps page 0, so it requires root privileges
+# also, pi_10.com runs indefinitely
+
+TESTS=hello-arm arm-iwmmxt
+
+all: $(patsubst %,run-%,$(TESTS))
+test: all
+
+# rules to run tests
+
+run-%: %
+ $(QEMU) ./$*
+
+#.PHONY: $(patsubst %,run-%,$(TESTS))
+
+run-hello-arm: hello-arm
+run-arm-iwmmxt: arm-iwmmxt
+
+# arm test
+hello-arm: hello-arm.o
+ arm-linux-gnueabi-ld -o $@ $<
+
+hello-arm.o: hello-arm.c
+ arm-linux-gnueabi-gcc -Wall -g -O2 -c -o $@ $<
+
+arm-iwmmxt: test-arm-iwmmxt.s
+ cpp < $< | arm-linux-gnueabi-gcc -Wall -static -march=iwmmxt -mabi=aapcs -x assembler - -o $@
+
+clean:
+ rm -f *~ *.o $(TESTS)
diff --git a/tests/tcg/hello-arm.c b/tests/tcg/arm/hello-arm.c
similarity index 100%
rename from tests/tcg/hello-arm.c
rename to tests/tcg/arm/hello-arm.c
diff --git a/tests/tcg/test-arm-iwmmxt.s b/tests/tcg/arm/test-arm-iwmmxt.s
similarity index 100%
rename from tests/tcg/test-arm-iwmmxt.s
rename to tests/tcg/arm/test-arm-iwmmxt.s
--
2.9.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* [Qemu-devel] [PATCH 3/6] tests/tcg: Move mips test to arch specific folder
2016-09-17 14:03 [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests Pranith Kumar
2016-09-17 14:03 ` [Qemu-devel] [PATCH 1/6] tests/tcg: Move i386 tests to arch specific folder Pranith Kumar
2016-09-17 14:03 ` [Qemu-devel] [PATCH 2/6] tests/tcg: Move arm " Pranith Kumar
@ 2016-09-17 14:03 ` Pranith Kumar
2016-09-17 14:03 ` [Qemu-devel] [PATCH 4/6] tests/tcg: Create and populate misc tests for arch independent tests Pranith Kumar
` (3 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Pranith Kumar @ 2016-09-17 14:03 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, rth
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
tests/tcg/{ => mips}/hello-mips.c | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename tests/tcg/{ => mips}/hello-mips.c (100%)
diff --git a/tests/tcg/hello-mips.c b/tests/tcg/mips/hello-mips.c
similarity index 100%
rename from tests/tcg/hello-mips.c
rename to tests/tcg/mips/hello-mips.c
--
2.9.3
^ permalink raw reply [flat|nested] 15+ messages in thread* [Qemu-devel] [PATCH 4/6] tests/tcg: Create and populate misc tests for arch independent tests
2016-09-17 14:03 [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests Pranith Kumar
` (2 preceding siblings ...)
2016-09-17 14:03 ` [Qemu-devel] [PATCH 3/6] tests/tcg: Move mips test " Pranith Kumar
@ 2016-09-17 14:03 ` Pranith Kumar
2016-09-17 14:03 ` [Qemu-devel] [PATCH 5/6] tests/tcg: Add and update Makefiles Pranith Kumar
` (2 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Pranith Kumar @ 2016-09-17 14:03 UTC (permalink / raw)
To: qemu-devel, Veronia Bahaa, Paolo Bonzini; +Cc: alex.bennee, rth
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
tests/tcg/misc/Makefile | 81 +++++++++++++++++++++++++++++++++++++++
tests/tcg/{ => misc}/linux-test.c | 3 ++
tests/tcg/{ => misc}/sha1.c | 0
tests/tcg/{ => misc}/test-mmap.c | 0
tests/tcg/{ => misc}/test_path.c | 0
tests/tcg/{ => misc}/testthread.c | 0
6 files changed, 84 insertions(+)
create mode 100644 tests/tcg/misc/Makefile
rename tests/tcg/{ => misc}/linux-test.c (99%)
rename tests/tcg/{ => misc}/sha1.c (100%)
rename tests/tcg/{ => misc}/test-mmap.c (100%)
rename tests/tcg/{ => misc}/test_path.c (100%)
rename tests/tcg/{ => misc}/testthread.c (100%)
diff --git a/tests/tcg/misc/Makefile b/tests/tcg/misc/Makefile
new file mode 100644
index 0000000..0aa6f2e
--- /dev/null
+++ b/tests/tcg/misc/Makefile
@@ -0,0 +1,81 @@
+# -*- Mode: makefile -*-
+#
+# Generic linux-user TCG tests
+#
+# These tests all use standard non-architecture specific APIs so can
+# be built for all TCG targets. The Make is expected to be called in
+# the ${BUILD_DIR}/$(TARGET_NAME_ARCH)-linux-user/tests directory
+#
+# To build for other architectures call make with CROSS_CC set
+#
+
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/misc)
+
+QEMU=$(BUILD_DIR)/$(TARGET_NAME)-linux-user/qemu-$(TARGET_NAME)
+
+# Compiler set-up, default to system compiler if not set
+CROSS_CC?=$(CC)
+
+CFLAGS=-Wall -O2 -g -fno-strict-aliasing -static
+LDFLAGS=
+
+TESTS=linux-test \
+ testthread \
+ sha1 \
+ test-mmap
+
+all: $(patsubst %,run-%,$(TESTS))
+test: all
+
+# rules to run tests
+
+run-%: %
+ -$(QEMU) ./$*
+
+run-linux-test: linux-test
+run-testthread: testthread
+run-sha1: sha1
+run-test_path: test_path
+
+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-test_path: test_path
+
+# rules to compile tests
+
+# These two need to be re-written as relying on glib (rather than just glibc)
+# test_path: test_path.o
+# $(CROSS_CC) $^ -o $@ -lglib-2.0
+
+# test_path.o: test_path.c
+# $(CROSS_CC) $^ -c -o $@ $(QEMU_INCLUDES) `pkg-config --cflags --libs glib-2.0`
+
+testthread: testthread.c
+ $(CROSS_CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread
+
+# generic Linux and CPU test
+linux-test: linux-test.c
+ $(CROSS_CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
+
+test-mmap: test-mmap.c
+ $(CROSS_CC) $(CFLAGS) -Wall -O2 $(LDFLAGS) -o $@ $< -static
+
+# speed test
+sha1: sha1.c
+ $(CROSS_CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+speed: sha1
+ time ./sha1
+ time $(QEMU) ./sha1
+
+clean:
+ rm -f *~ *.o $(TESTS)
diff --git a/tests/tcg/linux-test.c b/tests/tcg/misc/linux-test.c
similarity index 99%
rename from tests/tcg/linux-test.c
rename to tests/tcg/misc/linux-test.c
index 5070d31..41ad91c 100644
--- a/tests/tcg/linux-test.c
+++ b/tests/tcg/misc/linux-test.c
@@ -39,6 +39,9 @@
#include <dirent.h>
#include <setjmp.h>
#include <sys/shm.h>
+#include <stdbool.h>
+#include <sys/resource.h>
+#include "qemu/compiler.h"
#include "qemu/cutils.h"
#define TESTPATH "/tmp/linux-test.tmp"
diff --git a/tests/tcg/sha1.c b/tests/tcg/misc/sha1.c
similarity index 100%
rename from tests/tcg/sha1.c
rename to tests/tcg/misc/sha1.c
diff --git a/tests/tcg/test-mmap.c b/tests/tcg/misc/test-mmap.c
similarity index 100%
rename from tests/tcg/test-mmap.c
rename to tests/tcg/misc/test-mmap.c
diff --git a/tests/tcg/test_path.c b/tests/tcg/misc/test_path.c
similarity index 100%
rename from tests/tcg/test_path.c
rename to tests/tcg/misc/test_path.c
diff --git a/tests/tcg/testthread.c b/tests/tcg/misc/testthread.c
similarity index 100%
rename from tests/tcg/testthread.c
rename to tests/tcg/misc/testthread.c
--
2.9.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* [Qemu-devel] [PATCH 5/6] tests/tcg: Add and update Makefiles
2016-09-17 14:03 [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests Pranith Kumar
` (3 preceding siblings ...)
2016-09-17 14:03 ` [Qemu-devel] [PATCH 4/6] tests/tcg: Create and populate misc tests for arch independent tests Pranith Kumar
@ 2016-09-17 14:03 ` Pranith Kumar
2016-09-23 18:25 ` Max Filippov
2016-09-17 14:03 ` [Qemu-devel] [PATCH 6/6] tests/tcg: Add tests-tcg hook in Makefile Pranith Kumar
2016-09-19 11:55 ` [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests Marc-André Lureau
6 siblings, 1 reply; 15+ messages in thread
From: Pranith Kumar @ 2016-09-17 14:03 UTC (permalink / raw)
To: qemu-devel, Richard Henderson, Edgar E. Iglesias, Michael Walle,
Aurelien Jarno, Leon Alrae, Jia Liu, Max Filippov
Cc: alex.bennee
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
tests/tcg/alpha/Makefile | 38 +++++++++++++++++++----------
tests/tcg/arm/Makefile | 28 +++++++++++++---------
tests/tcg/cris/Makefile | 17 +++++++++++--
tests/tcg/i386/Makefile | 23 +++++++++---------
tests/tcg/lm32/Makefile | 17 +++++++++++--
tests/tcg/mips/Makefile | 46 ++++++++++++++++++++++++++++++++++++
tests/tcg/mips/mips32-dsp/Makefile | 17 +++++++++++--
tests/tcg/mips/mips32-dspr2/Makefile | 17 +++++++++++--
tests/tcg/mips/mips64-dsp/Makefile | 18 ++++++++++++--
tests/tcg/mips/mips64-dspr2/Makefile | 17 ++++++++++++-
tests/tcg/openrisc/Makefile | 19 ++++++++++++---
tests/tcg/xtensa/Makefile | 17 +++++++++++--
12 files changed, 223 insertions(+), 51 deletions(-)
create mode 100644 tests/tcg/mips/Makefile
diff --git a/tests/tcg/alpha/Makefile b/tests/tcg/alpha/Makefile
index 2b1f03d..e20315f 100644
--- a/tests/tcg/alpha/Makefile
+++ b/tests/tcg/alpha/Makefile
@@ -1,33 +1,47 @@
-CROSS=alpha-linux-gnu-
-CC=$(CROSS)gcc
-AS=$(CROSS)as
+# -*- Mode: makefile -*-
+#
+# Alpha linux-user TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/alpha-linux-user/tests directory
+#
-SIM=../../alpha-linux-user/qemu-alpha
+BUILD_DIR?=$(CURDIR)
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
-CFLAGS=-O
-LINK=$(CC) -o $@ crt.o $< -nostdlib
+$(call set-vpath, $(SRC_PATH)/tests/tcg/alpha)
+
+QEMU=$(BUILD_DIR)/alpha-linux-user/qemu-alpha
+
+# Compiler set-up, default to system compiler if not set
+CROSS_CC?=$(CC)
+
+CFLAGS=-Wall -O2 -g -fno-strict-aliasing -static
+LDFLAGS=-nostdlib
TESTS=test-cond test-cmov
all: hello-alpha $(TESTS)
hello-alpha: hello-alpha.o crt.o
- $(LINK)
+ $(CROSS_CC) -o $@ crt.o $< $(LDFLAGS)
test-cond: test-cond.o crt.o
- $(LINK)
+ $(CROSS_CC) -o $@ crt.o $< $(LDFLAGS)
test-cmov.o: test-cond.c
- $(CC) -c $(CFLAGS) -DTEST_CMOV -o $@ $<
+ $(CROSS_CC) -c $(CFLAGS) -DTEST_CMOV -o $@ $<
test-cmov: test-cmov.o crt.o
- $(LINK)
+ $(CROSS_CC) -o $@ crt.o $< $(LDFLAGS)
test-ovf: test-ovf.o crt.o
- $(LINK)
+ $(CROSS_CC) -o $@ crt.o $< $(LDFLAGS)
check: $(TESTS)
- for f in $(TESTS); do $(SIM) $$f || exit 1; done
+ for f in $(TESTS); do $(QEMU) $$f || exit 1; done
clean:
$(RM) *.o *~ hello-alpha $(TESTS)
diff --git a/tests/tcg/arm/Makefile b/tests/tcg/arm/Makefile
index c2ae491..8eafae6 100644
--- a/tests/tcg/arm/Makefile
+++ b/tests/tcg/arm/Makefile
@@ -1,21 +1,27 @@
-BUILD_DIR?=$(CURDIR)
-SRC_PATH=../../../
-include $(BUILD_DIR)/config-host.mak
+# -*- Mode: makefile -*-
+#
+# Arm linux-user TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/arm-linux-user/tests directory
+#
+
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
include $(SRC_PATH)/rules.mak
$(call set-vpath, $(SRC_PATH)/tests/tcg/arm)
QEMU=$(BUILD_DIR)/arm-linux-user/qemu-arm
+# Compiler set-up, default to system compiler if not set
+CROSS_CC?=$(CC)
+
QEMU_INCLUDES += -I$(BUILD_DIR)
CFLAGS=-Wall -O2 -g -fno-strict-aliasing
LDFLAGS=
-# TODO: automatically detect ARM and MIPS compilers, and run those too
-
-# runcom maps page 0, so it requires root privileges
-# also, pi_10.com runs indefinitely
-
TESTS=hello-arm arm-iwmmxt
all: $(patsubst %,run-%,$(TESTS))
@@ -33,13 +39,13 @@ run-arm-iwmmxt: arm-iwmmxt
# arm test
hello-arm: hello-arm.o
- arm-linux-gnueabi-ld -o $@ $<
+ $(CROSS_CC) -o $@ $<
hello-arm.o: hello-arm.c
- arm-linux-gnueabi-gcc -Wall -g -O2 -c -o $@ $<
+ $(CROSS_CC) -Wall -g -O2 -c -o $@ $<
arm-iwmmxt: test-arm-iwmmxt.s
- cpp < $< | arm-linux-gnueabi-gcc -Wall -static -march=iwmmxt -mabi=aapcs -x assembler - -o $@
+ cpp < $< | $(CROSS_CC) -Wall -static -march=iwmmxt -mabi=aapcs -x assembler - -o $@
clean:
rm -f *~ *.o $(TESTS)
diff --git a/tests/tcg/cris/Makefile b/tests/tcg/cris/Makefile
index d34bfd8..aa8be36 100644
--- a/tests/tcg/cris/Makefile
+++ b/tests/tcg/cris/Makefile
@@ -1,7 +1,20 @@
--include ../../../config-host.mak
+# -*- Mode: makefile -*-
+#
+# Cris linux-user TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/cris-linux-user/tests directory
+#
+
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/arm)
CROSS=crisv32-axis-linux-gnu-
-SIM=../../../cris-linux-user/qemu-cris -L ./
+SIM=$(BUILD_DIR)/cris-linux-user/qemu-cris -L ./
SIMG=cris-axis-linux-gnu-run --sysroot=./
CC = $(CROSS)gcc
diff --git a/tests/tcg/i386/Makefile b/tests/tcg/i386/Makefile
index 15f77af..20b80fe 100644
--- a/tests/tcg/i386/Makefile
+++ b/tests/tcg/i386/Makefile
@@ -1,6 +1,14 @@
-BUILD_DIR=../../../build/
-SRC_PATH=../../../
-include $(BUILD_DIR)/config-host.mak
+# -*- Mode: makefile -*-
+#
+# i386 linux-user TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/i386-linux-user/tests directory
+#
+
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
include $(SRC_PATH)/rules.mak
$(call set-vpath, $(SRC_PATH)/tests/tcg/i386)
@@ -14,15 +22,9 @@ CFLAGS=-Wall -O2 -g -fno-strict-aliasing
#CFLAGS+=-msse2
LDFLAGS=
-# TODO: automatically detect ARM and MIPS compilers, and run those too
-
-# runcom maps page 0, so it requires root privileges
-# also, pi_10.com runs indefinitely
-
I386_TESTS=hello-i386 \
test-i386 \
test-i386-fprem
- # runcom
# native i386 compilers sometimes are not biarch. assume cross-compilers are
ifneq ($(ARCH),i386)
@@ -57,9 +59,6 @@ run-test-x86_64: test-x86_64
-$(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-runcom: runcom
- -$(QEMU) ./runcom $(SRC_PATH)/tests/pi_10.com
-
# rules to compile tests
hello-i386: hello-i386.c
diff --git a/tests/tcg/lm32/Makefile b/tests/tcg/lm32/Makefile
index 57e7363..ad5d9a7 100644
--- a/tests/tcg/lm32/Makefile
+++ b/tests/tcg/lm32/Makefile
@@ -1,8 +1,21 @@
--include ../../../config-host.mak
+# -*- Mode: makefile -*-
+#
+# lm32 linux-system TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/lm32-softmmu/tests directory
+#
+
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/lm32)
CROSS=lm32-elf-
-SIM = qemu-system-lm32
+QEMU=$(BUILD_DIR)/lm32-softmmu/qemu-system-lm32
SIMFLAGS = -M lm32-evr -nographic -semihosting -net none -kernel
CC = $(CROSS)gcc
diff --git a/tests/tcg/mips/Makefile b/tests/tcg/mips/Makefile
new file mode 100644
index 0000000..a56d6c8
--- /dev/null
+++ b/tests/tcg/mips/Makefile
@@ -0,0 +1,46 @@
+# -*- Mode: makefile -*-
+#
+# mips linux-user TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/mips-linux-user/tests directory
+#
+
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/mips)
+
+QEMU=$(BUILD_DIR)/mips-linux-user/qemu-mips
+
+# Compiler set-up, default to system compiler if not set
+CROSS_CC?=$(CC)
+
+CFLAGS=-Wall -O2 -g -fno-strict-aliasing
+LDFLAGS=
+
+TESTS=hello-mips
+
+all: $(patsubst %,run-%,$(TESTS))
+test: all
+
+# rules to run tests
+
+run-%: %
+ $(QEMU) ./$*
+
+#.PHONY: $(patsubst %,run-%,$(TESTS))
+
+run-hello-mips: hello-mips
+
+# mips test
+hello-mips: hello-mips.o
+ $(CROSS_CC) -o $@ $<
+
+hello-mips.o: hello-mips.c
+ $(CROSS_CC) -Wall -g -O2 -c -o $@ $<
+
+clean:
+ rm -f *~ *.o $(TESTS)
diff --git a/tests/tcg/mips/mips32-dsp/Makefile b/tests/tcg/mips/mips32-dsp/Makefile
index c3a0a00..996b9a0 100644
--- a/tests/tcg/mips/mips32-dsp/Makefile
+++ b/tests/tcg/mips/mips32-dsp/Makefile
@@ -1,8 +1,21 @@
--include ../../config-host.mak
+# -*- Mode: makefile -*-
+#
+# mipsel linux-user TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/mipsel-linux-user/tests directory
+#
+
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/mips/mips32-dsp)
CROSS=mips64el-unknown-linux-gnu-
-SIM=qemu-mipsel
+SIM=$(BUILD_DIR)/mipsel-linux-user/qemu-mipsel
SIM_FLAGS=-cpu 74Kf
CC = $(CROSS)gcc
diff --git a/tests/tcg/mips/mips32-dspr2/Makefile b/tests/tcg/mips/mips32-dspr2/Makefile
index ed19581..e99f2bc 100644
--- a/tests/tcg/mips/mips32-dspr2/Makefile
+++ b/tests/tcg/mips/mips32-dspr2/Makefile
@@ -1,8 +1,21 @@
--include ../../config-host.mak
+# -*- Mode: makefile -*-
+#
+# mipsel linux-user TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/mipsel-linux-user/tests directory
+#
+
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/mips/mips32-dsp)
CROSS=mips64el-unknown-linux-gnu-
-SIM=qemu-mipsel
+SIM=$(BUILD_DIR)/mipsel-linux-user/qemu-mipsel
SIM_FLAGS=-cpu 74Kf
CC = $(CROSS)gcc
diff --git a/tests/tcg/mips/mips64-dsp/Makefile b/tests/tcg/mips/mips64-dsp/Makefile
index b2ac6b3..4ee3bbb 100644
--- a/tests/tcg/mips/mips64-dsp/Makefile
+++ b/tests/tcg/mips/mips64-dsp/Makefile
@@ -1,7 +1,21 @@
+# -*- Mode: makefile -*-
+#
+# mips64el linux-user TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/mips64el-linux-user/tests directory
+#
-CROSS_COMPILE ?= mips64el-unknown-linux-gnu-
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
-SIM = qemu-system-mips64el
+$(call set-vpath, $(SRC_PATH)/tests/tcg/mips/mips64-dsp)
+
+CROSS=mips64el-unknown-linux-gnu-
+
+SIM=$(BUILD_DIR)/mipsel-linux-user/qemu-mips64el
SIMFLAGS = -nographic -cpu mips64dspr2 -kernel
AS = $(CROSS_COMPILE)as
diff --git a/tests/tcg/mips/mips64-dspr2/Makefile b/tests/tcg/mips/mips64-dspr2/Makefile
index ba44bb9..8510d8c 100644
--- a/tests/tcg/mips/mips64-dspr2/Makefile
+++ b/tests/tcg/mips/mips64-dspr2/Makefile
@@ -1,6 +1,21 @@
+# -*- Mode: makefile -*-
+#
+# mips64el linux-user TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/mips64el-linux-user/tests directory
+#
+
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/mips/mips64-dsp)
+
CROSS_COMPILE ?= mips64el-unknown-linux-gnu-
-SIM = qemu-system-mips64el
+SIM=$(BUILD_DIR)/mipsel-linux-user/qemu-mips64el
SIMFLAGS = -nographic -cpu mips64dspr2 -kernel
AS = $(CROSS_COMPILE)as
diff --git a/tests/tcg/openrisc/Makefile b/tests/tcg/openrisc/Makefile
index 7e65888..071aaab 100644
--- a/tests/tcg/openrisc/Makefile
+++ b/tests/tcg/openrisc/Makefile
@@ -1,8 +1,21 @@
--include ../../config-host.mak
+# -*- Mode: makefile -*-
+#
+# openrisc linux-user TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/or32-linux-user/tests directory
+#
-CROSS = or32-linux-
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/openrisc)
-SIM = qemu-or32
+SIM=$(BUILD_DIR)/or32-linux-user/qemu-mips
+
+CROSS = or32-linux-
CC = $(CROSS)gcc
diff --git a/tests/tcg/xtensa/Makefile b/tests/tcg/xtensa/Makefile
index 522a63e..e3269ed 100644
--- a/tests/tcg/xtensa/Makefile
+++ b/tests/tcg/xtensa/Makefile
@@ -1,10 +1,23 @@
--include ../../../config-host.mak
+# -*- Mode: makefile -*-
+#
+# xtensa linux TCG tests
+#
+# The Make is expected to be called in the
+# ${BUILD_DIR}/xtensa-softmmu/tests directory
+#
+
+BUILD_DIR=../..
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+include ../config-target.mak # TARGET_NAME
+include $(SRC_PATH)/rules.mak
+
+$(call set-vpath, $(SRC_PATH)/tests/tcg/xtensa)
CORE=dc232b
CROSS=xtensa-$(CORE)-elf-
ifndef XT
-SIM = ../../../xtensa-softmmu/qemu-system-xtensa
+SIM = $(BUILD_DIR)/xtensa-softmmu/qemu-system-xtensa
SIMFLAGS = -M sim -cpu $(CORE) -nographic -semihosting $(EXTFLAGS) -kernel
SIMDEBUG = -s -S
else
--
2.9.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [Qemu-devel] [PATCH 5/6] tests/tcg: Add and update Makefiles
2016-09-17 14:03 ` [Qemu-devel] [PATCH 5/6] tests/tcg: Add and update Makefiles Pranith Kumar
@ 2016-09-23 18:25 ` Max Filippov
0 siblings, 0 replies; 15+ messages in thread
From: Max Filippov @ 2016-09-23 18:25 UTC (permalink / raw)
To: Pranith Kumar
Cc: qemu-devel, Richard Henderson, Edgar E. Iglesias, Michael Walle,
Aurelien Jarno, Leon Alrae, Jia Liu, Alex Bennée
Hello,
On Sat, Sep 17, 2016 at 7:03 AM, Pranith Kumar <bobby.prani@gmail.com> wrote:
[...]
> diff --git a/tests/tcg/xtensa/Makefile b/tests/tcg/xtensa/Makefile
> index 522a63e..e3269ed 100644
> --- a/tests/tcg/xtensa/Makefile
> +++ b/tests/tcg/xtensa/Makefile
> @@ -1,10 +1,23 @@
> --include ../../../config-host.mak
> +# -*- Mode: makefile -*-
> +#
> +# xtensa linux TCG tests
These are system tests, not linux tests.
> +#
> +# The Make is expected to be called in the
> +# ${BUILD_DIR}/xtensa-softmmu/tests directory
There's no such directory under the BUILD_DIR.
If I create it and then try to run tests as
make -C xtensa-softmmu/tests -f ../../tests/tcg/xtensa/Makefile
it fails with the following error:
make: Entering directory 'build-xtensa-tcg-tests/xtensa-softmmu/tests'
make: *** No rule to make target 'test_b.tst', needed by 'build'. Stop.
> +#
> +
> +BUILD_DIR=../..
> +include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
> +include ../config-target.mak # TARGET_NAME
> +include $(SRC_PATH)/rules.mak
> +
> +$(call set-vpath, $(SRC_PATH)/tests/tcg/xtensa)
>
> CORE=dc232b
> CROSS=xtensa-$(CORE)-elf-
>
> ifndef XT
> -SIM = ../../../xtensa-softmmu/qemu-system-xtensa
> +SIM = $(BUILD_DIR)/xtensa-softmmu/qemu-system-xtensa
> SIMFLAGS = -M sim -cpu $(CORE) -nographic -semihosting $(EXTFLAGS) -kernel
> SIMDEBUG = -s -S
> else
--
Thanks.
-- Max
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Qemu-devel] [PATCH 6/6] tests/tcg: Add tests-tcg hook in Makefile
2016-09-17 14:03 [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests Pranith Kumar
` (4 preceding siblings ...)
2016-09-17 14:03 ` [Qemu-devel] [PATCH 5/6] tests/tcg: Add and update Makefiles Pranith Kumar
@ 2016-09-17 14:03 ` Pranith Kumar
2016-09-19 11:55 ` [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests Marc-André Lureau
6 siblings, 0 replies; 15+ messages in thread
From: Pranith Kumar @ 2016-09-17 14:03 UTC (permalink / raw)
To: qemu-devel, Eric Blake, Markus Armbruster, Daniel P. Berrange,
Michael S. Tsirkin, Paolo Bonzini
Cc: alex.bennee, rth
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
tests/Makefile.include | 1 +
tests/tcg/Makefile.include | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)
create mode 100644 tests/tcg/Makefile.include
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 2f11064..5f314ed 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -803,3 +803,4 @@ all: $(QEMU_IOTESTS_HELPERS-y)
-include $(wildcard tests/*.d)
-include $(wildcard tests/libqos/*.d)
+-include $(SRC_PATH)/tests/tcg/Makefile.include
diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include
new file mode 100644
index 0000000..a55cb03
--- /dev/null
+++ b/tests/tcg/Makefile.include
@@ -0,0 +1,34 @@
+#
+# linux-user TCG tests
+#
+# The Make is expected to be invoked in the ${BUILD_DIR} directory
+# using the tests-tcg target
+#
+BUILD_DIR?=$(CURDIR)
+include $(BUILD_DIR)/config-host.mak # brings in SRC_PATH
+
+UNAME_P := $(shell uname -p)
+
+tests-tcg: prepare $(UNAME_P)
+
+prepare:
+ mkdir -p $(BUILD_DIR)/$(UNAME_P)-linux-user/tests/
+
+x86_64:
+ cd $(BUILD_DIR)/x86_64-linux-user/tests/ && \
+ make -f $(SRC_PATH)/tests/tcg/i386/Makefile
+
+i386:
+ cd $(BUILD_DIR)/i386-linux-user/tests/ && \
+ make -f $(SRC_PATH)/tests/tcg/i386/Makefile
+
+arm:
+ cd $(BUILD_DIR)/arm-linux-user/tests/ && \
+ make -f $(SRC_PATH)/tests/tcg/arm/Makefile
+
+aarch64:
+ cd $(BUILD_DIR)/aarch64-linux-user/tests/ && \
+ make -f $(SRC_PATH)/tests/tcg/arm/Makefile
+
+.PHONY: tests-tcg
+
--
2.9.3
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests
2016-09-17 14:03 [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests Pranith Kumar
` (5 preceding siblings ...)
2016-09-17 14:03 ` [Qemu-devel] [PATCH 6/6] tests/tcg: Add tests-tcg hook in Makefile Pranith Kumar
@ 2016-09-19 11:55 ` Marc-André Lureau
2016-09-19 15:57 ` Pranith Kumar
6 siblings, 1 reply; 15+ messages in thread
From: Marc-André Lureau @ 2016-09-19 11:55 UTC (permalink / raw)
To: Pranith Kumar, qemu-devel; +Cc: alex.bennee, rth
Hi Pranith
On Sat, Sep 17, 2016 at 6:05 PM Pranith Kumar <bobby.prani@gmail.com> wrote:
> Hello,
>
> This patch series cleans up the tcg tests in tests/tcg folder.
>
>
Incidentally, I was also looking at reorganizing tests/tcg last week. I
think your series brings some necessary improvements, but it will probably
need more iterations before it is accepted. Could you split off your
obvious changes, such as test build fixes? I think it would help to get
those out of the way first (cc -trivial). Also it would help if you
documented the makefile changes.
> The tests have bit-rotten and were not compiling or running. I fixed
> the Makefiles to make them compile but there are tests which do not
> pass.
>
> The motivation is to add litmus tests to each arch and have them run
> using the 'make check' target to test consistency on TCG.
>
> There are no maintainers listed for this test folder. So I am cc'ing
> people who I think might be interested.
>
> As suggested by rth in v1 posting, I hooked up 'tests-tcg' target to
> run native tests. Detecting cross compilers or running the tests
> in docker containers are suggested ideas to make running the tests
> easier.
>
It doesn't make much sense to me to run only native tests (the uname -p),
could you explain the rationale? Instead, I would check what
cross-compilers and qemu targets are available to run the appropriate tests.
>
> v3:
> - Update with review feedback from Alex Bennée.
>
> v2:
> - Add tests-tcg target to invoke native tests.
>
> Pranith Kumar (6):
> tests/tcg: Move i386 tests to arch specific folder
> tests/tcg: Move arm tests to arch specific folder
> tests/tcg: Move mips test to arch specific folder
> tests/tcg: Create and populate misc tests for arch independent tests
> tests/tcg: Add and update Makefiles
> tests/tcg: Add tests-tcg hook in Makefile
>
> tests/Makefile.include | 1 +
> tests/tcg/Makefile | 156
> --------------------------------
> tests/tcg/Makefile.include | 34 +++++++
> tests/tcg/alpha/Makefile | 38 +++++---
> tests/tcg/arm/Makefile | 51 +++++++++++
> tests/tcg/{ => arm}/hello-arm.c | 0
> tests/tcg/{ => arm}/test-arm-iwmmxt.s | 0
> tests/tcg/cris/Makefile | 17 +++-
> tests/tcg/i386/Makefile | 87 ++++++++++++++++++
> tests/tcg/{ => i386}/hello-i386.c | 9 +-
> tests/tcg/{ => i386}/pi_10.com | Bin
> tests/tcg/{ => i386}/runcom.c | 0
> tests/tcg/{ => i386}/test-i386-code16.S | 0
> tests/tcg/{ => i386}/test-i386-fprem.c | 0
> tests/tcg/{ => i386}/test-i386-muldiv.h | 0
> tests/tcg/{ => i386}/test-i386-shift.h | 0
> tests/tcg/{ => i386}/test-i386-ssse3.c | 0
> tests/tcg/{ => i386}/test-i386-vm86.S | 0
> tests/tcg/{ => i386}/test-i386.c | 0
> tests/tcg/{ => i386}/test-i386.h | 0
> tests/tcg/lm32/Makefile | 17 +++-
> tests/tcg/mips/Makefile | 46 ++++++++++
> tests/tcg/{ => mips}/hello-mips.c | 0
> tests/tcg/mips/mips32-dsp/Makefile | 17 +++-
> tests/tcg/mips/mips32-dspr2/Makefile | 17 +++-
> tests/tcg/mips/mips64-dsp/Makefile | 18 +++-
> tests/tcg/mips/mips64-dspr2/Makefile | 17 +++-
> tests/tcg/misc/Makefile | 81 +++++++++++++++++
> tests/tcg/{ => misc}/linux-test.c | 3 +
> tests/tcg/{ => misc}/sha1.c | 0
> tests/tcg/{ => misc}/test-mmap.c | 0
> tests/tcg/{ => misc}/test_path.c | 0
> tests/tcg/{ => misc}/testthread.c | 0
> tests/tcg/openrisc/Makefile | 19 +++-
> tests/tcg/xtensa/Makefile | 17 +++-
> 35 files changed, 457 insertions(+), 188 deletions(-)
> delete mode 100644 tests/tcg/Makefile
> create mode 100644 tests/tcg/Makefile.include
> create mode 100644 tests/tcg/arm/Makefile
> rename tests/tcg/{ => arm}/hello-arm.c (100%)
> rename tests/tcg/{ => arm}/test-arm-iwmmxt.s (100%)
> create mode 100644 tests/tcg/i386/Makefile
> rename tests/tcg/{ => i386}/hello-i386.c (71%)
> rename tests/tcg/{ => i386}/pi_10.com (100%)
> rename tests/tcg/{ => i386}/runcom.c (100%)
> rename tests/tcg/{ => i386}/test-i386-code16.S (100%)
> rename tests/tcg/{ => i386}/test-i386-fprem.c (100%)
> rename tests/tcg/{ => i386}/test-i386-muldiv.h (100%)
> rename tests/tcg/{ => i386}/test-i386-shift.h (100%)
> rename tests/tcg/{ => i386}/test-i386-ssse3.c (100%)
> rename tests/tcg/{ => i386}/test-i386-vm86.S (100%)
> rename tests/tcg/{ => i386}/test-i386.c (100%)
> rename tests/tcg/{ => i386}/test-i386.h (100%)
> create mode 100644 tests/tcg/mips/Makefile
> rename tests/tcg/{ => mips}/hello-mips.c (100%)
> create mode 100644 tests/tcg/misc/Makefile
> rename tests/tcg/{ => misc}/linux-test.c (99%)
> rename tests/tcg/{ => misc}/sha1.c (100%)
> rename tests/tcg/{ => misc}/test-mmap.c (100%)
> rename tests/tcg/{ => misc}/test_path.c (100%)
> rename tests/tcg/{ => misc}/testthread.c (100%)
>
> --
> 2.9.3
>
>
> --
Marc-André Lureau
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests
2016-09-19 11:55 ` [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests Marc-André Lureau
@ 2016-09-19 15:57 ` Pranith Kumar
2016-09-23 16:56 ` Marc-André Lureau
0 siblings, 1 reply; 15+ messages in thread
From: Pranith Kumar @ 2016-09-19 15:57 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: qemu-devel, alex.bennee, rth
Hi Marc,
Marc-André Lureau writes:
> Hi Pranith
>
> On Sat, Sep 17, 2016 at 6:05 PM Pranith Kumar <bobby.prani@gmail.com> wrote:
>
>> Hello,
>>
>> This patch series cleans up the tcg tests in tests/tcg folder.
>>
>>
> Incidentally, I was also looking at reorganizing tests/tcg last week. I
> think your series brings some necessary improvements, but it will probably
> need more iterations before it is accepted. Could you split off your
> obvious changes, such as test build fixes? I think it would help to get
> those out of the way first (cc -trivial). Also it would help if you
> documented the makefile changes.
OK, I will split up the patches into trivial fixes and document the changes to
Makefiles.
>
>
>> The tests have bit-rotten and were not compiling or running. I fixed
>> the Makefiles to make them compile but there are tests which do not
>> pass.
>>
>> The motivation is to add litmus tests to each arch and have them run
>> using the 'make check' target to test consistency on TCG.
>>
>> There are no maintainers listed for this test folder. So I am cc'ing
>> people who I think might be interested.
>>
>> As suggested by rth in v1 posting, I hooked up 'tests-tcg' target to
>> run native tests. Detecting cross compilers or running the tests
>> in docker containers are suggested ideas to make running the tests
>> easier.
>>
>
> It doesn't make much sense to me to run only native tests (the uname -p),
> could you explain the rationale? Instead, I would check what
> cross-compilers and qemu targets are available to run the appropriate tests.
>
Detecting cross compilers is not perfect right now, so I hooked up only the
native tests. If you know of a reliable way to detect the presence of cross
compilers, please let me know :)
Cross compilation tests are supposed to be called by providing a CROSS_CC env
variable populated with the installed cross compiler from the
build/<arch>-linux-user/tests/ directory (as documented in the arm Makefile
header).
I did not touch the make files for most archs which already had the cross
compiler hard-coded. I can modify them to make them similar to what I did for
ARM.
--
Pranith
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests
2016-09-19 15:57 ` Pranith Kumar
@ 2016-09-23 16:56 ` Marc-André Lureau
2016-11-03 13:35 ` Alex Bennée
0 siblings, 1 reply; 15+ messages in thread
From: Marc-André Lureau @ 2016-09-23 16:56 UTC (permalink / raw)
To: Pranith Kumar; +Cc: qemu-devel, alex.bennee, rth
Hi
On Mon, Sep 19, 2016 at 7:57 PM Pranith Kumar <bobby.prani@gmail.com> wrote:
>
> Hi Marc,
>
> Marc-André Lureau writes:
>
> > Hi Pranith
> >
> > On Sat, Sep 17, 2016 at 6:05 PM Pranith Kumar <bobby.prani@gmail.com>
> wrote:
> >
> >> Hello,
> >>
> >> This patch series cleans up the tcg tests in tests/tcg folder.
> >>
> >>
> > Incidentally, I was also looking at reorganizing tests/tcg last week. I
> > think your series brings some necessary improvements, but it will
> probably
> > need more iterations before it is accepted. Could you split off your
> > obvious changes, such as test build fixes? I think it would help to get
> > those out of the way first (cc -trivial). Also it would help if you
> > documented the makefile changes.
>
>
fwiw, here is my wip at cleaning up tests/tcg:
https://github.com/elmarco/qemu/tree/tcg-tests/tests/tcg
The build-sys there has a lot of benefits over what is in tests/tcg today:
- uses implicit rules, for building, for running qemu
- dependency tracking
- generate gitignore, clean rule
- detects cross-compiler and qemu, skip the test when unavailable
I have quite a lot of trouble finding suitable cross-compilers for the
various archs. crosstool-ng helped me to build some of them, but it's not
obvious how to build the various archs, and when it builds, it often
fails/crash. Anyway, this can hopefully give some ideas/inspiration. I did
port i386/x64 and arm, and fixes a couple of qemu bugs on the way. (but arm
mmap test still crashes qemu for ex).
OK, I will split up the patches into trivial fixes and document the changes
> to
> Makefiles.
> >
> >
> >> The tests have bit-rotten and were not compiling or running. I fixed
> >> the Makefiles to make them compile but there are tests which do not
> >> pass.
> >>
> >> The motivation is to add litmus tests to each arch and have them run
> >> using the 'make check' target to test consistency on TCG.
> >>
> >> There are no maintainers listed for this test folder. So I am cc'ing
> >> people who I think might be interested.
> >>
> >> As suggested by rth in v1 posting, I hooked up 'tests-tcg' target to
> >> run native tests. Detecting cross compilers or running the tests
> >> in docker containers are suggested ideas to make running the tests
> >> easier.
> >>
> >
> > It doesn't make much sense to me to run only native tests (the uname -p),
> > could you explain the rationale? Instead, I would check what
> > cross-compilers and qemu targets are available to run the appropriate
> tests.
> >
>
> Detecting cross compilers is not perfect right now, so I hooked up only the
> native tests. If you know of a reliable way to detect the presence of cross
> compilers, please let me know :)
>
> Cross compilation tests are supposed to be called by providing a CROSS_CC
> env
> variable populated with the installed cross compiler from the
> build/<arch>-linux-user/tests/ directory (as documented in the arm Makefile
> header).
>
> I did not touch the make files for most archs which already had the cross
> compiler hard-coded. I can modify them to make them similar to what I did
> for
> ARM.
>
> --
> Pranith
>
--
Marc-André Lureau
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests
2016-09-23 16:56 ` Marc-André Lureau
@ 2016-11-03 13:35 ` Alex Bennée
2016-11-03 13:38 ` Pranith Kumar
0 siblings, 1 reply; 15+ messages in thread
From: Alex Bennée @ 2016-11-03 13:35 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: Pranith Kumar, qemu-devel, rth
Marc-André Lureau <marcandre.lureau@gmail.com> writes:
> Hi
>
> On Mon, Sep 19, 2016 at 7:57 PM Pranith Kumar <bobby.prani@gmail.com> wrote:
>
>>
>> Hi Marc,
>>
>> Marc-André Lureau writes:
>>
>> > Hi Pranith
>> >
>> > On Sat, Sep 17, 2016 at 6:05 PM Pranith Kumar <bobby.prani@gmail.com>
>> wrote:
>> >
>> >> Hello,
>> >>
>> >> This patch series cleans up the tcg tests in tests/tcg folder.
>> >>
>> >>
>> > Incidentally, I was also looking at reorganizing tests/tcg last week. I
>> > think your series brings some necessary improvements, but it will
>> probably
>> > need more iterations before it is accepted. Could you split off your
>> > obvious changes, such as test build fixes? I think it would help to get
>> > those out of the way first (cc -trivial). Also it would help if you
>> > documented the makefile changes.
>>
>>
> fwiw, here is my wip at cleaning up tests/tcg:
> https://github.com/elmarco/qemu/tree/tcg-tests/tests/tcg
>
> The build-sys there has a lot of benefits over what is in tests/tcg today:
> - uses implicit rules, for building, for running qemu
> - dependency tracking
> - generate gitignore, clean rule
> - detects cross-compiler and qemu, skip the test when unavailable
>
> I have quite a lot of trouble finding suitable cross-compilers for the
> various archs. crosstool-ng helped me to build some of them, but it's not
> obvious how to build the various archs, and when it builds, it often
> fails/crash. Anyway, this can hopefully give some ideas/inspiration. I did
> port i386/x64 and arm, and fixes a couple of qemu bugs on the way. (but arm
> mmap test still crashes qemu for ex).
>
> OK, I will split up the patches into trivial fixes and document the changes
>> to
>> Makefiles.
Where did we get to with these changes? Who's posting the next series?
--
Alex Bennée
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Qemu-devel] [PATCH v3 0/6] Clean up TCG tests
2016-11-03 13:35 ` Alex Bennée
@ 2016-11-03 13:38 ` Pranith Kumar
0 siblings, 0 replies; 15+ messages in thread
From: Pranith Kumar @ 2016-11-03 13:38 UTC (permalink / raw)
To: Alex Bennée; +Cc: Marc-André Lureau, qemu-devel, Richard Henderson
Hi Alex,
I have a merged branch with these changes but it needs more work. I
will post the next version soon(for some definition of soon :)
You can find the in-progress branch here:
https://github.com/pranith/qemu tcg_test_cleanup_v4
Thanks,
On Thu, Nov 3, 2016 at 9:35 AM, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> Marc-André Lureau <marcandre.lureau@gmail.com> writes:
>
>> Hi
>>
>> On Mon, Sep 19, 2016 at 7:57 PM Pranith Kumar <bobby.prani@gmail.com> wrote:
>>
>>>
>>> Hi Marc,
>>>
>>> Marc-André Lureau writes:
>>>
>>> > Hi Pranith
>>> >
>>> > On Sat, Sep 17, 2016 at 6:05 PM Pranith Kumar <bobby.prani@gmail.com>
>>> wrote:
>>> >
>>> >> Hello,
>>> >>
>>> >> This patch series cleans up the tcg tests in tests/tcg folder.
>>> >>
>>> >>
>>> > Incidentally, I was also looking at reorganizing tests/tcg last week. I
>>> > think your series brings some necessary improvements, but it will
>>> probably
>>> > need more iterations before it is accepted. Could you split off your
>>> > obvious changes, such as test build fixes? I think it would help to get
>>> > those out of the way first (cc -trivial). Also it would help if you
>>> > documented the makefile changes.
>>>
>>>
>> fwiw, here is my wip at cleaning up tests/tcg:
>> https://github.com/elmarco/qemu/tree/tcg-tests/tests/tcg
>>
>> The build-sys there has a lot of benefits over what is in tests/tcg today:
>> - uses implicit rules, for building, for running qemu
>> - dependency tracking
>> - generate gitignore, clean rule
>> - detects cross-compiler and qemu, skip the test when unavailable
>>
>> I have quite a lot of trouble finding suitable cross-compilers for the
>> various archs. crosstool-ng helped me to build some of them, but it's not
>> obvious how to build the various archs, and when it builds, it often
>> fails/crash. Anyway, this can hopefully give some ideas/inspiration. I did
>> port i386/x64 and arm, and fixes a couple of qemu bugs on the way. (but arm
>> mmap test still crashes qemu for ex).
>>
>> OK, I will split up the patches into trivial fixes and document the changes
>>> to
>>> Makefiles.
>
> Where did we get to with these changes? Who's posting the next series?
>
> --
> Alex Bennée
--
Pranith
^ permalink raw reply [flat|nested] 15+ messages in thread