[Sanitizer tests] Add sanitizer_test_config.h to make the inclusion of gtest.h conditional

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

llvm-svn: 208696
This commit is contained in:
Timur Iskhodzhanov 2014-05-13 13:25:12 +00:00
parent 2e9136c2da
commit 339e8c98f8
6 changed files with 38 additions and 9 deletions

View File

@ -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;

View File

@ -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

View File

@ -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})

View File

@ -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.

View File

@ -0,0 +1,30 @@
//===-- sanitizer_test_config.h ---------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a part of *Sanitizer runtime.
//
//===----------------------------------------------------------------------===//
#if !defined(INCLUDED_FROM_SANITIZER_TEST_UTILS_H)
# error "This file should be included into sanitizer_test_utils.h only"
#endif
#ifndef SANITIZER_TEST_CONFIG_H
#define SANITIZER_TEST_CONFIG_H
#include <vector>
#include <string>
#include <map>
#if SANITIZER_USE_DEJAGNU_GTEST
# include "dejagnu-gtest.h"
#else
# include "gtest/gtest.h"
#endif
#endif // SANITIZER_TEST_CONFIG_H

View File

@ -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)