#NEWLINE# def test_parser( parser , with_num_jobs = True ) : #NEWLINE# #INDENT# qisys . parsers . worktree_parser ( parser ) #NEWLINE# group = parser . add_argument_group ( 'test options' ) #NEWLINE# group . add_argument ( '--perf' , dest = 'perf' , action = 'store_true' , help = 'run perfs tests instead of pure tests.' ) #NEWLINE# group . add_argument ( '-k' , '--pattern' , dest = 'patterns' , action = 'append' , help = 'Filter tests matching these patterns' ) #NEWLINE# group . add_argument ( '-x' , '--exclude' , dest = 'excludes' , action = 'append' , help = 'Exclude test matching these patterns' ) #NEWLINE# group . add_argument ( '-V' , dest = 'verbose_tests' , action = 'store_true' , help = 'display tests output' ) #NEWLINE# group . add_argument ( '--valgrind' , dest = 'valgrind' , action = 'store_true' , help = 'run tests under valgrind' ) #NEWLINE# group . add_argument ( '--nightmare' , dest = 'nightmare' , action = 'store_true' , help = 'run tests in shuffle and 20 times (apply only to gtest)' ) #NEWLINE# group . add_argument ( '--coverage' , dest = 'coverage' , action = 'store_true' , help = 'run coverage' ) #NEWLINE# group . add_argument ( '--ncpu' , dest = 'num_cpus' , type = int , help = 'set number of CPU each test is allowed to use (linux)' ) #NEWLINE# group . add_argument ( '--nightly' , action = 'store_true' , dest = 'nightly' ) #NEWLINE# group . add_argument ( '--break-on-failure' , action = 'store_true' , dest = 'break_on_failure' , help = 'Break on failure (for gtest only)' ) #NEWLINE# group . add_argument ( '--repeat-until-fail' , default = 0 , type = int , metavar = 'N' , help = 'Repeat tests until they fail (at most N times)' ) #NEWLINE# group . add_argument ( '--qitest-json' , dest = 'qitest_jsons' , action = 'append' ) #NEWLINE# group . add_argument ( '--test-output-dir' , dest = 'test_output_dir' , help = ( 'Generate XML test reports in the given directory ' + '(instead of build-<platform>/sdk/test-results)' ) ) #NEWLINE# group . add_argument ( '--coverage-output-dir' , dest = 'coverage_output_dir' , help = ( 'Generate XML and HTML coverage reports in the given ' + 'directory (instead of build-<platform>/sdk/coverage-results)' ) ) #NEWLINE# group . add_argument ( '--cov-exclude' , dest = 'cov_exclude_patterns' , action = 'append' , help = "Exclude the given patterns from covegare.\nDefault is: ['.*test.', '.*examples.*', '.*external.*']\nUse --cov-exclude=NONE to keep everything" ) #NEWLINE# group . add_argument ( '--root-output-dir' , dest = 'test_output_dir' , metavar = 'ROOT_OUTPUT_DIR' , help = 'same as --test-output-dir (deprecated)' ) #NEWLINE# group . add_argument ( '--no-capture' , dest = 'capture' , action = 'store_false' ) #NEWLINE# group . add_argument ( '--ignore-timeouts' , dest = 'ignore_timeouts' , action = 'store_true' , help = 'Ignore timeouts when running tests' ) #NEWLINE# group . add_argument ( '--lf' , '--last-failed' , dest = 'last_failed' , action = 'store_true' , help = 'Run the failing test from previous run' ) #NEWLINE# parser . set_defaults ( nightly = False , capture = True , last_failed = False , ignore_timeouts = False ) #NEWLINE# if with_num_jobs : #NEWLINE# #INDENT# qisys . parsers . parallel_parser ( group , default = 1 ) #NEWLINE# #UNINDENT# return group