diff options
| author | ajax <devnull@localhost> | 2014-10-17 23:06:12 +0200 |
|---|---|---|
| committer | ajax <devnull@localhost> | 2014-10-17 23:06:12 +0200 |
| commit | 473f60bbd719911e56865f87e5be1b98e6c96448 (patch) | |
| tree | 2028a8c8b4aeac5517ab1c2e50f852780e9b239c /test/utils/test.py | |
| parent | 4717e8f6295c46fbfc7e27cc750df7ccf7a599be (diff) | |
| download | miasm-473f60bbd719911e56865f87e5be1b98e6c96448.tar.gz miasm-473f60bbd719911e56865f87e5be1b98e6c96448.zip | |
Test/utils: Add utils for running tests
- cosmetics: display functions - monothread: callbacks for basic test run view - screendisplay: callbacks for enhanced test run view - test: describe a Test case - testset: describe a Test set and implement methods to run it
Diffstat (limited to 'test/utils/test.py')
| -rw-r--r-- | test/utils/test.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/utils/test.py b/test/utils/test.py new file mode 100644 index 00000000..1caf1013 --- /dev/null +++ b/test/utils/test.py @@ -0,0 +1,29 @@ +class Test(object): + "Stand for a test to run" + + def __init__(self, command_line, base_dir="", depends=None, + products=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 + """ + self.command_line = command_line + self.base_dir = base_dir + self.depends = depends if depends else [] + self.products = products if products else [] + + def __repr__(self): + displayed = ["command_line", "base_dir", "depends", "products"] + return "<Test " + \ + " ".join("%s=%s" % (n, getattr(self,n)) for n in displayed ) + ">" + + def __eq__(self, test): + if not isinstance(test, Test): + return False + + return all([self.command_line == test.command_line, + self.base_dir == test.base_dir, + self.depends == test.depends, + self.products == test.products]) |