From 1c9fc0c227f1deae0efca187c38dab79c56c6fe0 Mon Sep 17 00:00:00 2001 From: Petr Šplíchal Date: Tue, 21 Feb 2012 15:23:37 +0100 Subject: Include example scripts --- examples/matrix.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 examples/matrix.py (limited to 'examples/matrix.py') 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) -- cgit