diff options
| author | Ajax <commial@gmail.com> | 2017-04-10 14:38:30 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2017-04-18 16:09:05 +0200 |
| commit | 3c7c463563ca11033e25a01c62aa616ec1b4cdee (patch) | |
| tree | bdce4a0faede06cad451385e0bd22c2c278731ed /test | |
| parent | f566cb19cdc130218ddabba8885bd675ee247542 (diff) | |
| download | focaccia-miasm-3c7c463563ca11033e25a01c62aa616ec1b4cdee.tar.gz focaccia-miasm-3c7c463563ca11033e25a01c62aa616ec1b4cdee.zip | |
TestAll: add support for other executable
Diffstat (limited to 'test')
| -rw-r--r-- | test/utils/test.py | 9 | ||||
| -rw-r--r-- | test/utils/testset.py | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/test/utils/test.py b/test/utils/test.py index e4f8888c..9e569a4b 100644 --- a/test/utils/test.py +++ b/test/utils/test.py @@ -2,22 +2,25 @@ class Test(object): "Stand for a test to run" def __init__(self, command_line, base_dir="", depends=None, - products=None, tags=None): + products=None, tags=None, executable=None): """Create a Test instance. @command_line: list of string standing for arguments to launch @base_dir: base directory for launch @depends: list of Test instance indicating dependencies @products: elements produced to remove after tests @tags: list of str indicating current test categories + @executable: if set, use this binary instead of Python """ self.command_line = command_line self.base_dir = base_dir self.depends = depends if depends else [] self.products = products if products else [] self.tags = tags if tags else [] + self.executable = executable def __repr__(self): displayed = ["command_line", "base_dir", "depends", "products", "tags"] + displayed.append("python" if not self.executable else self.executable) return "<Test " + \ " ".join("%s=%s" % (n, getattr(self,n)) for n in displayed ) + ">" @@ -29,4 +32,6 @@ class Test(object): self.base_dir == test.base_dir, self.depends == test.depends, self.products == test.products, - self.tags == test.tags]) + self.tags == test.tags, + self.executable == test.executable, + ]) diff --git a/test/utils/testset.py b/test/utils/testset.py index e1df01a4..29a4e5d0 100644 --- a/test/utils/testset.py +++ b/test/utils/testset.py @@ -153,7 +153,8 @@ class TestSet(object): os.chdir(test.base_dir) # Launch test - testpy = subprocess.Popen(([sys.executable] + + executable = test.executable if test.executable else sys.executable + testpy = subprocess.Popen(([executable] + init_args + test.command_line), stdout=subprocess.PIPE, stderr=subprocess.PIPE) |