diff --git a/UNITTESTS/unit_test/get_tools.py b/UNITTESTS/unit_test/get_tools.py index 3588705..6cbd94e 100644 --- a/UNITTESTS/unit_test/get_tools.py +++ b/UNITTESTS/unit_test/get_tools.py @@ -53,6 +53,13 @@ return _get_program(["cmake"]) +def get_valgrind_tool(): + """ + Get Valgrind program + """ + + return _get_program(["valgrind"]) + def get_cxx_tool(): """ Get C++ compiler diff --git a/UNITTESTS/unit_test/test.py b/UNITTESTS/unit_test/test.py index 9dfb4ec..a2f8b89 100644 --- a/UNITTESTS/unit_test/test.py +++ b/UNITTESTS/unit_test/test.py @@ -28,7 +28,8 @@ from .get_tools import get_make_tool, \ get_cmake_tool, \ get_cxx_tool, \ - get_c_tool + get_c_tool, \ + get_valgrind_tool from .settings import DEFAULT_CMAKE_GENERATORS class UnitTestTool(object): @@ -96,6 +97,11 @@ args.append("-DCOVERAGE:STRING=%s" % coverage_output_type) if valgrind: + valgrind = get_valgrind_tool() + if valgrind is None: + logging.error( + "No Valgrind found in Path. Install all the required tools.\n") + sys.exit(1) args.append("-DVALGRIND=1") args.append("-DMEMORYCHECK_COMMAND_OPTIONS=\"--track-origins=yes\" \"--leak-check=full\" \"--show-reachable=yes\" \"--error-exitcode=1\"") else: