aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mtest.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-04-30 13:54:46 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-04-30 13:54:46 -0700
commit28e3ce67ae49494d57372f27b6f91580656f77a7 (patch)
tree3778926f78aa5ab5d05c833b9f1ea18127227641 /mesonbuild/mtest.py
parentc2a4474b582fb98bd81c0babd1056eeb51d0f1ce (diff)
downloadmeson-28e3ce67ae49494d57372f27b6f91580656f77a7.zip
meson-28e3ce67ae49494d57372f27b6f91580656f77a7.tar.gz
meson-28e3ce67ae49494d57372f27b6f91580656f77a7.tar.bz2
Convert test protocol into an enum
This gives us better type safety, and will be important as we add more test methods
Diffstat (limited to 'mesonbuild/mtest.py')
-rw-r--r--mesonbuild/mtest.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 846b474..69da400 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -43,6 +43,7 @@ from . import environment
from . import mlog
from .dependencies import ExternalProgram
from .mesonlib import MesonException, get_wine_shortpath, split_args
+from .backend.backends import TestProtocol
if T.TYPE_CHECKING:
from .backend.backends import TestSerialisation
@@ -631,7 +632,7 @@ class SingleTestRunner:
if not self.options.verbose:
stdout = tempfile.TemporaryFile("wb+")
stderr = tempfile.TemporaryFile("wb+") if self.options.split else stdout
- if self.test.protocol == 'tap' and stderr is stdout:
+ if self.test.protocol is TestProtocol.TAP and stderr is stdout:
stdout = tempfile.TemporaryFile("wb+")
# Let gdb handle ^C instead of us
@@ -741,7 +742,7 @@ class SingleTestRunner:
if timed_out:
return TestRun(self.test, self.test_env, TestResult.TIMEOUT, [], p.returncode, starttime, duration, stdo, stde, cmd)
else:
- if self.test.protocol == 'exitcode':
+ if self.test.protocol is TestProtocol.EXITCODE:
return TestRun.make_exitcode(self.test, self.test_env, p.returncode, starttime, duration, stdo, stde, cmd)
else:
if self.options.verbose: