RCFProto

- Main Page
- Classes
- Files

- File List

All Classes Functions Typedefs
PrintTestHeader.hpp
1
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2013, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 2.0
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18
19 #ifndef INCLUDE_RCF_TEST_PRINTTESTHEADER
20 #define INCLUDE_RCF_TEST_PRINTTESTHEADER
21
22 #include <stdlib.h>
23 #include <time.h>
24 #include <iostream>
25 #include <string>
26 #include <RCF/Config.hpp>
27 #include <RCF/test/Test.hpp>
28 #include <boost/version.hpp>
29
30 #include <RCF/Asio.hpp>
31
32 #ifdef _MSC_VER
33 #pragma warning( push )
34 #pragma warning( disable : 4996 ) // warning C4996: '' was declared deprecated
35 #endif
36
37 inline void printTestHeader(const char *file)
38 {
39 std::cout << "\n*********************\n";
40
41 std::cout << "Compiler: ";
42
43 #if defined(_MSC_VER) && _MSC_VER == 1200
44 std::cout << "Visual C++ 6";
45 #elif defined(_MSC_VER) && _MSC_VER == 1310
46 std::cout << "Visual C++ 7.1";
47 #elif defined(_MSC_VER) && _MSC_VER == 1400
48 std::cout << "Visual C++ 8.0";
49 #elif defined(_MSC_VER) && _MSC_VER == 1500
50 std::cout << "Visual C++ 9.0";
51 #elif defined(_MSC_VER) && _MSC_VER == 1600
52 std::cout << "Visual C++ 10.0";
53 #elif defined(_MSC_VER) && _MSC_VER == 1700
54 std::cout << "Visual C++ 11.0";
55 #elif defined(_MSC_VER)
56 std::cout << "Visual C++ <<<version>>> - " << "_MSC_VER is " << _MSC_VER;
57 #endif
58
59 #if defined(__GNUC__)
60 std::cout << "gcc " << __GNUC__ << "." << __GNUC_MINOR__;
61 #endif
62
63 #if defined(__BORLANDC__)
64 std::cout << "Borland C++ - __BORLANDC__ is " << __BORLANDC__;
65 #endif
66
67 std::cout << std::endl;
68 std::cout << "Architecture (bits): " << 8*sizeof(void*) << std::endl;
69
70 #if !defined(NDEBUG) || defined(_DEBUG)
71 std::cout << "Debug build" << std::endl;
72 #else
73 std::cout << "Release build" << std::endl;
74 #endif
75
76
77 std::cout << "\n*********************\n";
78 std::cout << file << std::endl;
79 time_t now = time(NULL);
80 std::cout << "Time now: " << std::string(ctime(&now));
81 std::cout << "Current working directory: " << RCF::getWorkingDir() << std::endl;
82 std::cout << "Relative path to test data: " << RCF::getRelativeTestDataPath() << std::endl;
83
84 std::cout << "Defines:" << std::endl;
85
86 std::cout << "BOOST_VERSION: " << BOOST_VERSION << std::endl;
87
88 #ifdef RCF_USE_BOOST_ASIO
89 std::cout << "BOOST_ASIO_VERSION: " << BOOST_ASIO_VERSION << std::endl;
90
91 #if defined(BOOST_ASIO_HAS_IOCP)
92 std::cout << "BOOST_ASIO_HAS_IOCP" << std::endl;
93 #elif defined(BOOST_ASIO_HAS_EPOLL)
94 std::cout << "BOOST_ASIO_HAS_EPOLL" << std::endl;
95 #elif defined(BOOST_ASIO_HAS_KQUEUE)
96 std::cout << "BOOST_ASIO_HAS_KQUEUE" << std::endl;
97 #elif defined(BOOST_ASIO_HAS_DEV_POLL)
98 std::cout << "BOOST_ASIO_HAS_DEV_POLL" << std::endl;
99 #else
100 std::cout << "BOOST_ASIO_HAS_*** - using select()" << std::endl;
101 #endif
102
103 #else
104 std::cout << "ASIO_VERSION: " << ASIO_VERSION << std::endl;
105
106 #if defined(ASIO_HAS_IOCP)
107 std::cout << "ASIO_HAS_IOCP" << std::endl;
108 #elif defined(ASIO_HAS_EPOLL)
109 std::cout << "ASIO_HAS_EPOLL" << std::endl;
110 #elif defined(ASIO_HAS_KQUEUE)
111 std::cout << "ASIO_HAS_KQUEUE" << std::endl;
112 #elif defined(ASIO_HAS_DEV_POLL)
113 std::cout << "ASIO_HAS_DEV_POLL" << std::endl;
114 #else
115 std::cout << "ASIO_HAS_*** - using select()" << std::endl;
116 #endif
117
118 #endif
119
120 #ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
121 std::cout << "BOOST_SP_ENABLE_DEBUG_HOOKS" << std::endl;
122 #endif
123
124 std::cout << "RCF_MAX_METHOD_COUNT: " << RCF_MAX_METHOD_COUNT << std::endl;
125
126 #ifdef RCF_USE_SF_SERIALIZATION
127 std::cout << "RCF_USE_SF_SERIALIZATION" << std::endl;
128 #endif
129
130 #ifdef RCF_USE_BOOST_SERIALIZATION
131 std::cout << "RCF_USE_BOOST_SERIALIZATION" << std::endl;
132 #endif
133
134 #ifdef RCF_USE_BOOST_XML_SERIALIZATION
135 std::cout << "RCF_USE_BOOST_XML_SERIALIZATION" << std::endl;
136 #endif
137
138 std::cout << "RCF_FEATURE_ZLIB : " << RCF_FEATURE_ZLIB << std::endl;
139
140 std::cout << "RCF_FEATURE_OPENSSL : " << RCF_FEATURE_OPENSSL << std::endl;
141
142 std::cout << "RCF_FEATURE_FILETRANSFER : " << RCF_FEATURE_FILETRANSFER << std::endl;
143
144 std::cout << "RCF_FEATURE_JSON : " << RCF_FEATURE_JSON << std::endl;
145
146 std::cout << "RCF_FEATURE_IPV6 : " << RCF_FEATURE_IPV6 << std::endl;
147
148 std::cout << "RCF_FEATURE_PROTOBUF : " << RCF_FEATURE_PROTOBUF << std::endl;
149
150 std::cout << "RCF_FEATURE_CUSTOM_ALLOCATOR : " << RCF_FEATURE_CUSTOM_ALLOCATOR << std::endl;
151
152 std::cout << "*********************\n\n";
153 }
154
155 #ifdef _MSC_VER
156 #pragma warning( pop )
157 #endif
158
159
160 #endif // ! INCLUDE_RCF_TEST_PRINTTESTHEADER