def _main(_): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.disable_interspersed_args() parser.add_option("-b", "--build_dir", help="the location of the output of the compiler output") parser.add_option("-t", "--test", action="append", help="which test to run") parser.add_option("", "--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="argument for --gtest_repeat") parser.add_option( "-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages" ) # My machine can do about 120 layout tests/hour in release mode. # Let's do 30 minutes worth per run. # The CPU is mostly idle, so perhaps we can raise this when # we figure out how to run them more efficiently. parser.add_option( "-n", "--num_tests", default=60, type="int", help="for layout tests: # of subtests per run. 0 for all." ) options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test or not len(options.test): parser.error("--test not specified") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
def main(_): parser = optparse.OptionParser('usage: %prog -b <dir> -t <test> <test args>') parser.disable_interspersed_args() parser.add_option('-b', '--build-dir', help=('Location of the compiler output. Can only be used ' 'when the test argument does not contain this path.')) parser.add_option("--target", help="Debug or Release") parser.add_option('-t', '--test', help='Test to run.') parser.add_option('', '--baseline', action='store_true', default=False, help='Generate baseline data instead of validating') parser.add_option('', '--gtest_filter', help='Additional arguments to --gtest_filter') parser.add_option('', '--gtest_repeat', help='Argument for --gtest_repeat') parser.add_option("--gtest_shuffle", action="store_true", default=False, help="Randomize tests' orders on every iteration.") parser.add_option("--gtest_break_on_failure", action="store_true", default=False, help="Drop in to debugger on assertion failure. Also " "useful for forcing tests to exit with a stack dump " "on the first assertion failure when running with " "--gtest_repeat=-1") parser.add_option('-v', '--verbose', action='store_true', default=False, help='Verbose output - enable debug log messages') parser.add_option('', '--tool', dest='valgrind_tool', default='memcheck', help='Specify a valgrind tool to run the tests under') parser.add_option('', '--tool_flags', dest='valgrind_tool_flags', default='', help='Specify custom flags for the selected valgrind tool') parser.add_option('', '--keep_logs', action='store_true', default=False, help=('Store memory tool logs in the <tool>.logs directory ' 'instead of /tmp.\nThis can be useful for tool ' 'developers/maintainers.\nPlease note that the <tool>' '.logs directory will be clobbered on tool startup.')) parser.add_option("--brave-new-test-launcher", action="store_true", help="run the tests with --brave-new-test-launcher") parser.add_option("--test-launcher-bot-mode", action="store_true", help="run the tests with --test-launcher-bot-mode") options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test: parser.error('--test not specified') # Support build dir both with and without the target. if (options.target and options.build_dir and not options.build_dir.endswith(options.target)): options.build_dir = os.path.join(options.build_dir, options.target) # If --build_dir is provided, prepend it to the test executable if needed. test_executable = options.test if options.build_dir and not test_executable.startswith(options.build_dir): test_executable = os.path.join(options.build_dir, test_executable) args = [test_executable] + args test = LibyuvTest(options, args, 'cmdline') return test.Run()
def _main(): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.disable_interspersed_args() parser.add_option("", "--help-tests", dest="help_tests", action="store_true", default=False, help="List all available tests") parser.add_option("-b", "--build_dir", help="the location of the compiler output") parser.add_option("-t", "--test", action="append", default=[], help="which test to run, supports test:gtest_filter format " "as well.") parser.add_option("", "--baseline", action="store_true", default=False, help="generate baseline data instead of validating") parser.add_option("", "--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under") parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool") parser.add_option("", "--keep_logs", action="store_true", default=False, help="store memory tool logs in the <tool>.logs directory " "instead of /tmp.\nThis can be useful for tool " "developers/maintainers.\nPlease note that the <tool>" ".logs directory will be clobbered on tool startup.") parser.add_option("-n", "--num_tests", type="int", default=ChromeTests.LAYOUT_TESTS_DEFAULT_CHUNK_SIZE, help="for layout tests: # of subtests per run. 0 for all.") # TODO(thestig) Remove this if we can. parser.add_option("", "--gtest_color", dest="gtest_color", default="no", help="dummy compatibility flag for sharding_supervisor.") options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if options.help_tests: ChromeTests.ShowTests() return 0 if not options.test: parser.error("--test not specified") if len(options.test) != 1 and options.gtest_filter: parser.error("--gtest_filter and multiple tests don't make sense together") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
def main(): if not sys.platform.startswith('linux'): logging.error("Heap checking works only on Linux at the moment.") return 1 parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.add_option("-b", "--build-dir", help="the location of the output of the compiler output") parser.add_option("--target", help="Debug or Release") parser.add_option("-t", "--test", action="append", help="which test to run") parser.add_option("--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") # My machine can do about 120 layout tests/hour in release mode. # Let's do 30 minutes worth per run. # The CPU is mostly idle, so perhaps we can raise this when # we figure out how to run them more efficiently. parser.add_option( "-n", "--num_tests", default=60, type="int", help="for layout tests: # of subtests per run. 0 for all.") options, args = parser.parse_args() # Bake target into build_dir. if options.target and options.build_dir: assert (options.target != os.path.basename( os.path.dirname(options.build_dir))) options.build_dir = os.path.join(os.path.abspath(options.build_dir), options.target) if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test or not len(options.test): parser.error("--test not specified") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
def _main(_): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.disable_interspersed_args() parser.add_option("-b", "--build_dir", help="the location of the compiler output") parser.add_option( "-t", "--test", action="append", default=[], help="which test to run, supports test:gtest_filter format " "as well.", ) parser.add_option( "", "--baseline", action="store_true", default=False, help="generate baseline data instead of validating" ) parser.add_option("", "--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="argument for --gtest_repeat") parser.add_option( "-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages" ) parser.add_option( "", "--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under" ) parser.add_option( "", "--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool", ) # My machine can do about 120 layout tests/hour in release mode. # Let's do 30 minutes worth per run. # The CPU is mostly idle, so perhaps we can raise this when # we figure out how to run them more efficiently. parser.add_option( "-n", "--num_tests", default=60, type="int", help="for layout tests: # of subtests per run. 0 for all." ) options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test: parser.error("--test not specified") if len(options.test) != 1 and options.gtest_filter: parser.error("--gtest_filter and multiple tests don't make sense together") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
def _main(_): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...] <arguments to all tests>" "NOTE: when passing arguments to all tests, " " replace any - with +.") parser.add_option("-b", "--build_dir", help="the location of the compiler output") parser.add_option("-t", "--test", action="append", default=[], help="which test to run, supports test:gtest_filter format " "as well.") parser.add_option("", "--baseline", action="store_true", default=False, help="generate baseline data instead of validating") parser.add_option("", "--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under") parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool") parser.add_option("", "--keep_logs", action="store_true", default=False, help="store memory tool logs in the <tool>.logs directory " "instead of /tmp.\nThis can be useful for tool " "developers/maintainers.\nPlease note that the <tool>" ".logs directory will be clobbered on tool startup.") options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test: parser.error("--test not specified") if len(options.test) != 1 and options.gtest_filter: parser.error("--gtest_filter and multiple tests don't make sense together") # If --build_dir is provided, prepend that path to the test name to make it a # valid path when running on the build slaves using Chromium's runtest.py if options.build_dir and 'cmdline' in options.test and len(args) == 1: args[0] = os.path.join(options.build_dir, args[0]) # Performs the deferred-argument black magic described in the usage. translated_args = map(lambda arg: arg.replace('+', '-'), args) for t in options.test: tests = WebRTCTests(options, translated_args, t) ret = tests.Run() if ret: return ret return 0
def _main(_): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...] <arguments to all tests>" "NOTE: when passing arguments to all tests, " " replace any - with +.") parser.add_option("-b", "--build_dir", help="the location of the compiler output") parser.add_option("-t", "--test", action="append", default=[], help="which test to run, supports test:gtest_filter format " "as well.") parser.add_option("", "--baseline", action="store_true", default=False, help="generate baseline data instead of validating") parser.add_option("", "--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under") parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool") parser.add_option("", "--keep_logs", action="store_true", default=False, help="store memory tool logs in the <tool>.logs directory " "instead of /tmp.\nThis can be useful for tool " "developers/maintainers.\nPlease note that the <tool>" ".logs directory will be clobbered on tool startup.") options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test: parser.error("--test not specified") if len(options.test) != 1 and options.gtest_filter: parser.error("--gtest_filter and multiple tests don't make sense together") # Performs the deferred-argument black magic described in the usage. translated_args = map(lambda arg: arg.replace('+', '-'), args) for t in options.test: tests = WebRTCTests(options, translated_args, t) ret = tests.Run() if ret: return ret return 0
def _main(_): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.disable_interspersed_args() parser.add_option("-b", "--build_dir", help="the location of the output of the compiler output") parser.add_option("-t", "--test", action="append", help="which test to run") parser.add_option("", "--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") # My machine can do about 120 layout tests/hour in release mode. # Let's do 30 minutes worth per run. # The CPU is mostly idle, so perhaps we can raise this when # we figure out how to run them more efficiently. parser.add_option( "-n", "--num_tests", default=60, type="int", help="for layout tests: # of subtests per run. 0 for all.") options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test or not len(options.test): parser.error("--test not specified") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
def _main(_): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.disable_interspersed_args() parser.add_option("-b", "--build_dir", help="the location of the compiler output") parser.add_option("-t", "--test", action="append", default=[], help="which test to run, supports test:gtest_filter format " "as well.") parser.add_option("", "--baseline", action="store_true", default=False, help="generate baseline data instead of validating") parser.add_option("", "--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under") parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool") # My machine can do about 120 layout tests/hour in release mode. # Let's do 30 minutes worth per run. # The CPU is mostly idle, so perhaps we can raise this when # we figure out how to run them more efficiently. parser.add_option("-n", "--num_tests", default=60, type="int", help="for layout tests: # of subtests per run. 0 for all.") options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test: parser.error("--test not specified") if len(options.test) != 1 and options.gtest_filter: parser.error("--gtest_filter and multiple tests don't make sense together") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
def main(): if not sys.platform.startswith('linux'): logging.error("Heap checking works only on Linux at the moment.") return 1 parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.add_option("-b", "--build-dir", help="the location of the output of the compiler output") parser.add_option("--target", help="Debug or Release") parser.add_option("-t", "--test", action="append", help="which test to run") parser.add_option("--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") # My machine can do about 120 layout tests/hour in release mode. # Let's do 30 minutes worth per run. # The CPU is mostly idle, so perhaps we can raise this when # we figure out how to run them more efficiently. parser.add_option("-n", "--num_tests", default=60, type="int", help="for layout tests: # of subtests per run. 0 for all.") options, args = parser.parse_args() # Bake target into build_dir. if options.target and options.build_dir: assert (options.target != os.path.basename(os.path.dirname(options.build_dir))) options.build_dir = os.path.join(os.path.abspath(options.build_dir), options.target) if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test or not len(options.test): parser.error("--test not specified") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
def _main(_): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.disable_interspersed_args() parser.add_option("-b", "--build_dir", help="the location of the compiler output") parser.add_option("-t", "--test", action="append", default=[], help="which test to run, supports test:gtest_filter format " "as well.") parser.add_option("", "--baseline", action="store_true", default=False, help="generate baseline data instead of validating") parser.add_option("", "--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") parser.add_option("", "--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under") parser.add_option("", "--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool") parser.add_option("", "--keep_logs", action="store_true", default=False, help="store memory tool logs in the <tool>.logs directory " "instead of /tmp.\nThis can be useful for tool " "developers/maintainers.\nPlease note that the <tool>" ".logs directory will be clobbered on tool startup.") options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test: parser.error("--test not specified") if len(options.test) != 1 and options.gtest_filter: parser.error("--gtest_filter and multiple tests don't make sense together") for t in options.test: tests = WebRTCTests(options, args, t) ret = tests.Run() if ret: return ret return 0
def main(_): parser = optparse.OptionParser( 'usage: %prog -b <dir> -t <test> -- <test args>') parser.disable_interspersed_args() parser.add_option('-b', '--build_dir', help=('Location of the compiler output. Can only be used ' 'when the test argument does not contain this path.')) parser.add_option('-t', '--test', help='Test to run.') parser.add_option('', '--baseline', action='store_true', default=False, help='Generate baseline data instead of validating') parser.add_option('', '--gtest_filter', help='Additional arguments to --gtest_filter') parser.add_option('', '--gtest_repeat', help='Argument for --gtest_repeat') parser.add_option('-v', '--verbose', action='store_true', default=False, help='Verbose output - enable debug log messages') parser.add_option('', '--tool', dest='valgrind_tool', default='memcheck', help='Specify a valgrind tool to run the tests under') parser.add_option('', '--tool_flags', dest='valgrind_tool_flags', default='', help='Specify custom flags for the selected valgrind tool') parser.add_option('', '--keep_logs', action='store_true', default=False, help=('Store memory tool logs in the <tool>.logs directory ' 'instead of /tmp.\nThis can be useful for tool ' 'developers/maintainers.\nPlease note that the <tool>' '.logs directory will be clobbered on tool startup.')) options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test: parser.error('--test not specified') # If --build_dir is provided, prepend it to the test executable if needed. test_executable = options.test if options.build_dir and not test_executable.startswith(options.build_dir): test_executable = os.path.join(options.build_dir, test_executable) args = [test_executable] + args test = WebRTCTest(options.test, options, args, 'cmdline') return test.Run()
def main(_): parser = optparse.OptionParser('usage: %prog -b <dir> -t <test> <test args>') parser.disable_interspersed_args() parser.add_option('-b', '--build_dir', help=('Location of the compiler output. Can only be used ' 'when the test argument does not contain this path.')) parser.add_option('-t', '--test', help='Test to run.') parser.add_option('', '--baseline', action='store_true', default=False, help='Generate baseline data instead of validating') parser.add_option('', '--gtest_filter', help='Additional arguments to --gtest_filter') parser.add_option('', '--gtest_repeat', help='Argument for --gtest_repeat') parser.add_option('-v', '--verbose', action='store_true', default=False, help='Verbose output - enable debug log messages') parser.add_option('', '--tool', dest='valgrind_tool', default='memcheck', help='Specify a valgrind tool to run the tests under') parser.add_option('', '--tool_flags', dest='valgrind_tool_flags', default='', help='Specify custom flags for the selected valgrind tool') parser.add_option('', '--keep_logs', action='store_true', default=False, help=('Store memory tool logs in the <tool>.logs directory ' 'instead of /tmp.\nThis can be useful for tool ' 'developers/maintainers.\nPlease note that the <tool>' '.logs directory will be clobbered on tool startup.')) options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test: parser.error('--test not specified') # If --build_dir is provided, prepend it to the test executable if needed. test_executable = options.test if options.build_dir and not test_executable.startswith(options.build_dir): test_executable = os.path.join(options.build_dir, test_executable) args = [test_executable] + args test = LibyuvTest(options, args, 'cmdline') return test.Run()
def _main(): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.add_option("--help-tests", dest="help_tests", action="store_true", default=False, help="List all available tests") parser.add_option("-b", "--build-dir", help="the location of the compiler output") parser.add_option("--target", help="Debug or Release") parser.add_option("-t", "--test", action="append", default=[], help="which test to run, supports test:gtest_filter format " "as well.") parser.add_option("--baseline", action="store_true", default=False, help="generate baseline data instead of validating") parser.add_option("--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("--gtest_shuffle", action="store_true", default=False, help="Randomize tests' orders on every iteration.") parser.add_option("--gtest_break_on_failure", action="store_true", default=False, help="Drop in to debugger on assertion failure. Also " "useful for forcing tests to exit with a stack dump " "on the first assertion failure when running with " "--gtest_repeat=-1") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") parser.add_option("--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under") parser.add_option("--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool") parser.add_option("--keep_logs", action="store_true", default=False, help="store memory tool logs in the <tool>.logs directory " "instead of /tmp.\nThis can be useful for tool " "developers/maintainers.\nPlease note that the <tool>" ".logs directory will be clobbered on tool startup.") parser.add_option("-n", "--num_tests", type="int", default=ChromeTests.LAYOUT_TESTS_DEFAULT_CHUNK_SIZE, help="for layout tests: # of subtests per run. 0 for all.") parser.add_option("--test-launcher-bot-mode", action="store_true", help="run the tests with --test-launcher-bot-mode") parser.add_option("--test-launcher-total-shards", type=int, help="run the tests with --test-launcher-total-shards") parser.add_option("--test-launcher-shard-index", type=int, help="run the tests with --test-launcher-shard-index") parser.add_option("--drmemory_ops", help="extra options passed to Dr. Memory") options, args = parser.parse_args() # Bake target into build_dir. if options.target and options.build_dir: assert (options.target != os.path.basename(os.path.dirname(options.build_dir))) options.build_dir = os.path.join(os.path.abspath(options.build_dir), options.target) if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if options.help_tests: ChromeTests.ShowTests() return 0 if not options.test: parser.error("--test not specified") if len(options.test) != 1 and options.gtest_filter: parser.error("--gtest_filter and multiple tests don't make sense together") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
def main(_): parser = optparse.OptionParser( 'usage: %prog -b <dir> -t <test> <test args>') parser.disable_interspersed_args() parser.add_option( '-b', '--build-dir', help=('Location of the compiler output. Can only be used ' 'when the test argument does not contain this path.')) parser.add_option("--target", help="Debug or Release") parser.add_option('-t', '--test', help='Test to run.') parser.add_option('', '--baseline', action='store_true', default=False, help='Generate baseline data instead of validating') parser.add_option('', '--gtest_filter', help='Additional arguments to --gtest_filter') parser.add_option('', '--gtest_repeat', help='Argument for --gtest_repeat') parser.add_option("--gtest_shuffle", action="store_true", default=False, help="Randomize tests' orders on every iteration.") parser.add_option("--gtest_break_on_failure", action="store_true", default=False, help="Drop in to debugger on assertion failure. Also " "useful for forcing tests to exit with a stack dump " "on the first assertion failure when running with " "--gtest_repeat=-1") parser.add_option('-v', '--verbose', action='store_true', default=False, help='Verbose output - enable debug log messages') parser.add_option('', '--tool', dest='valgrind_tool', default='memcheck', help='Specify a valgrind tool to run the tests under') parser.add_option( '', '--tool_flags', dest='valgrind_tool_flags', default='', help='Specify custom flags for the selected valgrind tool') parser.add_option( '', '--keep_logs', action='store_true', default=False, help=('Store memory tool logs in the <tool>.logs directory ' 'instead of /tmp.\nThis can be useful for tool ' 'developers/maintainers.\nPlease note that the <tool>' '.logs directory will be clobbered on tool startup.')) parser.add_option("--test-launcher-bot-mode", action="store_true", help="run the tests with --test-launcher-bot-mode") parser.add_option("--test-launcher-total-shards", type=int, help="run the tests with --test-launcher-total-shards") parser.add_option("--test-launcher-shard-index", type=int, help="run the tests with --test-launcher-shard-index") options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test: parser.error('--test not specified') # Support build dir both with and without the target. if (options.target and options.build_dir and not options.build_dir.endswith(options.target)): options.build_dir = os.path.join(options.build_dir, options.target) # If --build_dir is provided, prepend it to the test executable if needed. test_executable = options.test if options.build_dir and not test_executable.startswith(options.build_dir): test_executable = os.path.join(options.build_dir, test_executable) args = [test_executable] + args test = LibyuvTest(options, args, 'cmdline') return test.Run()
def main(_): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> <test args>") parser.disable_interspersed_args() parser.add_option( "-b", "--build-dir", help=( "Location of the compiler output. Can only be used " "when the test argument does not contain this path." ), ) parser.add_option("--target", help="Debug or Release") parser.add_option("-t", "--test", help="Test to run.") parser.add_option( "", "--baseline", action="store_true", default=False, help="Generate baseline data instead of validating" ) parser.add_option("", "--gtest_filter", help="Additional arguments to --gtest_filter") parser.add_option("", "--gtest_repeat", help="Argument for --gtest_repeat") parser.add_option( "--gtest_shuffle", action="store_true", default=False, help="Randomize tests' orders on every iteration." ) parser.add_option( "-v", "--verbose", action="store_true", default=False, help="Verbose output - enable debug log messages" ) parser.add_option( "", "--tool", dest="valgrind_tool", default="memcheck", help="Specify a valgrind tool to run the tests under" ) parser.add_option( "", "--tool_flags", dest="valgrind_tool_flags", default="", help="Specify custom flags for the selected valgrind tool", ) parser.add_option( "", "--keep_logs", action="store_true", default=False, help=( "Store memory tool logs in the <tool>.logs directory " "instead of /tmp.\nThis can be useful for tool " "developers/maintainers.\nPlease note that the <tool>" ".logs directory will be clobbered on tool startup." ), ) parser.add_option( "--brave-new-test-launcher", action="store_true", help="run the tests with --brave-new-test-launcher" ) parser.add_option( "--test-launcher-bot-mode", action="store_true", help="run the tests with --test-launcher-bot-mode" ) options, args = parser.parse_args() if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if not options.test: parser.error("--test not specified") # Support build dir both with and without the target. if options.target and options.build_dir and not options.build_dir.endswith(options.target): options.build_dir = os.path.join(options.build_dir, options.target) # If --build_dir is provided, prepend it to the test executable if needed. test_executable = options.test if options.build_dir and not test_executable.startswith(options.build_dir): test_executable = os.path.join(options.build_dir, test_executable) args = [test_executable] + args test = LibyuvTest(options, args, "cmdline") return test.Run()
def _main(): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.add_option("--help-tests", dest="help_tests", action="store_true", default=False, help="List all available tests") parser.add_option("-b", "--build-dir", help="the location of the compiler output") parser.add_option("--target", help="Debug or Release") parser.add_option( "-t", "--test", action="append", default=[], help="which test to run, supports test:gtest_filter format " "as well.") parser.add_option("--baseline", action="store_true", default=False, help="generate baseline data instead of validating") parser.add_option("--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("--gtest_shuffle", action="store_true", default=False, help="Randomize tests' orders on every iteration.") parser.add_option("--gtest_break_on_failure", action="store_true", default=False, help="Drop in to debugger on assertion failure. Also " "useful for forcing tests to exit with a stack dump " "on the first assertion failure when running with " "--gtest_repeat=-1") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") parser.add_option("--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under") parser.add_option( "--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool") parser.add_option( "--keep_logs", action="store_true", default=False, help="store memory tool logs in the <tool>.logs directory " "instead of /tmp.\nThis can be useful for tool " "developers/maintainers.\nPlease note that the <tool>" ".logs directory will be clobbered on tool startup.") parser.add_option( "-n", "--num_tests", type="int", default=ChromeTests.LAYOUT_TESTS_DEFAULT_CHUNK_SIZE, help="for layout tests: # of subtests per run. 0 for all.") parser.add_option("--test-launcher-bot-mode", action="store_true", help="run the tests with --test-launcher-bot-mode") parser.add_option("--test-launcher-total-shards", type=int, help="run the tests with --test-launcher-total-shards") parser.add_option("--test-launcher-shard-index", type=int, help="run the tests with --test-launcher-shard-index") parser.add_option("--drmemory_ops", help="extra options passed to Dr. Memory") options, args = parser.parse_args() # Bake target into build_dir. if options.target and options.build_dir: assert (options.target != os.path.basename( os.path.dirname(options.build_dir))) options.build_dir = os.path.join(os.path.abspath(options.build_dir), options.target) if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if options.help_tests: ChromeTests.ShowTests() return 0 if not options.test: parser.error("--test not specified") if len(options.test) != 1 and options.gtest_filter: parser.error( "--gtest_filter and multiple tests don't make sense together") for t in options.test: tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0
def _main(): parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " "[-t <test> ...]") parser.add_option("--help-tests", dest="help_tests", action="store_true", default=False, help="List all available tests") parser.add_option("-b", "--build-dir", help="the location of the compiler output") parser.add_option("--target", help="Debug or Release") parser.add_option("-t", "--test", action="append", default=[], help="which test to run, supports test:gtest_filter format " "as well.") parser.add_option("--baseline", action="store_true", default=False, help="generate baseline data instead of validating") parser.add_option("-f", "--force", action="store_true", default=False, help="run a broken test anyway") parser.add_option("--gtest_filter", help="additional arguments to --gtest_filter") parser.add_option("--gtest_repeat", help="argument for --gtest_repeat") parser.add_option("--gtest_shuffle", action="store_true", default=False, help="Randomize tests' orders on every iteration.") parser.add_option("--gtest_break_on_failure", action="store_true", default=False, help="Drop in to debugger on assertion failure. Also " "useful for forcing tests to exit with a stack dump " "on the first assertion failure when running with " "--gtest_repeat=-1") parser.add_option("-v", "--verbose", action="store_true", default=False, help="verbose output - enable debug log messages") parser.add_option("--tool", dest="valgrind_tool", default="memcheck", help="specify a valgrind tool to run the tests under") parser.add_option("--tool_flags", dest="valgrind_tool_flags", default="", help="specify custom flags for the selected valgrind tool") parser.add_option("--keep_logs", action="store_true", default=False, help="store memory tool logs in the <tool>.logs directory " "instead of /tmp.\nThis can be useful for tool " "developers/maintainers.\nPlease note that the <tool>" ".logs directory will be clobbered on tool startup.") parser.add_option("-n", "--num_tests", type="int", default=ChromeTests.LAYOUT_TESTS_DEFAULT_CHUNK_SIZE, help="for layout tests: # of subtests per run. 0 for all.") parser.add_option("--test-launcher-bot-mode", action="store_true", help="run the tests with --test-launcher-bot-mode") parser.add_option("--test-launcher-total-shards", type=int, help="run the tests with --test-launcher-total-shards") parser.add_option("--test-launcher-shard-index", type=int, help="run the tests with --test-launcher-shard-index") parser.add_option("--drmemory_ops", help="extra options passed to Dr. Memory") options, args = parser.parse_args() # Bake target into build_dir. if options.target and options.build_dir: assert (options.target != os.path.basename(os.path.dirname(options.build_dir))) options.build_dir = os.path.join(os.path.abspath(options.build_dir), options.target) if options.verbose: logging_utils.config_root(logging.DEBUG) else: logging_utils.config_root() if options.help_tests: ChromeTests.ShowTests() return 0 if not options.test: parser.error("--test not specified") if len(options.test) != 1 and options.gtest_filter: parser.error("--gtest_filter and multiple tests don't make sense together") BROKEN_TESTS = { 'drmemory_light': [ 'addressinput', 'aura', 'base_unittests', 'cc', 'components', # x64 only? 'content', 'gfx', 'mojo_public_bindings', ], 'drmemory_full': [ 'addressinput', 'aura', 'base_unittests', 'blink_heap', 'blink_platform', 'browser_tests', 'cast', 'cc', 'chromedriver', 'compositor', 'content', 'content_browsertests', 'device', 'events', 'extensions', 'gfx', 'google_apis', 'gpu', 'ipc_tests', 'jingle', 'keyboard', 'media', 'midi', 'mojo_common', 'mojo_public_bindings', 'mojo_public_sysperf', 'mojo_public_system', 'mojo_system', 'net', 'remoting', 'unit', 'url', ], } for t in options.test: if t in BROKEN_TESTS[options.valgrind_tool] and not options.force: logging.info("Skipping broken %s test %s -- see crbug.com/633693" % (options.valgrind_tool, t)) return 0 tests = ChromeTests(options, args, t) ret = tests.Run() if ret: return ret return 0