diff options
Diffstat (limited to 'examples/matrix.py')
-rwxr-xr-x | examples/matrix.py | 23 |
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) |