[PATCH] tests/qemu-iotests/testrunner: Supply a test plan in TAP mode

Thomas Huth posted 1 patch 2 years, 2 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220223095816.2663005-1-thuth@redhat.com
tests/qemu-iotests/testrunner.py | 1 +
1 file changed, 1 insertion(+)
[PATCH] tests/qemu-iotests/testrunner: Supply a test plan in TAP mode
Posted by Thomas Huth 2 years, 2 months ago
Quoting the TAP specification: "The plan tells how many tests will be
run [...]. It’s a check that the test file hasn’t stopped prematurely."
That's a good idea of course, so let's support that in the iotest
testrunner, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qemu-iotests/testrunner.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py
index 9a94273975..30ab829def 100644
--- a/tests/qemu-iotests/testrunner.py
+++ b/tests/qemu-iotests/testrunner.py
@@ -377,6 +377,7 @@ def run_tests(self, tests: List[str], jobs: int = 1) -> bool:
 
         if self.tap:
             self.env.print_env('# ')
+            print('1..%d' % len(tests))
         else:
             self.env.print_env()
 
-- 
2.27.0


Re: [PATCH] tests/qemu-iotests/testrunner: Supply a test plan in TAP mode
Posted by Hanna Reitz 2 years, 1 month ago
On 23.02.22 10:58, Thomas Huth wrote:
> Quoting the TAP specification: "The plan tells how many tests will be
> run [...]. It’s a check that the test file hasn’t stopped prematurely."
> That's a good idea of course, so let's support that in the iotest
> testrunner, too.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/qemu-iotests/testrunner.py | 1 +
>   1 file changed, 1 insertion(+)

Yep, that seems to work nicely.  Thanks!

Applied to my block branch (better late than never):

https://gitlab.com/hreitz/qemu/-/commits/block

Hanna