aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2023-04-20 11:26:17 +0100
committerMarkus Armbruster <armbru@redhat.com>2023-04-25 15:23:06 +0200
commit7ce54db23048bfcc3ea6821525bf333b715c7655 (patch)
treec55a674cbde47fdd542c88d37cbc71cc6107a035 /tests/qapi-schema
parentde3b3f529d453dfaa1f8b437c1a1f0766d8108e4 (diff)
downloadqemu-7ce54db23048bfcc3ea6821525bf333b715c7655.zip
qemu-7ce54db23048bfcc3ea6821525bf333b715c7655.tar.gz
qemu-7ce54db23048bfcc3ea6821525bf333b715c7655.tar.bz2
qapi: support updating expected test output via make
It is possible to pass --update to tests/qapi-schema/test-qapi.py to make it update the output files on error. This is inconvenient to achieve though when test-qapi.py is run indirectly by make/meson. Instead simply allow for an env variable to be set: $ QAPI_TEST_UPDATE= make check-qapi-schema Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230420102619.348173-2-berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema')
-rwxr-xr-xtests/qapi-schema/test-qapi.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
index 2160cef..d58c31f 100755
--- a/tests/qapi-schema/test-qapi.py
+++ b/tests/qapi-schema/test-qapi.py
@@ -206,6 +206,7 @@ def main(argv):
parser.add_argument('-d', '--dir', action='store', default='',
help="directory containing tests")
parser.add_argument('-u', '--update', action='store_true',
+ default='QAPI_TEST_UPDATE' in os.environ,
help="update expected test results")
parser.add_argument('tests', nargs='*', metavar='TEST', action='store')
args = parser.parse_args()