tests/dbus-runner: Don't consume options after '--'

This allows passing arguments to test cases that conflict with
meta-dbus-runner.py.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2561>
This commit is contained in:
Jonas Ådahl 2022-08-04 16:32:49 +02:00
parent 22a46d4f7b
commit d2c4914546

View File

@ -176,13 +176,17 @@ if __name__ == '__main__':
parser.add_argument('--kvm', action='store_true', default=False)
(args, rest) = parser.parse_known_args(sys.argv)
rest.pop(0)
if rest[0] == '--':
rest.pop(0)
MutterDBusTestCase.setUpClass(args.kvm)
test_case = MutterDBusTestCase()
test_case.assertGreater(len(rest), 1)
test_case.assertGreater(len(rest), 0)
result = 1
try:
print('Running test case...', file=sys.stderr)
result = test_case.wrap_call(rest[1:])
result = test_case.wrap_call(rest)
finally:
MutterDBusTestCase.tearDownClass()
sys.exit(result)