[CMake] Don't include the test directories if CLANG_INCLUDE_TESTS is Off

This matches Clang's behavior.

llvm-svn: 249048
GitOrigin-RevId: 261d3ea0f8671e4440325180a29718e60b005f86
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 428ed80..6aa3060 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@
 
 # Add the common testsuite after all the tools.
 # TODO: Support tests with more granularity when features are off?
-if(CLANG_ENABLE_STATIC_ANALYZER)
+if(CLANG_ENABLE_STATIC_ANALYZER AND CLANG_ENABLE_TESTS)
 add_subdirectory(test)
 add_subdirectory(unittests)
 endif()