diff --git a/dist/tools/compile_and_test_for_board/compile_and_test_for_board.py b/dist/tools/compile_and_test_for_board/compile_and_test_for_board.py index 68f5bf1715..1a48160a29 100755 --- a/dist/tools/compile_and_test_for_board/compile_and_test_for_board.py +++ b/dist/tools/compile_and_test_for_board/compile_and_test_for_board.py @@ -33,36 +33,44 @@ Usage ``` usage: compile_and_test_for_board.py [-h] [--applications APPLICATIONS] - [--applications-exclude - APPLICATIONS_EXCLUDE] + [--applications-exclude APPLICATIONS_EXCLUDE] [--no-test] - [--loglevel {debug,info,warning,error, - fatal,critical}] + [--loglevel {debug,info,warning,error,fatal,critical}] [--incremental] [--clean-after] + [--compile-targets COMPILE_TARGETS] + [--test-targets TEST_TARGETS] [--jobs JOBS] riot_directory board [result_directory] positional arguments: riot_directory RIOT directory to test board Board to test - result_directory Result directory, by default "results" + result_directory Result directory (default: results) optional arguments: -h, --help show this help message and exit --applications APPLICATIONS List of applications to test, overwrites default - configuration of testing all applications + configuration of testing all applications (default: + None) --applications-exclude APPLICATIONS_EXCLUDE List of applications to exclude from tested applications. Also applied after "--applications". - --no-test Disable executing tests + (default: None) + --no-test Disable executing tests (default: False) --loglevel {debug,info,warning,error,fatal,critical} - Python logger log level, defauts to "info" + Python logger log level (default: info) --incremental Do not rerun successful compilation and tests - --clean-after Clean after running each test + (default: False) + --clean-after Clean after running each test (default: False) + --compile-targets COMPILE_TARGETS + List of make targets to compile (default: clean all) + --test-targets TEST_TARGETS + List of make targets to run test (default: test) --jobs JOBS, -j JOBS Parallel building (0 means not limit, like '--jobs') + (default: None) ``` -""" +""" # noqa import os import sys @@ -539,7 +547,7 @@ PARSER = argparse.ArgumentParser( PARSER.add_argument('riot_directory', help='RIOT directory to test') PARSER.add_argument('board', help='Board to test', type=_strip_board_equal) PARSER.add_argument('result_directory', nargs='?', default='results', - help='Result directory, by default "results"') + help='Result directory') PARSER.add_argument( '--applications', type=list_from_string, help=('List of applications to test, overwrites default configuration of' @@ -553,7 +561,7 @@ PARSER.add_argument( PARSER.add_argument('--no-test', action='store_true', default=False, help='Disable executing tests') PARSER.add_argument('--loglevel', choices=LOG_LEVELS, default='info', - help='Python logger log level, defauts to "info"') + help='Python logger log level') PARSER.add_argument('--incremental', action='store_true', default=False, help='Do not rerun successful compilation and tests') PARSER.add_argument('--clean-after', action='store_true', default=False, diff --git a/dist/tools/compile_and_test_for_board/tests/__init__.py b/dist/tools/compile_and_test_for_board/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dist/tools/compile_and_test_for_board/tests/test_compile_and_test_for_board.py b/dist/tools/compile_and_test_for_board/tests/test_compile_and_test_for_board.py new file mode 100644 index 0000000000..5aeeb90a36 --- /dev/null +++ b/dist/tools/compile_and_test_for_board/tests/test_compile_and_test_for_board.py @@ -0,0 +1,18 @@ +"""Test compile_and_test_for_board script.""" + +import subprocess + +import compile_and_test_for_board + + +def test_help_message(): + """Verify that the help message is in the script documentation.""" + script = 'compile_and_test_for_board.py' + + # Read the help message from executing the script + help_bytes = subprocess.check_output(['./%s' % script, '--help']) + help_msg = help_bytes.decode('utf-8') + + docstring = compile_and_test_for_board.__doc__ + + assert help_msg in docstring, "Help message not in the documentation" diff --git a/dist/tools/compile_and_test_for_board/tox.ini b/dist/tools/compile_and_test_for_board/tox.ini index b3c89b9cac..e55c7252e5 100644 --- a/dist/tools/compile_and_test_for_board/tox.ini +++ b/dist/tools/compile_and_test_for_board/tox.ini @@ -14,14 +14,14 @@ commands = [testenv:test] deps = pytest commands = - pytest -v --doctest-modules {env:script} + pytest -v --doctest-modules [testenv:lint] deps = pylint commands = - pylint {env:script} + pylint {env:script} tests [testenv:flake8] deps = flake8 commands = - flake8 {env:script} + flake8 {env:script} tests