-import testlog_parser, sys, os, xml, re
+import testlog_parser, sys, os, xml, re, glob
from table_formatter import *
from optparse import OptionParser
exit(0)
options.generateHtml = detectHtmlOutputType(options.format)
-
+
+ # expand wildcards and filter duplicates
+ files = []
+ files1 = []
+ for arg in args:
+ if ("*" in arg) or ("?" in arg):
+ files1.extend([os.path.abspath(f) for f in glob.glob(arg)])
+ else:
+ files.append(os.path.abspath(arg))
+ seen = set()
+ files = [ x for x in files if x not in seen and not seen.add(x)]
+ files.extend((set(files1) - set(files)))
+ args = files
+
+ # load test data
tests = []
files = []
for arg in set(args):
- files.append(os.path.basename(arg))
- tests.extend(testlog_parser.parseLogFile(arg))
+ try:
+ cases = testlog_parser.parseLogFile(arg)
+ if cases:
+ files.append(os.path.basename(arg))
+ tests.extend(cases)
+ except:
+ pass
if options.filter:
expr = re.compile(options.filter)
"(or 'y' or 'n').\n")
class RunInfo(object):
- def __init__(self, path):
+ def __init__(self, path, configuration = None):
self.path = path
self.error = None
for p in parse_patterns:
# fix test path
if "Visual Studio" in self.cmake_generator:
- self.tests_dir = os.path.join(self.tests_dir, self.build_type)
+ if configuration:
+ self.tests_dir = os.path.join(self.tests_dir, configuration)
+ else:
+ self.tests_dir = os.path.join(self.tests_dir, self.build_type)
elif not self.is_x64 and self.cxx_compiler:
#one more attempt to detect x64 compiler
try:
hw = str(self.hardware).replace(" ", "_") + "_"
else:
hw = ""
- return "%s_%s_%s_%s%s%s.xml" %(app, self.targetos, self.targetarch, hw, rev, timestamp.strftime("%Y%m%dT%H%M%S"))
+ #stamp = timestamp.strftime("%Y%m%dT%H%M%S")
+ stamp = timestamp.strftime("%Y-%m-%d--%H-%M-%S")
+ return "%s_%s_%s_%s%s%s.xml" %(app, self.targetos, self.targetarch, hw, rev, stamp)
def getTest(self, name):
# full path
parser.add_option("-t", "--tests", dest="tests", help="comma-separated list of modules to test", metavar="SUITS", default="")
parser.add_option("-w", "--cwd", dest="cwd", help="working directory for tests", metavar="PATH", default=".")
parser.add_option("", "--android_test_data_path", dest="test_data_path", help="OPENCV_TEST_DATA_PATH for Android run", metavar="PATH", default="/sdcard/opencv_testdata/")
+ parser.add_option("", "--configuration", dest="configuration", help="force Debug or Release donfiguration", metavar="CFG", default="")
(options, args) = parser.parse_args(argv)
logs = []
for path in run_args:
- info = RunInfo(path)
+ info = RunInfo(path, options.configuration)
#print vars(info),"\n"
if not info.isRunnable():
print >> sys.stderr, "Error:", info.error
.tbl th{color:#003399;font-size:16px;font-weight:normal;white-space:nowrap;padding:3px 10px;}
.tbl td{border-bottom:1px solid #CCCCCC;color:#666699;padding:6px 8px;white-space:nowrap;}
.tbl tbody tr:hover td{color:#000099;}
-.tbl caption{font:italic 16px "Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;padding:0 0 5px;text-align:right;}
+.tbl caption{font:italic 16px "Trebuchet MS",Verdana,Arial,Helvetica,sans-serif;padding:0 0 5px;text-align:right;white-space:normal;}
</style>
</head>
<body>