Hey,

This patch add an option allowing the user to run the test suite using
Valgrind. This option defaults to off.

-- 
Best regards,
Kovarththanan Rajaratnam
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index cd822f6..5361ec1 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -40,6 +40,11 @@ if(PYTHONINTERP_FOUND)
     set(CLANG_TEST_EXTRA_ARGS "--no-progress-bar")
   endif()
 
+  option(CLANG_LIT_USE_VG "Run test under Valgrind" OFF)
+  if(CLANG_LIT_USE_VG)
+    set(VG_LIT_PARM "--vg")
+  endif ()
+
   foreach(testdir ${CLANG_TEST_DIRECTORIES})
     add_custom_target(clang-test-${testdir}
       COMMAND ${PYTHON_EXECUTABLE}
@@ -47,6 +52,7 @@ if(PYTHONINTERP_FOUND)
                   --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
                   --param build_config=${CMAKE_CFG_INTDIR}
                   -sv ${CLANG_TEST_EXTRA_ARGS}
+                  ${VG_LIT_PARM}
                   ${CMAKE_CURRENT_BINARY_DIR}/${testdir}
                   DEPENDS clang clang-cc index-test c-index-test
                   COMMENT "Running Clang regression tests in ${testdir}")
@@ -58,6 +64,7 @@ if(PYTHONINTERP_FOUND)
                 --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
                 --param build_config=${CMAKE_CFG_INTDIR}
                 -sv ${CLANG_TEST_EXTRA_ARGS}
+                ${VG_LIT_PARM}
                 ${CMAKE_CURRENT_BINARY_DIR}
                 DEPENDS clang clang-cc index-test c-index-test
                 COMMENT "Running Clang regression tests")
@@ -68,6 +75,7 @@ if(PYTHONINTERP_FOUND)
                 --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
                 --param build_config=${CMAKE_CFG_INTDIR}
                 -sv ${CLANG_TEST_EXTRA_ARGS}
+                ${VG_LIT_PARM}
                 ${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests
                 DEPENDS clang clang-cc index-test c-index-test
                 COMMENT "Running Clang regression tests")
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to