diff mbox series

[2/5] tools/tests: Drop run runes

Message ID 20210615161905.9831-3-andrew.cooper3@citrix.com (mailing list archive)
State Superseded
Headers show
Series tools/tests: More cleanup for automation improvements | expand

Commit Message

Andrew Cooper June 15, 2021, 4:19 p.m. UTC
These aren't implemented consistently.  The one in resource/ is useless as the
binary needs running in dom0, and the layout in cpu-policy/ demonstrates the
weakness of this approach with multiple binaries.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Ian Jackson <iwj@xenproject.org>
CC: Wei Liu <wl@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Juergen Gross <jgross@suse.com>
---
 tools/tests/cpu-policy/Makefile   | 4 ----
 tools/tests/resource/Makefile     | 4 ----
 tools/tests/vpci/Makefile         | 4 ----
 tools/tests/x86_emulator/Makefile | 4 ----
 4 files changed, 16 deletions(-)

Comments

Jan Beulich June 16, 2021, 6:44 a.m. UTC | #1
On 15.06.2021 18:19, Andrew Cooper wrote:
> --- a/tools/tests/x86_emulator/Makefile
> +++ b/tools/tests/x86_emulator/Makefile
> @@ -7,10 +7,6 @@ TARGET := test_x86_emulator
>  .PHONY: all
>  all:
>  
> -.PHONY: run
> -run: $(TARGET)
> -	./$(TARGET)
> -
>  # Add libx86 to the build
>  vpath %.c $(XEN_ROOT)/xen/lib/x86
>  

This is not only incomplete, but actively (specifically here for my
own frequent using of it, but other tests I do run occasionally as
well, and then also that same way) harming things as long as you
don't introduce an alternative way. Note the top-level Makefile
making use of these rules, and note also the run32 companion here.

Jan
Andrew Cooper June 16, 2021, 1:08 p.m. UTC | #2
On 16/06/2021 07:44, Jan Beulich wrote:
> On 15.06.2021 18:19, Andrew Cooper wrote:
>> --- a/tools/tests/x86_emulator/Makefile
>> +++ b/tools/tests/x86_emulator/Makefile
>> @@ -7,10 +7,6 @@ TARGET := test_x86_emulator
>>  .PHONY: all
>>  all:
>>  
>> -.PHONY: run
>> -run: $(TARGET)
>> -	./$(TARGET)
>> -
>>  # Add libx86 to the build
>>  vpath %.c $(XEN_ROOT)/xen/lib/x86
>>  
> This is not only incomplete, but actively (specifically here for my
> own frequent using of it, but other tests I do run occasionally as
> well, and then also that same way) harming things as long as you
> don't introduce an alternative way. Note the top-level Makefile
> making use of these rules, and note also the run32 companion here.

Honestly, this makefile is borderline impossible to follow.  I failed to
make the install runes work, which is part of why I deferred the
unit-like tests for now.

But I'm taking this as a strong preference to keep the run target?

TBH, this patch is a little on the side of the rest of the series.  I
stand by my commit message though - these are inconsistent, and buggy in
at least one case.

~Andrew
Jan Beulich June 16, 2021, 1:59 p.m. UTC | #3
On 16.06.2021 15:08, Andrew Cooper wrote:
> On 16/06/2021 07:44, Jan Beulich wrote:
>> On 15.06.2021 18:19, Andrew Cooper wrote:
>>> --- a/tools/tests/x86_emulator/Makefile
>>> +++ b/tools/tests/x86_emulator/Makefile
>>> @@ -7,10 +7,6 @@ TARGET := test_x86_emulator
>>>  .PHONY: all
>>>  all:
>>>  
>>> -.PHONY: run
>>> -run: $(TARGET)
>>> -	./$(TARGET)
>>> -
>>>  # Add libx86 to the build
>>>  vpath %.c $(XEN_ROOT)/xen/lib/x86
>>>  
>> This is not only incomplete, but actively (specifically here for my
>> own frequent using of it, but other tests I do run occasionally as
>> well, and then also that same way) harming things as long as you
>> don't introduce an alternative way. Note the top-level Makefile
>> making use of these rules, and note also the run32 companion here.
> 
> Honestly, this makefile is borderline impossible to follow.  I failed to
> make the install runes work, which is part of why I deferred the
> unit-like tests for now.

Well, yes, it's not pretty, but I lack ideas for a clear improvement.

> But I'm taking this as a strong preference to keep the run target?

Yes, and not just here. Any test that can be run directly in the build
tree would imo better have such a target, so re-building and running
it can be invoked with a single make invocation. Having to re-build
the entire tools/ in order to then (re-)run one of these tests is, in
particular, way too much latency.

Jan
diff mbox series

Patch

diff --git a/tools/tests/cpu-policy/Makefile b/tools/tests/cpu-policy/Makefile
index 70ff154da6..53b4f28b2a 100644
--- a/tools/tests/cpu-policy/Makefile
+++ b/tools/tests/cpu-policy/Makefile
@@ -17,10 +17,6 @@  endif
 .PHONY: all
 all: $(TARGET-y)
 
-.PHONY: run
-run: $(TARGET-y)
-	./$(TARGET-y)
-
 .PHONY: clean
 clean:
 	$(RM) -f -- *.o .*.d .*.d2 test-cpu-policy
diff --git a/tools/tests/resource/Makefile b/tools/tests/resource/Makefile
index 4bef482966..da5e2a4f9b 100644
--- a/tools/tests/resource/Makefile
+++ b/tools/tests/resource/Makefile
@@ -6,10 +6,6 @@  TARGET := test-resource
 .PHONY: all
 all: $(TARGET)
 
-.PHONY: run
-run: $(TARGET)
-	./$(TARGET)
-
 .PHONY: clean
 clean:
 	$(RM) -f -- *.o $(TARGET) $(DEPS_RM)
diff --git a/tools/tests/vpci/Makefile b/tools/tests/vpci/Makefile
index 5075bc2be2..f172cefd3d 100644
--- a/tools/tests/vpci/Makefile
+++ b/tools/tests/vpci/Makefile
@@ -6,10 +6,6 @@  TARGET := test_vpci
 .PHONY: all
 all: $(TARGET)
 
-.PHONY: run
-run: $(TARGET)
-	./$(TARGET)
-
 $(TARGET): vpci.c vpci.h list.h main.c emul.h
 	$(HOSTCC) -g -o $@ vpci.c main.c
 
diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 7b07c31bbd..7b3f58b7a2 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -7,10 +7,6 @@  TARGET := test_x86_emulator
 .PHONY: all
 all:
 
-.PHONY: run
-run: $(TARGET)
-	./$(TARGET)
-
 # Add libx86 to the build
 vpath %.c $(XEN_ROOT)/xen/lib/x86