@@ -270,40 +270,63 @@ def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
270270 """
271271 )
272272
273- test_or_build .add_argument (
274- "-b" ,
275- "--build-only" ,
276- action = "store_true" ,
277- default = "--prep-artifacts-for-testing" in sys .argv ,
278- help = "Only build the code, do not attempt to run the code on targets."
279- )
273+ parser .add_argument (
274+ "-a" , "--arch" , action = "append" ,
275+ help = "Arch filter for testing. Takes precedence over --platform. "
276+ "If unspecified, test all arches. Multiple invocations "
277+ "are treated as a logical 'or' relationship" )
280278
281- test_or_build .add_argument (
282- "--prep-artifacts-for-testing" , action = "store_true" ,
283- help = "Generate artifacts for testing, do not attempt to run the "
284- "code on targets." )
279+ parser .add_argument (
280+ "--vendor" , action = "append" , default = [],
281+ help = "Vendor filter for testing" )
285282
286283 parser .add_argument (
287- "--package-artifacts" ,
288- help = "Package artifacts needed for flashing in a file to be used with --test-only"
289- )
284+ "-p" , "--platform" , action = "append" , default = [],
285+ help = "Platform filter for testing. This option may be used multiple "
286+ "times. Test suites will only be built/run on the platforms "
287+ "specified. If this option is not used, then platforms marked "
288+ "as default in the platform metadata file will be chosen "
289+ "to build and test. " )
290290
291- test_or_build .add_argument (
292- "--test-only" , action = "store_true" ,
293- help = """Only run device tests with current artifacts, do not build
294- the code""" )
291+ parser .add_argument ("-P" , "--exclude-platform" , action = "append" , default = [],
292+ help = """Exclude platforms and do not build or run any tests
293+ on those platforms. This option can be called multiple times.
294+ """
295+ )
295296
296- parser .add_argument ("--timeout-multiplier" , type = float , default = 1 ,
297- help = """Globally adjust tests timeouts by specified multiplier. The resulting test
298- timeout would be multiplication of test timeout value, board-level timeout multiplier
299- and global timeout multiplier (this parameter)""" )
297+ parser .add_argument (
298+ "--platform-pattern" , action = "append" , default = [],
299+ help = """Platform regular expression filter for testing. This option may be used multiple
300+ times. Test suites will only be built/run on the platforms
301+ matching the specified patterns. If this option is not used, then platforms marked
302+ as default in the platform metadata file will be chosen
303+ to build and test.
304+ """ )
300305
301306 parser .add_argument (
302307 "--test-pattern" , action = "append" ,
303308 help = """Run only the tests matching the specified pattern. The pattern
304309 can include regular expressions.
305310 """ )
306311
312+ parser .add_argument (
313+ "--filter" , choices = ['buildable' , 'runnable' ],
314+ default = 'runnable' if "--device-testing" in sys .argv else 'buildable' ,
315+ help = """Filter tests to be built and executed. By default everything is
316+ built and if a test is runnable (emulation or a connected device), it
317+ is run. This option allows for example to only build tests that can
318+ actually be run. Runnable is a subset of buildable.""" )
319+
320+ parser .add_argument (
321+ "-t" , "--tag" , action = "append" ,
322+ help = "Specify tags to restrict which tests to run by tag value. "
323+ "Default is to not do any tag filtering. Multiple invocations "
324+ "are treated as a logical 'or' relationship." )
325+
326+ parser .add_argument ("-e" , "--exclude-tag" , action = "append" ,
327+ help = "Specify tags of tests that should not run. "
328+ "Default is to run all tests with all tags." )
329+
307330 test_xor_subtest .add_argument (
308331 "-s" , "--test" , "--scenario" , action = "append" , type = norm_path ,
309332 help = """Run only the specified test suite scenario. These are named by
@@ -326,6 +349,47 @@ def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
326349 Note: With --no-detailed-test-id use only Ztest names without scenario name.
327350 """ )
328351
352+ parser .add_argument (
353+ "-K" , "--force-platform" , action = "store_true" ,
354+ help = """Force testing on selected platforms,
355+ even if they are excluded in the test configuration (testcase.yaml)."""
356+ )
357+
358+ parser .add_argument ("--ignore-platform-key" , action = "store_true" ,
359+ help = "Do not filter based on platform key" )
360+
361+ parser .add_argument ("--level" , action = "store" ,
362+ help = "Test level to be used. By default, no levels are used for filtering "
363+ "and do the selection based on existing filters." )
364+
365+ test_or_build .add_argument (
366+ "-b" ,
367+ "--build-only" ,
368+ action = "store_true" ,
369+ default = "--prep-artifacts-for-testing" in sys .argv ,
370+ help = "Only build the code, do not attempt to run the code on targets."
371+ )
372+
373+ test_or_build .add_argument (
374+ "--prep-artifacts-for-testing" , action = "store_true" ,
375+ help = "Generate artifacts for testing, do not attempt to run the "
376+ "code on targets." )
377+
378+ parser .add_argument (
379+ "--package-artifacts" ,
380+ help = "Package artifacts needed for flashing in a file to be used with --test-only"
381+ )
382+
383+ test_or_build .add_argument (
384+ "--test-only" , action = "store_true" ,
385+ help = """Only run device tests with current artifacts, do not build
386+ the code""" )
387+
388+ parser .add_argument ("--timeout-multiplier" , type = float , default = 1 ,
389+ help = """Globally adjust tests timeouts by specified multiplier. The resulting test
390+ timeout would be multiplication of test timeout value, board-level timeout multiplier
391+ and global timeout multiplier (this parameter)""" )
392+
329393 parser .add_argument (
330394 "--pytest-args" , action = "append" ,
331395 help = """Pass additional arguments to the pytest subprocess. This parameter
@@ -375,12 +439,6 @@ def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
375439 help = "Allow to use pytest plugin installed by pip for pytest tests."
376440 )
377441
378- parser .add_argument (
379- "-a" , "--arch" , action = "append" ,
380- help = "Arch filter for testing. Takes precedence over --platform. "
381- "If unspecified, test all arches. Multiple invocations "
382- "are treated as a logical 'or' relationship" )
383-
384442 parser .add_argument (
385443 "-B" , "--subset" ,
386444 help = "Only run a subset of the tests, 1/4 for running the first 25%%, "
@@ -461,20 +519,12 @@ def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
461519 help = "Path to file with plans and test configurations."
462520 )
463521
464- parser .add_argument ("--level" , action = "store" ,
465- help = "Test level to be used. By default, no levels are used for filtering "
466- "and do the selection based on existing filters." )
467-
468522 parser .add_argument (
469523 "--disable-suite-name-check" , action = "store_true" , default = False ,
470524 help = "Disable extended test suite name verification at the beginning "
471525 "of Ztest test. This option could be useful for tests or "
472526 "platforms, which from some reasons cannot print early logs." )
473527
474- parser .add_argument ("-e" , "--exclude-tag" , action = "append" ,
475- help = "Specify tags of tests that should not run. "
476- "Default is to run all tests with all tags." )
477-
478528 parser .add_argument (
479529 "--enable-lsan" , action = "store_true" ,
480530 help = """Enable leak sanitizer to check for heap memory leaks.
@@ -491,14 +541,6 @@ def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
491541 binaries such as those generated for the native_sim configuration.
492542 """ )
493543
494- parser .add_argument (
495- "--filter" , choices = ['buildable' , 'runnable' ],
496- default = 'runnable' if "--device-testing" in sys .argv else 'buildable' ,
497- help = """Filter tests to be built and executed. By default everything is
498- built and if a test is runnable (emulation or a connected device), it
499- is run. This option allows for example to only build tests that can
500- actually be run. Runnable is a subset of buildable.""" )
501-
502544 parser .add_argument ("--force-color" , action = "store_true" ,
503545 help = "Always output ANSI color escape sequences "
504546 "even when the output is redirected (not a tty)" )
@@ -587,20 +629,11 @@ def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
587629 help = "Upon test failure, print relevant log data to stdout "
588630 "instead of just a path to it." )
589631
590- parser .add_argument ("--ignore-platform-key" , action = "store_true" ,
591- help = "Do not filter based on platform key" )
592-
593632 parser .add_argument (
594633 "-j" , "--jobs" , type = int ,
595634 help = "Number of jobs for building, defaults to number of CPU threads, "
596635 "overcommitted by factor 2 when --build-only." )
597636
598- parser .add_argument (
599- "-K" , "--force-platform" , action = "store_true" ,
600- help = """Force testing on selected platforms,
601- even if they are excluded in the test configuration (testcase.yaml)."""
602- )
603-
604637 parser .add_argument (
605638 "-l" , "--all" , action = "store_true" ,
606639 help = "Build/test on all platforms. Any --platform arguments "
@@ -696,32 +729,6 @@ def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
696729 parser .add_argument ("--report-filtered" , action = "store_true" ,
697730 help = "Include filtered tests in the reports." )
698731
699- parser .add_argument ("-P" , "--exclude-platform" , action = "append" , default = [],
700- help = """Exclude platforms and do not build or run any tests
701- on those platforms. This option can be called multiple times.
702- """
703- )
704-
705- parser .add_argument (
706- "--vendor" , action = "append" , default = [],
707- help = "Vendor filter for testing" )
708-
709- parser .add_argument (
710- "-p" , "--platform" , action = "append" , default = [],
711- help = "Platform filter for testing. This option may be used multiple "
712- "times. Test suites will only be built/run on the platforms "
713- "specified. If this option is not used, then platforms marked "
714- "as default in the platform metadata file will be chosen "
715- "to build and test. " )
716- parser .add_argument (
717- "--platform-pattern" , action = "append" , default = [],
718- help = """Platform regular expression filter for testing. This option may be used multiple
719- times. Test suites will only be built/run on the platforms
720- matching the specified patterns. If this option is not used, then platforms marked
721- as default in the platform metadata file will be chosen
722- to build and test.
723- """ )
724-
725732 parser .add_argument (
726733 "--platform-reports" , action = "store_true" ,
727734 help = """Create individual reports for each platform.
@@ -808,12 +815,6 @@ def add_parse_arguments(parser = None) -> argparse.ArgumentParser:
808815 "example on Windows OS. This option can be used only with "
809816 "'--ninja' argument (to use Ninja build generator)." )
810817
811- parser .add_argument (
812- "-t" , "--tag" , action = "append" ,
813- help = "Specify tags to restrict which tests to run by tag value. "
814- "Default is to not do any tag filtering. Multiple invocations "
815- "are treated as a logical 'or' relationship." )
816-
817818 parser .add_argument ("--timestamps" ,
818819 action = "store_true" ,
819820 help = "Print all messages with time stamps." )
0 commit comments