forked from OSchip/llvm-project
[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:
parent
2e9136c2da
commit
339e8c98f8
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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})
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue