Lines Matching defs:Test
19 For a simpleperf runtest like one_function test, it contains following steps:
163 class Test(object):
183 strs.append('Test test_name=%s' % self.test_name)
203 for test in root:
204 assert test.tag == 'test'
205 test_name = test.attrib['name']
211 for test_item in test:
254 Test(
302 """Run perf test on host."""
315 """Run perf test on device."""
424 def check_report_file(self, test, report_file, has_callgraph):
426 if not self._check_symbol_overhead_requirements(test, symbols):
429 if not self._check_symbol_children_overhead_requirements(test, symbols):
431 if not self._check_symbol_relation_requirements(test, symbols):
435 def _check_symbol_overhead_requirements(self, test, symbols):
437 matched = [False] * len(test.symbol_overhead_requirements)
438 matched_overhead = [0] * len(test.symbol_overhead_requirements)
440 for i in range(len(test.symbol_overhead_requirements)):
441 req = test.symbol_overhead_requirements[i]
447 print 'requirement (%s) has no matched symbol in test %s' % (
448 test.symbol_overhead_requirements[i], test)
453 print "Symbol (%s) doesn't match requirement (%s) in test %s" % (
454 symbol, req, test)
458 def _check_symbol_children_overhead_requirements(self, test, symbols):
460 matched = [False] * len(test.symbol_children_overhead_requirements)
462 for i in range(len(test.symbol_children_overhead_requirements)):
463 req = test.symbol_children_overhead_requirements[i]
468 print "Symbol (%s) doesn't match requirement (%s) in test %s" % (
469 symbol, req, test)
473 print 'requirement (%s) has no matched symbol in test %s' % (
474 test.symbol_children_overhead_requirements[i], test)
478 def _check_symbol_relation_requirements(self, test, symbols):
480 matched = [False] * len(test.symbol_relation_requirements)
482 for i in range(len(test.symbol_relation_requirements)):
483 req = test.symbol_relation_requirements[i]
488 print "Symbol (%s) doesn't match requirement (%s) in test %s" % (
489 symbol, req, test)
493 print 'requirement (%s) has no matched symbol in test %s' % (
494 test.symbol_relation_requirements[i], test)
504 for test in tests:
506 if test.test_name not in selected_tests:
509 host_runner.record(test.executable_name, 'perf.data')
511 additional_options = test.report_options)
513 test, 'perf.report', False)
514 print 'test %s on host %s' % (
515 test.test_name, 'Succeeded' if result else 'Failed')
520 device_runner.record(test.executable_name, '/data/perf.data')
522 additional_options = test.report_options)
523 result = report_analyzer.check_report_file(test, 'perf.report', False)
524 print 'test %s on device %s' % (
525 test.test_name, 'Succeeded' if result else 'Failed')
531 test.executable_name,
537 additional_options=['-g'] + test.report_options)
538 result = report_analyzer.check_report_file(test, 'perf_g.report', True)
539 print 'call-graph test %s on host %s' % (
540 test.test_name, 'Succeeded' if result else 'Failed')
546 test.executable_name,
552 additional_options=['-g'] + test.report_options)
553 result = report_analyzer.check_report_file(test, 'perf_g.report', True)
554 print 'call-graph test %s on device %s' % (
555 test.test_name, 'Succeeded' if result else 'Failed')
579 elif sys.argv[i] == '--test':
582 for test in sys.argv[i].split(','):
585 selected_tests[test] = True