[compiler-rt] r208696 - [Sanitizer tests] Add sanitizer_test_config.h to make the inclusion of gtest.h conditional

Timur Iskhodzhanov timurrrr at google.com
Tue May 13 06:25:12 PDT 2014


Author: timurrrr
Date: Tue May 13 08:25:12 2014
New Revision: 208696

URL: http://llvm.org/viewvc/llvm-project?rev=208696&view=rev
Log:
[Sanitizer tests] Add sanitizer_test_config.h to make the inclusion of gtest.h conditional

Reviewed at http://reviews.llvm.org/D3744

Added:
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_test_config.h
      - copied, changed from r208691, compiler-rt/trunk/lib/asan/tests/asan_test_config.h
Modified:
    compiler-rt/trunk/lib/asan/tests/asan_test_config.h
    compiler-rt/trunk/lib/asan/tests/asan_test_utils.h
    compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_test_utils.h

Modified: compiler-rt/trunk/lib/asan/tests/asan_test_config.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test_config.h?rev=208696&r1=208695&r2=208696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test_config.h (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test_config.h Tue May 13 08:25:12 2014
@@ -21,12 +21,6 @@
 #include <string>
 #include <map>
 
-#if ASAN_USE_DEJAGNU_GTEST
-# include "dejagnu-gtest.h"
-#else
-# include "gtest/gtest.h"
-#endif
-
 using std::string;
 using std::vector;
 using std::map;

Modified: compiler-rt/trunk/lib/asan/tests/asan_test_utils.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test_utils.h?rev=208696&r1=208695&r2=208696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test_utils.h (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test_utils.h Tue May 13 08:25:12 2014
@@ -14,7 +14,7 @@
 #ifndef ASAN_TEST_UTILS_H
 #define ASAN_TEST_UTILS_H
 
-#if !defined(ASAN_EXTERNAL_TEST_CONFIG)
+#if !defined(SANITIZER_EXTERNAL_TEST_CONFIG)
 # define INCLUDED_FROM_ASAN_TEST_UTILS_H
 # include "asan_test_config.h"
 # undef INCLUDED_FROM_ASAN_TEST_UTILS_H

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=208696&r1=208695&r2=208696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Tue May 13 08:25:12 2014
@@ -27,6 +27,7 @@ set(SANITIZER_UNITTESTS
 
 set(SANITIZER_TEST_HEADERS
   sanitizer_pthread_wrappers.h
+  sanitizer_test_config.h
   sanitizer_test_utils.h)
 foreach(header ${SANITIZER_HEADERS})
   list(APPEND SANITIZER_TEST_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../${header})

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h?rev=208696&r1=208695&r2=208696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h Tue May 13 08:25:12 2014
@@ -20,8 +20,6 @@
 
 #include "sanitizer_test_utils.h"
 
-#include "gtest/gtest.h"
-
 #if !defined(_WIN32)
 # include <pthread.h>
 // Simply forward the arguments and check that the pthread functions succeed.

Copied: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_test_config.h (from r208691, compiler-rt/trunk/lib/asan/tests/asan_test_config.h)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_test_config.h?p2=compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_test_config.h&p1=compiler-rt/trunk/lib/asan/tests/asan_test_config.h&r1=208691&r2=208696&rev=208696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test_config.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_test_config.h Tue May 13 08:25:12 2014
@@ -1,4 +1,4 @@
-//===-- asan_test_config.h --------------------------------------*- C++ -*-===//
+//===-- sanitizer_test_config.h ---------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,54 +7,24 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file is a part of AddressSanitizer, an address sanity checker.
+// This file is a part of *Sanitizer runtime.
 //
 //===----------------------------------------------------------------------===//
-#if !defined(INCLUDED_FROM_ASAN_TEST_UTILS_H)
-# error "This file should be included into asan_test_utils.h only"
+#if !defined(INCLUDED_FROM_SANITIZER_TEST_UTILS_H)
+# error "This file should be included into sanitizer_test_utils.h only"
 #endif
 
-#ifndef ASAN_TEST_CONFIG_H
-#define ASAN_TEST_CONFIG_H
+#ifndef SANITIZER_TEST_CONFIG_H
+#define SANITIZER_TEST_CONFIG_H
 
 #include <vector>
 #include <string>
 #include <map>
 
-#if ASAN_USE_DEJAGNU_GTEST
+#if SANITIZER_USE_DEJAGNU_GTEST
 # include "dejagnu-gtest.h"
 #else
 # include "gtest/gtest.h"
 #endif
 
-using std::string;
-using std::vector;
-using std::map;
-
-#ifndef ASAN_UAR
-# error "please define ASAN_UAR"
-#endif
-
-#ifndef ASAN_HAS_EXCEPTIONS
-# error "please define ASAN_HAS_EXCEPTIONS"
-#endif
-
-#ifndef ASAN_HAS_BLACKLIST
-# error "please define ASAN_HAS_BLACKLIST"
-#endif
-
-#ifndef ASAN_NEEDS_SEGV
-# if defined(_WIN32)
-#  define ASAN_NEEDS_SEGV 0
-# else
-#  define ASAN_NEEDS_SEGV 1
-# endif
-#endif
-
-#ifndef ASAN_AVOID_EXPENSIVE_TESTS
-# define ASAN_AVOID_EXPENSIVE_TESTS 0
-#endif
-
-#define ASAN_PCRE_DOTALL ""
-
-#endif  // ASAN_TEST_CONFIG_H
+#endif  // SANITIZER_TEST_CONFIG_H

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_test_utils.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_test_utils.h?rev=208696&r1=208695&r2=208696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_test_utils.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_test_utils.h Tue May 13 08:25:12 2014
@@ -23,6 +23,12 @@
 # undef min
 #endif
 
+#if !defined(SANITIZER_EXTERNAL_TEST_CONFIG)
+# define INCLUDED_FROM_SANITIZER_TEST_UTILS_H
+# include "sanitizer_test_config.h"
+# undef INCLUDED_FROM_SANITIZER_TEST_UTILS_H
+#endif
+
 #include <stdint.h>
 
 #if defined(_MSC_VER)





More information about the llvm-commits mailing list