From 2ce4e51cfc5be4b4aeeae331f9accffad46e6e1b Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 31 Jul 2022 17:46:34 +0300 Subject: tests: Only call execute() if the test is run directly Only run a test automatically if the Python test script is executed directly. This will allow importing tests as modules in a test runner. Signed-off-by: Laurent Pinchart --- tests/kms-test-brxalloc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/kms-test-brxalloc.py') diff --git a/tests/kms-test-brxalloc.py b/tests/kms-test-brxalloc.py index c80d2e3..3ccd699 100755 --- a/tests/kms-test-brxalloc.py +++ b/tests/kms-test-brxalloc.py @@ -128,4 +128,6 @@ class BRxAllocTest(kmstest.KMSTest): self.atomic_crtc_disable(outputs[0].crtc) self.atomic_crtc_disable(outputs[1].crtc) -BRxAllocTest().execute() + +if __name__ == '__main__': + BRxAllocTest().execute() -- cgit v1.2.3