diff mbox

[1/2] tests: build the helper program in main build process

Message ID 1379838614-23890-2-git-send-email-xiawenc@linux.vnet.ibm.com
State New
Headers show

Commit Message

Wayne Xia Sept. 22, 2013, 8:30 a.m. UTC
This is a quick way to update helper program when qemu main code
is changed or built, instead of adding new Makefile under test/qemu-iotest.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
---
 tests/Makefile |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

Comments

Michael Tokarev Sept. 22, 2013, 8:36 p.m. UTC | #1
22.09.2013 12:30, Wenchao Xia пишет:
> This is a quick way to update helper program when qemu main code
> is changed or built, instead of adding new Makefile under test/qemu-iotest.

Why?

[]
> +# Build the help program automatically
> +
> +all: $(QEMU_IOTESTS_HELPERS-y)
>

This appears to be somewhat awkward way (to do something which I
clearly don't see).

First, it is not clear why this iotest helper should be built
by default when we hasn't been asked to perform the tests.

Second, it apparently does not achieve the (unknown) goal
anyway.  At least the patch does not do what the commit
coment says.  Commit says that the helper gets updated when
qemu main code is changed or built (which is main code?).
But when I build, say, subdir-x86_64-softmmu, which is
definitely some "main" code, the helper isn't being built...

Count me confused...  :)

/mjt
Wayne Xia Sept. 22, 2013, 11:22 p.m. UTC | #2
On 09/23/2013 04:36 AM, Michael Tokarev wrote:
> 22.09.2013 12:30, Wenchao Xia пишет:
>> This is a quick way to update helper program when qemu main code
>> is changed or built, instead of adding new Makefile under 
>> test/qemu-iotest.
>
> Why?
>
> []
    I think it is a bit overkill to have a new Makefile for one single 
.c file. If more
file comes, we can write Makefile at that time.


>> +# Build the help program automatically
>> +
>> +all: $(QEMU_IOTESTS_HELPERS-y)
>>
>
> This appears to be somewhat awkward way (to do something which I
> clearly don't see).
>
> First, it is not clear why this iotest helper should be built
> by default when we hasn't been asked to perform the tests.
   Usually we may:
1 configure and make.
2 goto tests/qemu-iotests, ./check.

   It may encounter an error since build of the helper was not triggered.

>
> Second, it apparently does not achieve the (unknown) goal
> anyway.  At least the patch does not do what the commit
> coment says.  Commit says that the helper gets updated when
> qemu main code is changed or built (which is main code?).
> But when I build, say, subdir-x86_64-softmmu, which is
> definitely some "main" code, the helper isn't being built...
>
   Main code may refer to the codes other than ./tests, the commit
message is not accurate, I think it should be "build the helper by
default".

> Count me confused...  :)
>
> /mjt
>
Wayne Xia Sept. 24, 2013, 3:20 a.m. UTC | #3
于 2013/9/23 7:22, Wenchao Xia 写道:
> On 09/23/2013 04:36 AM, Michael Tokarev wrote:
>> 22.09.2013 12:30, Wenchao Xia пишет:
>>> This is a quick way to update helper program when qemu main code
>>> is changed or built, instead of adding new Makefile under 
>>> test/qemu-iotest.
>>
>> Why?
>>
>> []
>    I think it is a bit overkill to have a new Makefile for one single 
> .c file. If more
> file comes, we can write Makefile at that time.
>
>
>>> +# Build the help program automatically
>>> +
>>> +all: $(QEMU_IOTESTS_HELPERS-y)
>>>
>>
>> This appears to be somewhat awkward way (to do something which I
>> clearly don't see).
>>
>> First, it is not clear why this iotest helper should be built
>> by default when we hasn't been asked to perform the tests.
>   Usually we may:
> 1 configure and make.
> 2 goto tests/qemu-iotests, ./check.
>
>   It may encounter an error since build of the helper was not triggered.
>
>>
>> Second, it apparently does not achieve the (unknown) goal
>> anyway.  At least the patch does not do what the commit
>> coment says.  Commit says that the helper gets updated when
>> qemu main code is changed or built (which is main code?).
>> But when I build, say, subdir-x86_64-softmmu, which is
>> definitely some "main" code, the helper isn't being built...
>>
>   Main code may refer to the codes other than ./tests, the commit
> message is not accurate, I think it should be "build the helper by
> default".
>
>> Count me confused...  :)
>>
>> /mjt
>>
>
>
   Are you OK with this method? To add a callable Makefile by 
tests/qemu-iotests/check,
configure, variable may be needed to work on out of tree build case, so 
I try to
avoid that. This patches simply build it in default make process.
   If yes I will respin a version with better commit message.
diff mbox

Patch

diff --git a/tests/Makefile b/tests/Makefile
index 994fef1..5f2894f 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -252,8 +252,10 @@  check-report.html: check-report.xml
 
 # Other tests
 
+QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
+
 .PHONY: check-tests/qemu-iotests-quick.sh
-check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF) tests/qemu-iotests/socket_scm_helper$(EXESUF)
+check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF) $(QEMU_IOTESTS_HELPERS-y)
 	$<
 
 .PHONY: check-tests/test-qapi.py
@@ -275,5 +277,9 @@  check-unit: $(patsubst %,check-%, $(check-unit-y))
 check-block: $(patsubst %,check-%, $(check-block-y))
 check: check-qapi-schema check-unit check-qtest
 
+# Build the help program automatically
+
+all: $(QEMU_IOTESTS_HELPERS-y)
+
 -include $(wildcard tests/*.d)
 -include $(wildcard tests/libqos/*.d)