summaryrefslogtreecommitdiffstats
path: root/examples/matrix.py
diff options
context:
space:
mode:
authorPetr Šplíchal <psplicha@redhat.com>2012-02-21 15:23:37 +0100
committerPetr Šplíchal <psplicha@redhat.com>2012-02-21 15:23:37 +0100
commit1c9fc0c227f1deae0efca187c38dab79c56c6fe0 (patch)
tree26e48104eae7ad76348cd21ede420d99e5016277 /examples/matrix.py
parent16a63080b6be9950fb76bd61c466c6142bcec3ef (diff)
downloadpython-nitrate-1c9fc0c227f1deae0efca187c38dab79c56c6fe0.tar.gz
python-nitrate-1c9fc0c227f1deae0efca187c38dab79c56c6fe0.tar.xz
python-nitrate-1c9fc0c227f1deae0efca187c38dab79c56c6fe0.zip
Include example scripts
Diffstat (limited to 'examples/matrix.py')
-rwxr-xr-xexamples/matrix.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/matrix.py b/examples/matrix.py
new file mode 100755
index 0000000..e8cba98
--- /dev/null
+++ b/examples/matrix.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+import re, sys, optparse
+from nitrate import *
+
+if __name__ == "__main__":
+ parser = optparse.OptionParser(usage="matrix.py --plan PLAN [options]")
+ parser.add_option("--plan", dest="plan", type="int", help="test plan id")
+ options = parser.parse_args()[0]
+
+ testplan = TestPlan(options.plan)
+ print "Checking results of {0}:\nTest runs: {1}".format(testplan,
+ ", ".join([run.identifier for run in testplan.testruns]))
+
+ for testcase in sorted(testplan.testcases, key=lambda x: x.script):
+ for testrun in testplan.testruns:
+ for caserun in testrun.caseruns:
+ if caserun.testcase.id == testcase.id:
+ print caserun.status.shortname,
+ break
+ else:
+ print "....",
+ print "- {0} - {1}".format(str(testcase.tester).ljust(8), testcase)