[Qemu-devel] [PATCH] Makefile: Let "make check-help" work without running ./configure

Fam Zheng posted 1 patch 6 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170810085025.14076-1-famz@redhat.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
Makefile               |  2 --
tests/Makefile.include | 46 +++++++++++++++++++++++++---------------------
2 files changed, 25 insertions(+), 23 deletions(-)
[Qemu-devel] [PATCH] Makefile: Let "make check-help" work without running ./configure
Posted by Fam Zheng 6 years, 8 months ago
Currently if you do "make check-help" in a fresh checkout, only an error
is printed which is not nice:

    $ make check-help V=1
    cc -nostdlib  -o check-help.mo
    cc: fatal error: no input files
    compilation terminated.
    rules.mak:115: recipe for target 'check-help.mo' failed
    make: *** [check-help.mo] Error 1

Move the config-host.mak condition into the body of
tests/Makefile.include and always include the rule for check-help.

Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 Makefile               |  2 --
 tests/Makefile.include | 46 +++++++++++++++++++++++++---------------------
 2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/Makefile b/Makefile
index 97a58a0f4e..81447b1f08 100644
--- a/Makefile
+++ b/Makefile
@@ -281,9 +281,7 @@ dummy := $(call unnest-vars,, \
                 common-obj-m \
                 trace-obj-y)
 
-ifneq ($(wildcard config-host.mak),)
 include $(SRC_PATH)/tests/Makefile.include
-endif
 
 all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
 
diff --git a/tests/Makefile.include b/tests/Makefile.include
index eb4895f94a..37c1bed683 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -1,3 +1,26 @@
+
+.PHONY: check-help
+check-help:
+	@echo "Regression testing targets:"
+	@echo
+	@echo " make check                Run all tests"
+	@echo " make check-qtest-TARGET   Run qtest tests for given target"
+	@echo " make check-qtest          Run qtest tests"
+	@echo " make check-unit           Run qobject tests"
+	@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-report.html    Generates an HTML test report"
+	@echo " make check-clean          Clean the tests"
+	@echo
+	@echo "Please note that HTML reports do not regenerate if the unit tests"
+	@echo "has not changed."
+	@echo
+	@echo "The variable SPEED can be set to control the gtester speed setting."
+	@echo "Default options are -k and (for make V=1) --verbose; they can be"
+	@echo "changed with variable GTESTER_OPTIONS."
+
+ifneq ($(wildcard config-host.mak),)
 export SRC_PATH
 
 qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
@@ -802,27 +825,6 @@ $(check-qtest-y): $(qtest-obj-y)
 
 tests/test-qga: tests/test-qga.o $(qtest-obj-y)
 
-.PHONY: check-help
-check-help:
-	@echo "Regression testing targets:"
-	@echo
-	@echo " make check                Run all tests"
-	@echo " make check-qtest-TARGET   Run qtest tests for given target"
-	@echo " make check-qtest          Run qtest tests"
-	@echo " make check-unit           Run qobject tests"
-	@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-report.html    Generates an HTML test report"
-	@echo " make check-clean          Clean the tests"
-	@echo
-	@echo "Please note that HTML reports do not regenerate if the unit tests"
-	@echo "has not changed."
-	@echo
-	@echo "The variable SPEED can be set to control the gtester speed setting."
-	@echo "Default options are -k and (for make V=1) --verbose; they can be"
-	@echo "changed with variable GTESTER_OPTIONS."
-
 SPEED = quick
 GTESTER_OPTIONS = -k $(if $(V),--verbose,-q)
 GCOV_OPTIONS = -n $(if $(V),-f,)
@@ -917,3 +919,5 @@ all: $(QEMU_IOTESTS_HELPERS-y)
 
 -include $(wildcard tests/*.d)
 -include $(wildcard tests/libqos/*.d)
+
+endif
-- 
2.13.4


Re: [Qemu-devel] [PATCH] Makefile: Let "make check-help" work without running ./configure
Posted by Philippe Mathieu-Daudé 6 years, 8 months ago
Hi Fam,

thank for fixing this :)

I think as a bugfix it should enter 2.10
(maybe through Alex's Travis series, CC'ing him)

On 08/10/2017 05:50 AM, Fam Zheng wrote:
> Currently if you do "make check-help" in a fresh checkout, only an error
> is printed which is not nice:
> 
>      $ make check-help V=1
>      cc -nostdlib  -o check-help.mo
>      cc: fatal error: no input files
>      compilation terminated.
>      rules.mak:115: recipe for target 'check-help.mo' failed
>      make: *** [check-help.mo] Error 1
> 
> Move the config-host.mak condition into the body of
> tests/Makefile.include and always include the rule for check-help.
> 
> Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Signed-off-by: Fam Zheng <famz@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>   Makefile               |  2 --
>   tests/Makefile.include | 46 +++++++++++++++++++++++++---------------------
>   2 files changed, 25 insertions(+), 23 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 97a58a0f4e..81447b1f08 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -281,9 +281,7 @@ dummy := $(call unnest-vars,, \
>                   common-obj-m \
>                   trace-obj-y)
>   
> -ifneq ($(wildcard config-host.mak),)
>   include $(SRC_PATH)/tests/Makefile.include
> -endif
>   
>   all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
>   
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index eb4895f94a..37c1bed683 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -1,3 +1,26 @@
> +
> +.PHONY: check-help
> +check-help:
> +	@echo "Regression testing targets:"
> +	@echo
> +	@echo " make check                Run all tests"
> +	@echo " make check-qtest-TARGET   Run qtest tests for given target"
> +	@echo " make check-qtest          Run qtest tests"
> +	@echo " make check-unit           Run qobject tests"
> +	@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-report.html    Generates an HTML test report"
> +	@echo " make check-clean          Clean the tests"
> +	@echo
> +	@echo "Please note that HTML reports do not regenerate if the unit tests"
> +	@echo "has not changed."
> +	@echo
> +	@echo "The variable SPEED can be set to control the gtester speed setting."
> +	@echo "Default options are -k and (for make V=1) --verbose; they can be"
> +	@echo "changed with variable GTESTER_OPTIONS."
> +
> +ifneq ($(wildcard config-host.mak),)
>   export SRC_PATH
>   
>   qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
> @@ -802,27 +825,6 @@ $(check-qtest-y): $(qtest-obj-y)
>   
>   tests/test-qga: tests/test-qga.o $(qtest-obj-y)
>   
> -.PHONY: check-help
> -check-help:
> -	@echo "Regression testing targets:"
> -	@echo
> -	@echo " make check                Run all tests"
> -	@echo " make check-qtest-TARGET   Run qtest tests for given target"
> -	@echo " make check-qtest          Run qtest tests"
> -	@echo " make check-unit           Run qobject tests"
> -	@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-report.html    Generates an HTML test report"
> -	@echo " make check-clean          Clean the tests"
> -	@echo
> -	@echo "Please note that HTML reports do not regenerate if the unit tests"
> -	@echo "has not changed."
> -	@echo
> -	@echo "The variable SPEED can be set to control the gtester speed setting."
> -	@echo "Default options are -k and (for make V=1) --verbose; they can be"
> -	@echo "changed with variable GTESTER_OPTIONS."
> -
>   SPEED = quick
>   GTESTER_OPTIONS = -k $(if $(V),--verbose,-q)
>   GCOV_OPTIONS = -n $(if $(V),-f,)
> @@ -917,3 +919,5 @@ all: $(QEMU_IOTESTS_HELPERS-y)
>   
>   -include $(wildcard tests/*.d)
>   -include $(wildcard tests/libqos/*.d)
> +
> +endif
> 

Re: [Qemu-devel] [PATCH] Makefile: Let "make check-help" work without running ./configure
Posted by Fam Zheng 6 years, 8 months ago
On Thu, 08/10 08:59, Philippe Mathieu-Daudé wrote:
> Hi Fam,
> 
> thank for fixing this :)
> 
> I think as a bugfix it should enter 2.10
> (maybe through Alex's Travis series, CC'ing him)

Since Alex hasn't replied, I'll send a pull request for -rc3.

> 
> On 08/10/2017 05:50 AM, Fam Zheng wrote:
> > Currently if you do "make check-help" in a fresh checkout, only an error
> > is printed which is not nice:
> > 
> >      $ make check-help V=1
> >      cc -nostdlib  -o check-help.mo
> >      cc: fatal error: no input files
> >      compilation terminated.
> >      rules.mak:115: recipe for target 'check-help.mo' failed
> >      make: *** [check-help.mo] Error 1
> > 
> > Move the config-host.mak condition into the body of
> > tests/Makefile.include and always include the rule for check-help.
> > 
> > Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> 
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 

Fam

Re: [Qemu-devel] [PATCH] Makefile: Let "make check-help" work without running ./configure
Posted by Alex Bennée 6 years, 8 months ago
Fam Zheng <famz@redhat.com> writes:

> On Thu, 08/10 08:59, Philippe Mathieu-Daudé wrote:
>> Hi Fam,
>>
>> thank for fixing this :)
>>
>> I think as a bugfix it should enter 2.10
>> (maybe through Alex's Travis series, CC'ing him)
>
> Since Alex hasn't replied, I'll send a pull request for -rc3.

Yes please. Sorry I got distracted by other stuff.

>
>>
>> On 08/10/2017 05:50 AM, Fam Zheng wrote:
>> > Currently if you do "make check-help" in a fresh checkout, only an error
>> > is printed which is not nice:
>> >
>> >      $ make check-help V=1
>> >      cc -nostdlib  -o check-help.mo
>> >      cc: fatal error: no input files
>> >      compilation terminated.
>> >      rules.mak:115: recipe for target 'check-help.mo' failed
>> >      make: *** [check-help.mo] Error 1
>> >
>> > Move the config-host.mak condition into the body of
>> > tests/Makefile.include and always include the rule for check-help.
>> >
>> > Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> > Signed-off-by: Fam Zheng <famz@redhat.com>
>>
>> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>
>
> Fam


--
Alex Bennée