-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathh2_unit.cpp
166 lines (152 loc) · 4.78 KB
/
h2_unit.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#include "h2_unit.hpp"
#include <cctype> /* tolower, isspace */
#include <cstdarg> /* va_list */
#include <errno.h> /* strerror */
#include <exception> /* std::exception */
#include <iostream> /* std::cout, std::streambuf */
#include <regex> /* std::regex */
#include <signal.h> /* sigaction */
#include <time.h> /* clock */
#include <typeinfo> /* std::typeid, std::type_info */
#if !defined _MSC_VER
#include <cxxabi.h> /* abi::__cxa_demangle, abi::__cxa_throw */
#endif
#if defined __linux || defined __APPLE__ // -MSVC -Cygwin -MinGW
#include <execinfo.h> /* backtrace, backtrace_symbols */
#endif
#if defined __GLIBC__
#include <malloc.h> /* __malloc_hook */
#endif
#if defined _WIN32 // +MinGW
#ifndef NOMINMAX // MinGW already defined
#define NOMINMAX // fix std::min/max conflict with windows::min/max
#endif
#include <winsock2.h> /* socket */
#include <windows.h>
#include <ws2tcpip.h> /* getaddrinfo */
#include <io.h> /* _write */
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define fileno _fileno
#define socklen_t int
#define ssize_t int
#endif
#if defined __CYGWIN__
#include <windows.h>
#endif
#if defined _WIN32 || defined __CYGWIN__ // +MinGW
#include <dbghelp.h> /* CaptureStackBackTrace, SymFromAddr */
#include <shlwapi.h> /* StrStrIA */
#define strcasestr StrStrIA
#endif
#if defined _MSC_VER
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "Shlwapi.lib")
#pragma comment(lib, "Dbghelp.lib")
#endif
#if defined __linux || defined __APPLE__ || defined __CYGWIN__
#include <arpa/inet.h> /* inet_addr, inet_pton */
#include <fcntl.h> /* fcntl */
#include <fnmatch.h> /* fnmatch */
#include <netdb.h> /* getaddrinfo, gethostbyname */
#include <sys/time.h> /* gettimeofday */
#include <sys/ioctl.h> /* ioctl */
#include <sys/mman.h> /* mprotect, mmap */
#include <sys/socket.h> /* sockaddr */
#include <sys/types.h> /* size_t */
#include <syslog.h> /* syslog, vsyslog */
#include <unistd.h> /* sysconf */
#endif
#if defined __APPLE__
#include <AvailabilityMacros.h>
#include <malloc/malloc.h> /* malloc_zone_t */
#endif
#if defined _WIN32 // +MinGW
#define LIBC__write ::_write
#else
#define LIBC__write ::write
#endif
#if defined _MSC_VER
#define h2_stdcall __stdcall
#else
#define h2_stdcall
#endif
#if defined _WIN32 || defined __CYGWIN__ // +MinGW
#if defined __H2UNIT_HPP__ || defined H2UNIT_IMPORT_MAIN
int main(int argc, const char** argv) { return h2::h2_runner::I().main(argc, argv); }
#else
int main(int argc, const char** argv);
#endif
#else
__attribute__((weak)) int main(int argc, const char** argv) { return h2::h2_runner::I().main(argc, argv); }
#endif
namespace h2 {
#include "utils/h2_list.cpp"
#include "utils/h2_pattern.cpp"
#include "utils/h2_diff.cpp"
#include "utils/h2_misc.cpp"
#include "utils/h2_libc.cpp"
#include "utils/h2_string.cpp"
#include "utils/h2_color.cpp"
#include "utils/h2_line.cpp"
#include "stdio/h2_console.cpp"
#include "stdio/h2_stdio.cpp"
#include "symbol/h2_nm.cpp"
#include "symbol/h2_load.cpp"
#include "symbol/h2_backtrace.cpp"
#include "symbol/h2_cxa.cpp"
#include "json/h2_tinyexpr.cpp"
#include "json/h2_node.cpp"
#include "json/h2_lexical.cpp"
#include "json/h2_syntax.cpp"
#include "json/h2_select.cpp"
#include "json/h2_tree.cpp"
#include "json/h2_match.cpp"
#include "json/h2_dual.cpp"
#include "json/h2_json.cpp"
#include "matcher/h2_matches_memcmp.cpp"
#include "matcher/h2_matches_strcmp.cpp"
#include "matcher/h2_matches_json.cpp"
#include "memory/h2_piece.cpp"
#include "memory/h2_leaky.cpp"
#include "memory/h2_block.cpp"
#include "memory/h2_stack.cpp"
#include "memory/h2_override.cpp"
#if defined __linux
#include "memory/platform/h2_override_linux.cpp"
#elif defined __APPLE__
#include "memory/platform/h2_override_macos.cpp"
#elif defined _MSC_VER
#include "memory/platform/h2_override_windows.cpp"
#else // +MinGW
#include "memory/platform/h2_override_cygwin.cpp"
#endif
#include "memory/h2_memory.cpp"
#include "memory/h2_exempt.cpp"
#include "except/h2_debug.cpp"
#include "except/h2_crash.cpp"
#include "except/h2_exception.cpp"
#include "stub/h2_e9.cpp"
#include "stub/h2_source.cpp"
#include "stub/h2_stubs.cpp"
#include "stub/h2_temporary.cpp"
#include "mock/h2_checkin.cpp"
#include "mock/h2_mocker.cpp"
#include "mock/h2_mocks.cpp"
#include "net/h2_dns.cpp"
#include "net/h2_socket.cpp"
#include "core/h2_test.cpp"
#include "core/h2_case.cpp"
#include "core/h2_suite.cpp"
#include "core/h2_filter.cpp"
#include "core/h2_runner.cpp"
#include "assert/h2_assert.cpp"
#include "assert/h2_timer.cpp"
#include "report/h2_layout.cpp"
#include "report/h2_failure.cpp"
#include "report/h2_report_console.cpp"
#include "report/h2_report_list.cpp"
#include "report/h2_report_junit.cpp"
#include "report/h2_report.cpp"
#include "option/h2_option.cpp"
}