test.h
Go to the documentation of this file.
1 // ===========================================================================
2 // Copyright (c) 2011-2012 University of Pennsylvania
3 // Copyright (c) 2013-2016 Andreas Schuh
4 // All rights reserved.
5 //
6 // See COPYING file for license information or visit
7 // https://cmake-basis.github.io/download.html#license
8 // ===========================================================================
9 
10 /**
11  * @file test.h
12  * @brief Main include file of C++ unit testing framework.
13  *
14  * This file should be included by implementations of unit tests.
15  * Note that currently we are simply using Google Test and Google Mock.
16  * Likely, this will not change soon. However, we use this header file
17  * to be prepared for this case. The implementation of the functions
18  * and macros provided by the underlying testing frameworks could then
19  * potentially be replaced by another implementations if desired.
20  *
21  * @ingroup CxxTesting
22  */
23 
24 #pragma once
25 #ifndef _BASIS_TEST_H
26 #define _BASIS_TEST_H
27 
28 
29 #include <basis/config.h>
30 
31 
32 // let Google use their own tr1/tuple implementation if the compiler
33 // does not support it; note that HAVE_TR1_TUPLE is set in config.h
34 #ifdef GTEST_USE_OWN_TR1_TUPLE
35 # undef GTEST_USE_OWN_TR1_TUPLE
36 #endif
37 #if HAVE_TR1_TUPLE
38 # define GTEST_USE_OWN_TR1_TUPLE 0
39 #else
40 # define GTEST_USE_OWN_TR1_TUPLE 1
41 #endif
42 
43 // disable use of pthreads library if not available
44 #ifdef GTEST_HAS_PTHREAD
45 # undef GTEST_HAS_PTHREAD
46 #endif
47 #if HAVE_PTHREAD
48 # define GTEST_HAS_PTHREAD 1
49 #else
50 # define GTEST_HAS_PTHREAD 0
51 #endif
52 
53 
54 #include <basis/gtest/gtest.h>
55 #include <basis/gmock/gmock.h>
56 
57 
58 #endif // _BASIS_TEST_H
System related macro definitions.