tests: Allow GTESTER_OPTIONS variable expansion from command line
PATCH 1/1 tests: Allow GTESTER_OPTIONS variable expansion from command line
The gtester utility offers the "-p=TESTPATH" option to "only run test cases matching TESTPATH". We already use a $GTESTER_OPTIONS variable.
Use make variable expansion to allow qtest path matching from command line:
$ time make check-qtest-arm GTESTER_OPTIONS="-p /arm/boot-serial"
GTESTER check-qtest-armuser 0m1.548s
---
I am more interested in the "-s" option (exclude pattern) but can't have it working :(
i.e. "run all but qom/hmp":
make check-qtest-arm GTESTER_OPTIONS="-s /arm/qom -s /arm/hmp"
tests/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/Makefile.include +1 -1
@@ -870,7 +870,7 @@ tests/test-qga$(EXESUF): qemu-ga$(EXESUF) tests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y) SPEED = quick -GTESTER_OPTIONS = -k $(if $(V),--verbose,-q) +GTESTER_OPTIONS += -k $(if $(V),--verbose,-q) GCOV_OPTIONS = -n $(if $(V),-f,) # gtester tests, possibly with verbose output
Signature · 1 line
2.17.0
Quoted 27 lines · Philippe Mathieu-Daudé
The gtester utility offers the "-p=TESTPATH" option to "only run test cases matching TESTPATH". We already use a $GTESTER_OPTIONS variable.
Use make variable expansion to allow qtest path matching from command line:$ time make check-qtest-arm GTESTER_OPTIONS="-p /arm/boot-serial" GTESTER check-qtest-armuser 0m1.548s
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
I am more interested in the "-s" option (exclude pattern) but can't have it working :(i.e. "run all but qom/hmp":
make check-qtest-arm GTESTER_OPTIONS="-s /arm/qom -s /arm/hmp"tests/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/Makefile.include +0
-0
tests/Makefile.include tests/test-qga$(EXESUF): qemu-ga$(EXESUF) · line 876
Quoted 8 lines
tests/Makefile.include +1
-1@@ -870,7 +870,7 @@ tests/test-qga$(EXESUF): qemu-ga$(EXESUF) tests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y) SPEED = quick -GTESTER_OPTIONS = -k $(if $(V),--verbose,-q) +GTESTER_OPTIONS += -k $(if $(V),--verbose,-q) GCOV_OPTIONS = -n $(if $(V),-f,) # gtester tests, possibly with verbose output
"make check-help" says:
Default options are -k and (for make V=1) --verbose; they can be changed with variable GTESTER_OPTIONS.
So if you change the behavior here to amend to the variable instead, I think you should also adjust the help text. Not sure if it's a good idea, though, there might be people who want to run without "-k" and this can not be disabled anymore with your patch.
Thomas
Quoted 39 lines · Thomas Huth
Quoted 27 lines · Philippe Mathieu-Daudé
The gtester utility offers the "-p=TESTPATH" option to "only run test cases matching TESTPATH". We already use a $GTESTER_OPTIONS variable.
Use make variable expansion to allow qtest path matching from command line:$ time make check-qtest-arm GTESTER_OPTIONS="-p /arm/boot-serial" GTESTER check-qtest-armuser 0m1.548s
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
I am more interested in the "-s" option (exclude pattern) but can't have it working :(i.e. "run all but qom/hmp":
make check-qtest-arm GTESTER_OPTIONS="-s /arm/qom -s /arm/hmp"tests/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/Makefile.include +0
-0tests/Makefile.include tests/test-qga$(EXESUF): qemu-ga$(EXESUF) · line 876
Quoted 8 lines
tests/Makefile.include +1
-1@@ -870,7 +870,7 @@ tests/test-qga$(EXESUF): qemu-ga$(EXESUF) tests/test-qga$(EXESUF): tests/test-qga.o $(qtest-obj-y) SPEED = quick -GTESTER_OPTIONS = -k $(if $(V),--verbose,-q) +GTESTER_OPTIONS += -k $(if $(V),--verbose,-q) GCOV_OPTIONS = -n $(if $(V),-f,) # gtester tests, possibly with verbose output"make check-help" says:
Quoted 7 lines
Default options are -k and (for make V=1) --verbose; they can be changed with variable
GTESTER_OPTIONS.So if you change the behavior here to amend to the variable instead, I think you should also adjust the help text. Not sure if it's a good idea, though, there might be people who want to run without "-k" and this can not be disabled anymore with your patch.
Ok I see. I'm interested in hearing how people run/use this option.
Anyway I'm fine using:
$ make check-qtest-arm GTESTER_OPTIONS="-p /arm/boot-serial --verbose"
Thanks for your review,
Phil.