diff mbox series

[1/3] qapi: Pass '-u' when doing non-silent diff

Message ID 20180211004013.10784-2-eblake@redhat.com
State New
Headers show
Series QAPI file renames | expand

Commit Message

Eric Blake Feb. 11, 2018, 12:40 a.m. UTC
Ed-script diffs are awful compared to context diffs.  Fix another
'diff -q' while in the area (if the files are different, being
noisy makes it easier to diagnose why).

Fixes: 46ec4fce
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 tests/Makefile.include | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Philippe Mathieu-Daudé via Feb. 11, 2018, 4:11 a.m. UTC | #1
On Sat, Feb 10, 2018 at 9:40 PM, Eric Blake <eblake@redhat.com> wrote:
> Ed-script diffs are awful compared to context diffs.  Fix another
> 'diff -q' while in the area (if the files are different, being
> noisy makes it easier to diagnose why).
>
> Fixes: 46ec4fce
> Signed-off-by: Eric Blake <eblake@redhat.com>

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

> ---
>  tests/Makefile.include | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index f41da235aef..375f31b5bc0 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -919,14 +919,14 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
>                 $^ >$*.test.out 2>$*.test.err; \
>                 echo $$? >$*.test.exit, \
>                 "TEST","$*.out")
> -       @diff $(SRC_PATH)/$*.out $*.test.out
> +       @diff -u $(SRC_PATH)/$*.out $*.test.out
>         @# Sanitize error messages (make them independent of build directory)
> -       @perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff $(SRC_PATH)/$*.err -
> -       @diff $(SRC_PATH)/$*.exit $*.test.exit
> +       @perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -u $(SRC_PATH)/$*.err -
> +       @diff -u $(SRC_PATH)/$*.exit $*.test.exit
>
>  .PHONY: check-tests/qapi-schema/doc-good.texi
>  check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
> -       @diff -q $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
> +       @diff -u $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
>
>  # Consolidated targets
>
> --
> 2.14.3
>
>
Markus Armbruster Feb. 11, 2018, 12:04 p.m. UTC | #2
Eric Blake <eblake@redhat.com> writes:

> Ed-script diffs are awful compared to context diffs.  Fix another
> 'diff -q' while in the area (if the files are different, being
> noisy makes it easier to diagnose why).
>
> Fixes: 46ec4fce
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>  tests/Makefile.include | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index f41da235aef..375f31b5bc0 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -919,14 +919,14 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
>  		$^ >$*.test.out 2>$*.test.err; \
>  		echo $$? >$*.test.exit, \
>  		"TEST","$*.out")
> -	@diff $(SRC_PATH)/$*.out $*.test.out
> +	@diff -u $(SRC_PATH)/$*.out $*.test.out
>  	@# Sanitize error messages (make them independent of build directory)
> -	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff $(SRC_PATH)/$*.err -
> -	@diff $(SRC_PATH)/$*.exit $*.test.exit
> +	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -u $(SRC_PATH)/$*.err -
> +	@diff -u $(SRC_PATH)/$*.exit $*.test.exit

Let's diff .err before .out, because when .err differs, .out is usually
useless.

>
>  .PHONY: check-tests/qapi-schema/doc-good.texi
>  check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
> -	@diff -q $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
> +	@diff -u $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
>
>  # Consolidated targets
Eric Blake Feb. 12, 2018, 4:10 p.m. UTC | #3
On 02/11/2018 06:04 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
> 
>> Ed-script diffs are awful compared to context diffs.  Fix another
>> 'diff -q' while in the area (if the files are different, being
>> noisy makes it easier to diagnose why).
>>
>> Fixes: 46ec4fce
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>>   tests/Makefile.include | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/Makefile.include b/tests/Makefile.include
>> index f41da235aef..375f31b5bc0 100644
>> --- a/tests/Makefile.include
>> +++ b/tests/Makefile.include
>> @@ -919,14 +919,14 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
>>   		$^ >$*.test.out 2>$*.test.err; \
>>   		echo $$? >$*.test.exit, \
>>   		"TEST","$*.out")
>> -	@diff $(SRC_PATH)/$*.out $*.test.out
>> +	@diff -u $(SRC_PATH)/$*.out $*.test.out
>>   	@# Sanitize error messages (make them independent of build directory)
>> -	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff $(SRC_PATH)/$*.err -
>> -	@diff $(SRC_PATH)/$*.exit $*.test.exit
>> +	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -u $(SRC_PATH)/$*.err -
>> +	@diff -u $(SRC_PATH)/$*.exit $*.test.exit
> 
> Let's diff .err before .out, because when .err differs, .out is usually
> useless.

Sure, will improve on v2.
diff mbox series

Patch

diff --git a/tests/Makefile.include b/tests/Makefile.include
index f41da235aef..375f31b5bc0 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -919,14 +919,14 @@  $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
 		$^ >$*.test.out 2>$*.test.err; \
 		echo $$? >$*.test.exit, \
 		"TEST","$*.out")
-	@diff $(SRC_PATH)/$*.out $*.test.out
+	@diff -u $(SRC_PATH)/$*.out $*.test.out
 	@# Sanitize error messages (make them independent of build directory)
-	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff $(SRC_PATH)/$*.err -
-	@diff $(SRC_PATH)/$*.exit $*.test.exit
+	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -u $(SRC_PATH)/$*.err -
+	@diff -u $(SRC_PATH)/$*.exit $*.test.exit

 .PHONY: check-tests/qapi-schema/doc-good.texi
 check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
-	@diff -q $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
+	@diff -u $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<

 # Consolidated targets