[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 45/46] tests/Makefile.include: add [build|cle
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH v3 45/46] tests/Makefile.include: add [build|clean|check]-tcg targets |
Date: |
Wed, 25 Apr 2018 11:15:38 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 04/24/2018 08:13 PM, Philippe Mathieu-Daudé wrote:
> On 04/24/2018 12:24 PM, Alex Bennée wrote:
>> This will ensure all linux-user targets build their guest test
>> programs and ensure check-tcg will run the respective tests.
>>
>> Signed-off-by: Alex Bennée <address@hidden>
>> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
>> Tested-by: Philippe Mathieu-Daudé <address@hidden>
>> ---
>> v2
>> - use -include instead of complex macro stuff
>> - also include TARGET_BASE_ARCH/Makefile
>> v3
>> - add build-tcg, make check-tcg actually run tests
>> ---
>> tests/Makefile.include | 26 ++++++++++++++++++++++-
>> tests/tcg/Makefile.include | 43 ++++++++++++++++++++++----------------
>> 2 files changed, 50 insertions(+), 19 deletions(-)
>>
>> diff --git a/tests/Makefile.include b/tests/Makefile.include
>> index 3d2f0458ab..310ccefdd9 100644
>> --- a/tests/Makefile.include
>> +++ b/tests/Makefile.include
>> @@ -10,6 +10,7 @@ check-help:
>> @echo " $(MAKE) check-speed Run qobject speed tests"
>> @echo " $(MAKE) check-qapi-schema Run QAPI schema tests"
>> @echo " $(MAKE) check-block Run block tests"
>> + @echo " $(MAKE) check-tcg Run TCG tests"
>> @echo " $(MAKE) check-report.html Generates an HTML test report"
>> @echo " $(MAKE) check-clean Clean the tests"
>> @echo
>> @@ -916,6 +917,30 @@ check-report.xml: $(patsubst
>> %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check
>> check-report.html: check-report.xml
>> $(call quiet-command,gtester-report $< > $@,"GEN","$@")
>>
>> +# Per guest TCG tests
>> +
>> +LINUX_USER_TARGETS=$(filter %-linux-user,$(TARGET_LIST))
>> +BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%,
>> $(LINUX_USER_TARGETS))
>> +CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%,
>> $(LINUX_USER_TARGETS))
>> +RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(LINUX_USER_TARGETS))
>> +
>> +build-tcg-tests-%:
>> + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)"
>> TARGET_DIR="$*/" guest-tests,)
>> +
>> +run-tcg-tests-%: build-tcg-tests-%
>> + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)"
>> TARGET_DIR="$*/" run-guest-tests,)
>> +
>> +clean-tcg-tests-%:
>> + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)"
>> TARGET_DIR="$*/" clean-guest-tests,)
>> +
>> +.PHONY: build-tcg
>> +build-tcg: $(BUILD_TCG_TARGET_RULES)
>> +
>> +.PHONY: check-tcg
>> +check-tcg: $(RUN_TCG_TARGET_RULES)
>> +
>> +.PHONY: clean-tcg
>> +clean-tcg: $(CLEAN_TCG_TARGET_RULES)
>>
>> # Other tests
>>
>> @@ -958,7 +983,6 @@ check-speed: $(patsubst %,check-%, $(check-speed-y))
>> check-block: $(patsubst %,check-%, $(check-block-y))
>> check: check-qapi-schema check-unit check-qtest check-decodetree
>> check-clean:
>> - $(MAKE) -C tests/tcg clean
>> rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
>> rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST),
>> $(check-qtest-$(target)-y)) $(check-qtest-generic-y))
>> rm -f tests/test-qapi-gen-timestamp
>> diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include
>> index cb8bb36026..67e89ecb67 100644
>> --- a/tests/tcg/Makefile.include
>> +++ b/tests/tcg/Makefile.include
>> @@ -8,19 +8,14 @@
>> # guest compiler or calling one of our docker images to do it for us.
>> #
>>
>> -# The per ARCH makefile, if it exists holds extra information about
>> -# useful docker images or alternative compiler flags. Include it if it
>> -# exists
>> +# The per ARCH makefile, if it exists, holds extra information about
>> +# useful docker images or alternative compiler flags.
>>
>> -ARCH_MAKEFILE=$(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include
>> -CHECK_INCLUDE=$(wildcard $(ARCH_MAKEFILE))
>> -
>> -ifeq ($(ARCH_MAKEFILE),$(CHECK_INCLUDE))
>> -include $(ARCH_MAKEFILE)
>> -endif
>> +-include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.include
>> +-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include
>>
>> GUEST_BUILD=
>> -
>> +TCG_MAKE=$(SRC_PATH)/tests/tcg/Makefile
>> # Support installed Cross Compilers
>>
>> ifdef CROSS_CC_GUEST
>> @@ -28,10 +23,10 @@ ifdef CROSS_CC_GUEST
>> .PHONY: cross-build-guest-tests
>> cross-build-guest-tests:
>> $(call quiet-command, \
>> - (mkdir -p tests && cd tests && \
>> - make -f $(SRC_PATH)/tests/tcg/Makefile ARCH=$(TARGET_NAME)
>> CC=$(CROSS_CC_GUEST)), \
>> - "CROSS-BUILD","$(TARGET_NAME) guest-tests with $(CROSS_CC_GUEST)")
>> -
>> + (mkdir -p tests && cd tests && \
>> + make -f $(TCG_MAKE) CC=$(CROSS_CC_GUEST) \
>> + EXTRA_CFLAGS=$(CROSS_CC_GUEST_CFLAGS)), \
>> + "CROSS-BUILD","$(TARGET_NAME) guest-tests with $(CROSS_CC_GUEST)")
>>
>> GUEST_BUILD=cross-build-guest-tests
>>
>> @@ -54,9 +49,10 @@ DOCKER_PREREQ=docker-image-$(DOCKER_IMAGE)
>> .PHONY: docker-build-guest-tests
>> docker-build-guest-tests: $(DOCKER_PREREQ)
>> $(call quiet-command, \
>> - (mkdir -p tests && cd tests && \
>> - make -f $(SRC_PATH)/tests/tcg/Makefile ARCH=$(TARGET_NAME)
>> CC=$(DOCKER_COMPILE_CMD)), \
>> - "CROSS-BUILD","$(TARGET_NAME) guest-tests with docker
>> qemu:$(DOCKER_IMAGE)")
>> + (mkdir -p tests && cd tests && \
>> + make -f $(TCG_MAKE) CC=$(DOCKER_COMPILE_CMD) \
>> + EXTRA_CFLAGS=$(DOCKER_CROSS_COMPILER_CFLAGS)), \
>> + "CROSS-BUILD","$(TARGET_NAME) guest-tests with docker
>> qemu:$(DOCKER_IMAGE)")
>
> I'm not sure this is working as expected, for some reason "make
> build-tcg-tests-aarch64-linux-user" try to use the debian-armel-cross image:
>
> /build$ make build-tcg-tests-aarch64-linux-user V=1 -j1
> make BUILD_DIR=/build -C aarch64-linux-user V="1"
> TARGET_DIR="aarch64-linux-user/" guest-tests
> make[1]: Entering directory '/build/aarch64-linux-user'
> /source/qemu/tests/docker/docker.py build qemu:debian9
> /source/qemu/tests/docker/dockerfiles/debian9.docker --add-current-user
> [...]
> /source/qemu/tests/docker/docker.py build qemu:debian-armel-cross
> /source/qemu/tests/docker/dockerfiles/debian-armel-cross.docker
> --add-current-user
> [...]
> (mkdir -p tests && cd tests && make -f /source/qemu/tests/tcg/Makefile
> CC="/source/qemu/tests/docker/docker.py cc --user 1000 --cc
> arm-linux-gnueabi-gcc -i qemu:debian-armel-cross -s /source/qemu -- "
> EXTRA_CFLAGS=)
> make[2]: Entering directory '/home/phil/build/aarch64-linux-user/tests'
> /source/qemu/tests/docker/docker.py cc --user 1000 --cc
> arm-linux-gnueabi-gcc -i qemu:debian-armel-cross -s /source/qemu --
> -Wall -O0 -g -fno-strict-aliasing /source/qemu/tests/tcg/aarch64/fcvt.c
> -o fcvt -static -lm
> /source/qemu/tests/tcg/aarch64/fcvt.c: In function 'print_double_number':
> /source/qemu/tests/tcg/aarch64/fcvt.c:37:42: warning: format '%lx'
> expects argument of type 'long unsigned int', but argument 4 has type
> 'uint64_t {aka long long unsigned int}' [-Wformat=]
> printf("%02d DOUBLE: %02.20e / %#020lx (%#x => %s)\n",
> ^
> /source/qemu/tests/tcg/aarch64/fcvt.c: In function 'convert_single_to_half':
> /source/qemu/tests/tcg/aarch64/fcvt.c:82:9: error: inconsistent operand
> constraints in an 'asm'
> asm("fcvt %h0, %d1" : "=w" (output) : "x" (input));
> ^~~
> /source/qemu/tests/tcg/aarch64/fcvt.c: In function 'main':
> /source/qemu/tests/tcg/aarch64/fcvt.c:241:5: error: unknown register
> name 'x1' in 'asm'
> asm("msr fpsr, x1\n\t"
> ^~~
> make[2]: *** [/source/qemu/tests/tcg/Makefile:49: fcvt] Error 1
> make[2]: Leaving directory '/home/phil/build/aarch64-linux-user/tests'
> make[1]: *** [/source/qemu/tests/tcg/Makefile.include:51:
> docker-build-guest-tests] Error 2
> make[1]: Leaving directory '/home/phil/build/aarch64-linux-user'
> make: *** [/source/qemu/tests/Makefile.include:928:
> build-tcg-tests-aarch64-linux-user] Error 2
>
> Note this:
>
> Entering directory '/build/aarch64-linux-user'
> [...]
> docker.py build qemu:debian-armel-cross ...
>
> I'm not sure this is related to this patch or the previous (44).
This is due to the missing tests/tcg/aarch64/Makefile.include in patch
28/46.
>>
>> GUEST_BUILD=docker-build-guest-tests
>>
>> @@ -68,9 +64,20 @@ endif
>>
>> ifneq ($(GUEST_BUILD),)
>> guest-tests: $(GUEST_BUILD)
>> +
>> +run-guest-tests: guest-tests
>> + $(call quiet-command, \
>> + (cd tests && make -f $(TCG_MAKE) run), \
>> + "RUN-TESTS", "for $(TARGET_NAME)")
>> +
>> else
>> guest-tests:
>> - $(call quiet-command, /bin/true, "CROSS-BUILD", "$(TARGET_NAME)
>> guest-tests SKIPPED")
>> + $(call quiet-command, /bin/true, "CROSS-BUILD", \
>> + "$(TARGET_NAME) guest-tests SKIPPED")
>> +
>> +run-guest-tests:
>> + $(call quiet-command, /bin/true, "RUN-TESTS", \
>> + "for $(TARGET_NAME) SKIPPED")
>> endif
>>
>> # It doesn't mater if these don't exits
>>
There is still some rule missing:
$ make -j1 run-tcg-tests-sh4-linux-user -k
BUILD debian-sid
BUILD debian-sh4-cross
CROSS-BUILD sh4 guest-tests with docker qemu:debian-sh4-cross
BUILD debian-sid
BUILD debian-sh4-cross
CROSS-BUILD sh4 guest-tests with docker qemu:debian-sh4-cross
RUN-TESTS for sh4
TEST test-mmap (default) on sh4
/bin/sh: 1: ../qemu-sh4: not found
make[2]: *** [/source/qemu/tests/tcg/multiarch/Makefile.target:26:
run-test-mmap] Error 127
TEST sha1 on sh4
/bin/sh: 1: ../qemu-sh4: not found
make[2]: *** [/source/qemu/tests/tcg/Makefile:64: run-sha1] Error 127
BROKEN TEST linux-test SKIPPED on sh4
TEST testthread on sh4
/bin/sh: 1: ../qemu-sh4: not found
make[2]: *** [/source/qemu/tests/tcg/Makefile:64: run-testthread] Error 127
make[2]: Target 'run' not remade because of errors.
make[1]: *** [/source/qemu/tests/tcg/Makefile.include:69:
run-guest-tests] Error 2
make: *** [/source/qemu/tests/Makefile.include:931:
run-tcg-tests-sh4-linux-user] Error 2
Works with:
$ make -j1 subdir-sh4-linux-user run-tcg-tests-sh4-linux-user
- Re: [Qemu-devel] [PATCH v3 16/46] tests/tcg: move i386 specific tests into subdir, (continued)
[Qemu-devel] [PATCH v3 35/46] tests/tcg: enable building for Alpha, Alex Bennée, 2018/04/24
[Qemu-devel] [PATCH v3 46/46] tests/tcg: override runners for broken tests (!UPSTREAM), Alex Bennée, 2018/04/24
[Qemu-devel] [PATCH v3 41/46] tests/tcg: enable building for sparc64, Alex Bennée, 2018/04/24
[Qemu-devel] [PATCH v3 42/46] tests/tcg: enable building for mips64, Alex Bennée, 2018/04/24
[Qemu-devel] [PATCH v3 45/46] tests/Makefile.include: add [build|clean|check]-tcg targets, Alex Bennée, 2018/04/24
Re: [Qemu-devel] [PATCH v3 45/46] tests/Makefile.include: add [build|clean|check]-tcg targets, Philippe Mathieu-Daudé, 2018/04/24
[Qemu-devel] [PATCH v3 19/46] tests/tcg/i386: Build fix for hello-i386, Alex Bennée, 2018/04/24
[Qemu-devel] [PATCH v3 25/46] tests/tcg/i386/test-i386: fix printf format, Alex Bennée, 2018/04/24
[Qemu-devel] [PATCH v3 15/46] tests/tcg/multiarch: move most output to stdout, Alex Bennée, 2018/04/24
[Qemu-devel] [PATCH v3 22/46] tests/tcg/i386: disable i386 version of test-i386-ssse, Alex Bennée, 2018/04/24