Fixed perf target on Windows.
This commit is contained in:
parent
6bb15fa711
commit
1917d8b006
@ -1561,7 +1561,7 @@ endif()
|
|||||||
#-----------------------------------
|
#-----------------------------------
|
||||||
if(BUILD_PERF_TESTS AND PYTHON_EXECUTABLE)
|
if(BUILD_PERF_TESTS AND PYTHON_EXECUTABLE)
|
||||||
add_custom_target(perf
|
add_custom_target(perf
|
||||||
${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/modules/ts/misc/run.py" "${CMAKE_BINARY_DIR}"
|
${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/modules/ts/misc/run.py" --configuration $<CONFIGURATION> "${CMAKE_BINARY_DIR}"
|
||||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/modules/ts/misc/run.py"
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/modules/ts/misc/run.py"
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import testlog_parser, sys, os, xml, re
|
import testlog_parser, sys, os, xml, re, glob
|
||||||
from table_formatter import *
|
from table_formatter import *
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
@ -17,11 +17,30 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
options.generateHtml = detectHtmlOutputType(options.format)
|
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 = []
|
tests = []
|
||||||
files = []
|
files = []
|
||||||
for arg in set(args):
|
for arg in set(args):
|
||||||
|
try:
|
||||||
|
cases = testlog_parser.parseLogFile(arg)
|
||||||
|
if cases:
|
||||||
files.append(os.path.basename(arg))
|
files.append(os.path.basename(arg))
|
||||||
tests.extend(testlog_parser.parseLogFile(arg))
|
tests.extend(cases)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
if options.filter:
|
if options.filter:
|
||||||
expr = re.compile(options.filter)
|
expr = re.compile(options.filter)
|
||||||
|
@ -47,7 +47,7 @@ def query_yes_no(stdout, question, default="yes"):
|
|||||||
"(or 'y' or 'n').\n")
|
"(or 'y' or 'n').\n")
|
||||||
|
|
||||||
class RunInfo(object):
|
class RunInfo(object):
|
||||||
def __init__(self, path):
|
def __init__(self, path, configuration = None):
|
||||||
self.path = path
|
self.path = path
|
||||||
self.error = None
|
self.error = None
|
||||||
for p in parse_patterns:
|
for p in parse_patterns:
|
||||||
@ -97,6 +97,9 @@ class RunInfo(object):
|
|||||||
|
|
||||||
# fix test path
|
# fix test path
|
||||||
if "Visual Studio" in self.cmake_generator:
|
if "Visual Studio" in self.cmake_generator:
|
||||||
|
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)
|
self.tests_dir = os.path.join(self.tests_dir, self.build_type)
|
||||||
elif not self.is_x64 and self.cxx_compiler:
|
elif not self.is_x64 and self.cxx_compiler:
|
||||||
#one more attempt to detect x64 compiler
|
#one more attempt to detect x64 compiler
|
||||||
@ -209,7 +212,9 @@ class RunInfo(object):
|
|||||||
hw = str(self.hardware).replace(" ", "_") + "_"
|
hw = str(self.hardware).replace(" ", "_") + "_"
|
||||||
else:
|
else:
|
||||||
hw = ""
|
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):
|
def getTest(self, name):
|
||||||
# full path
|
# full path
|
||||||
@ -381,6 +386,7 @@ if __name__ == "__main__":
|
|||||||
parser.add_option("-t", "--tests", dest="tests", help="comma-separated list of modules to test", metavar="SUITS", default="")
|
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("-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("", "--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)
|
(options, args) = parser.parse_args(argv)
|
||||||
|
|
||||||
@ -409,7 +415,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
logs = []
|
logs = []
|
||||||
for path in run_args:
|
for path in run_args:
|
||||||
info = RunInfo(path)
|
info = RunInfo(path, options.configuration)
|
||||||
#print vars(info),"\n"
|
#print vars(info),"\n"
|
||||||
if not info.isRunnable():
|
if not info.isRunnable():
|
||||||
print >> sys.stderr, "Error:", info.error
|
print >> sys.stderr, "Error:", info.error
|
||||||
|
@ -426,7 +426,7 @@ html, body {font-family: Lucida Console, Courier New, Courier;font-size: 16px;co
|
|||||||
.tbl th{color:#003399;font-size:16px;font-weight:normal;white-space:nowrap;padding:3px 10px;}
|
.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 td{border-bottom:1px solid #CCCCCC;color:#666699;padding:6px 8px;white-space:nowrap;}
|
||||||
.tbl tbody tr:hover td{color:#000099;}
|
.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>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user