def add_opencv_tests(profile, individual = False): if not PIGLIT_CONFIG.has_option('opencv', 'opencv_test_ocl_bindir'): return opencv_test_ocl = path.join(PIGLIT_CONFIG.get('opencv', 'opencv_test_ocl_bindir'), 'opencv_test_ocl') if not path.isfile(opencv_test_ocl): print 'Warning: ', opencv_test_ocl, 'does not exist.\nSkipping OpenCV tests...' return tests = subprocess.check_output([opencv_test_ocl, '--gtest_list_tests']) test_list = tests.splitlines() group_name = '' full_test_name = '' for line in test_list: #Test groups names start at the beginning of the line and end with '.' m = re.match('([^.]+\.)$', line) if m: group_name = m.group(1) group_desc = group_name[:-1] full_test_name = 'opencv/{}'.format(group_desc) if not individual: profile.tests[full_test_name] = OpenCVTest(opencv_test_ocl, '{}*'.format(group_name)) continue if not individual: continue # Test names are indent by 2 spaces m = re.match(' (.+)', line) if m: test_name = m.group(1) profile.tests['{}/{}'.format(full_test_name,test_name)] = \ OpenCVTest(opencv_test_ocl, '{}{}'.format(group_name ,test_name))
def add_opencv_tests(profile, individual = False): if not PIGLIT_CONFIG.has_option('opencv', 'opencv_test_ocl_bindir'): return opencv_test_ocl = path.join(PIGLIT_CONFIG.get('opencv', 'opencv_test_ocl_bindir'), 'opencv_test_ocl') if not path.isfile(opencv_test_ocl): print('Warning: {} does not exist.\nSkipping OpenCV ' 'tests...'.format(opencv_test_ocl)) return tests = subprocess.check_output([opencv_test_ocl, '--gtest_list_tests']) test_list = tests.splitlines() group_name = '' full_test_name = '' for line in test_list: #Test groups names start at the beginning of the line and end with '.' m = re.match('([^.]+\.)$', line) if m: group_name = m.group(1) group_desc = group_name[:-1] full_test_name = 'opencv/{}'.format(group_desc) if not individual: profile.tests[full_test_name] = OpenCVTest(opencv_test_ocl, '{}*'.format(group_name)) continue if not individual: continue # Test names are indent by 2 spaces m = re.match(' ([^ ]+)', line) if m: test_name = m.group(1) profile.tests['{}/{}'.format(full_test_name,test_name)] = \ OpenCVTest(opencv_test_ocl, '{}{}'.format(group_name ,test_name))
def add_oclconform_tests(profile): section_name = 'oclconform' if not PIGLIT_CONFIG.has_section(section_name): return bindir = PIGLIT_CONFIG.get(section_name, 'bindir') options = PIGLIT_CONFIG.options(section_name) tests = (o for o in options if PIGLIT_CONFIG.get(section_name, o) is None) for test in tests: test_section_name = get_test_section_name(test) if not PIGLIT_CONFIG.has_section(test_section_name): print("Warning: no section defined for {}".format(test), file=stderr) continue test_name = PIGLIT_CONFIG.get(test_section_name, 'test_name') should_run_concurrent = PIGLIT_CONFIG.has_option( test_section_name, 'concurrent') if PIGLIT_CONFIG.has_option(test_section_name, 'list_subtests'): # Test with subtests list_tests = PIGLIT_CONFIG.get(test_section_name, 'list_subtests') subtest_regex = PIGLIT_CONFIG.get(test_section_name, 'subtest_regex') subtest_regex.encode('string_escape') run_subtests = PIGLIT_CONFIG.get(test_section_name, 'run_subtest') list_tests = list_tests.split() subtests = subprocess.check_output(args=list_tests, cwd=bindir).split('\n') for subtest in subtests: m = re.match(subtest_regex, subtest) if not m: continue subtest = m.group(1) subtest_command = join( bindir, run_subtests.replace('<subtest>', subtest)) add_sub_test( profile, test_name, subtest, OCLConform(command=subtest_command, run_concurrent=should_run_concurrent)) else: run_test = PIGLIT_CONFIG.get(test_section_name, 'run_test') add_test( profile, test_name, OCLConform(command=run_test, run_concurrent=should_run_concurrent))
def add_oclconform_tests(profile): section_name = 'oclconform' if not PIGLIT_CONFIG.has_section(section_name): return bindir = PIGLIT_CONFIG.get(section_name, 'bindir') options = PIGLIT_CONFIG.options(section_name) tests = (o for o in options if PIGLIT_CONFIG.get(section_name, o) is None) for test in tests: test_section_name = get_test_section_name(test) if not PIGLIT_CONFIG.has_section(test_section_name): print("Warning: no section defined for {}".format(test), file=stderr) continue test_name = PIGLIT_CONFIG.get(test_section_name, 'test_name') should_run_concurrent = PIGLIT_CONFIG.has_option(test_section_name, 'concurrent') if PIGLIT_CONFIG.has_option(test_section_name, 'list_subtests'): list_tests = PIGLIT_CONFIG.get(test_section_name, 'list_subtests') subtest_regex = PIGLIT_CONFIG.get(test_section_name, 'subtest_regex') subtest_regex.encode('string_escape') run_subtests = PIGLIT_CONFIG.get(test_section_name, 'run_subtest') list_tests = list_tests.split() subtests = subprocess.check_output(args=list_tests, cwd=bindir).split('\n') for subtest in subtests: m = re.match(subtest_regex, subtest) if not m: continue subtest = m.group(1) subtest_command = join(bindir, run_subtests.replace('<subtest>', subtest)) add_sub_test(profile, test_name, subtest, OCLConform(command=subtest_command.split(), run_concurrent=should_run_concurrent)) else: run_test = PIGLIT_CONFIG.get(test_section_name, 'run_test') add_test(profile, test_name, OCLConform(command=run_test.split(), run_concurrent=should_run_concurrent))
def add_oclconform_tests(profile): section_name = "oclconform" if not PIGLIT_CONFIG.has_section(section_name): return bindir = PIGLIT_CONFIG.get(section_name, "bindir") options = PIGLIT_CONFIG.options(section_name) tests = (o for o in options if PIGLIT_CONFIG.get(section_name, o) is None) for test in tests: test_section_name = get_test_section_name(test) if not PIGLIT_CONFIG.has_section(test_section_name): print("Warning: no section defined for {}".format(test), file=stderr) continue test_name = PIGLIT_CONFIG.get(test_section_name, "test_name") should_run_concurrent = PIGLIT_CONFIG.has_option(test_section_name, "concurrent") if PIGLIT_CONFIG.has_option(test_section_name, "list_subtests"): # Test with subtests list_tests = PIGLIT_CONFIG.get(test_section_name, "list_subtests") subtest_regex = PIGLIT_CONFIG.get(test_section_name, "subtest_regex") subtest_regex.encode("string_escape") run_subtests = PIGLIT_CONFIG.get(test_section_name, "run_subtest") list_tests = list_tests.split() subtests = subprocess.check_output(args=list_tests, cwd=bindir).split("\n") for subtest in subtests: m = re.match(subtest_regex, subtest) if not m: continue subtest = m.group(1) subtest_command = join(bindir, run_subtests.replace("<subtest>", subtest)) add_sub_test( profile, test_name, subtest, OCLConform(command=subtest_command, run_concurrent=should_run_concurrent), ) else: run_test = PIGLIT_CONFIG.get(test_section_name, "run_test") add_test(profile, test_name, OCLConform(command=run_test, run_concurrent=should_run_concurrent))
def __init__(self, test_prog, testname): options = [test_prog, '--gtest_filter=' + testname, '--gtest_color=no'] if PIGLIT_CONFIG.has_option('opencv', 'workdir'): options.append('-w {}'.format(PIGLIT_CONFIG.get('opencv', 'workdir'))) GTest.__init__(self, options)
def __init__(self, test_prog, testname): options = [test_prog, '--gtest_filter=' + testname, '--gtest_color=no'] if PIGLIT_CONFIG.has_option('opencv', 'workdir'): options.append('-w {}'.format( PIGLIT_CONFIG.get('opencv', 'workdir'))) GTest.__init__(self, options)