Skip to content

Commit db385eb

Browse files
Antti Kauppilamadchutney
Antti Kauppila
authored andcommitted
Valgrind option added for unittests (#940)
1 parent 0ee519e commit db385eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mbed/mbed.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2833,7 +2833,8 @@ def compile_(toolchain=None, target=None, macro=False, profile=False,
28332833
dict(name='--test-spec', dest="test_spec", help="Path used for the test spec file used when building and running tests (the default path is the build directory)"),
28342834
dict(name='--app-config', dest="app_config", help="Path of an application configuration file. Default is to look for \"mbed_app.json\""),
28352835
dict(name='--test-config', dest="test_config", help="Path or mbed OS keyword of a test configuration file. Example: ethernet, odin_wifi, or path/to/config.json"),
2836-
dict(name='--coverage', choices=['html', 'xml', 'both'], help='Generate code coverage report for unit tetsts'),
2836+
dict(name='--coverage', choices=['html', 'xml', 'both'], help='Generate code coverage report for unit tests'),
2837+
dict(name='--valgrind', action='store_true', help='Use Valgrind for unit tests'),
28372838
dict(name=['--make-program'], choices=['gmake', 'make', 'mingw32-make', 'ninja'], help='Which make program to use for unit tests'),
28382839
dict(name=['--generator'], choices=['Unix Makefiles', 'MinGW Makefiles', 'Ninja'], help='Which CMake generator to use for unit tests'),
28392840
dict(name='--new', help='generate files for a new unit test', metavar="FILEPATH"),
@@ -2845,7 +2846,7 @@ def compile_(toolchain=None, target=None, macro=False, profile=False,
28452846
help="Run Icetea tests. If used without --greentea flag then run only icetea tests."),
28462847
help='Find, build and run tests',
28472848
description="Find, build, and run tests in a program and libraries")
2848-
def test_(toolchain=None, target=None, macro=False, compile_list=False, run_list=False, compile_only=False, run_only=False, tests_by_name=None, source=False, profile=False, build=False, clean=False, test_spec=None, app_config=None, test_config=None, coverage=None, make_program=None, new=None, generator=None, regex=None, unittests=None, build_data=None, greentea=None, icetea=None):
2849+
def test_(toolchain=None, target=None, macro=False, compile_list=False, run_list=False, compile_only=False, run_only=False, tests_by_name=None, source=False, profile=False, build=False, clean=False, test_spec=None, app_config=None, test_config=None, coverage=None, valgrind=None, make_program=None, new=None, generator=None, regex=None, unittests=None, build_data=None, greentea=None, icetea=None):
28492850

28502851
# Default behaviour is to run only greentea tests
28512852
if not (greentea or icetea or unittests):
@@ -2900,6 +2901,7 @@ def test_(toolchain=None, target=None, macro=False, compile_list=False, run_list
29002901
+ (["--clean"] if clean else [])
29012902
+ (["--debug"] if profile and "debug" in profile else [])
29022903
+ (["--coverage", coverage] if coverage else [])
2904+
+ (["--valgrind", valgrind] if valgrind else [])
29032905
+ (["--make-program", make_program] if make_program else [])
29042906
+ (["--generator", generator] if generator else [])
29052907
+ (["--regex", regex] if regex else [])

0 commit comments

Comments
 (0)