Skip to content

Commit 880234d

Browse files
authored
Merge pull request #75 from CppCXY/refactor
Refactor
2 parents 9b5e762 + 926b833 commit 880234d

File tree

681 files changed

+111682
-23311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

681 files changed

+111682
-23311
lines changed

.clang-format

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Generated from CLion C/C++ Code Style settings
2+
BasedOnStyle: LLVM
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: Align
5+
AlignConsecutiveAssignments: None
6+
AlignOperands: Align
7+
AllowAllArgumentsOnNextLine: false
8+
AllowAllConstructorInitializersOnNextLine: false
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: Always
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: All
13+
AllowShortIfStatementsOnASingleLine: Always
14+
AllowShortLambdasOnASingleLine: All
15+
AllowShortLoopsOnASingleLine: true
16+
AlwaysBreakAfterReturnType: None
17+
AlwaysBreakTemplateDeclarations: Yes
18+
BreakBeforeBraces: Custom
19+
BraceWrapping:
20+
AfterCaseLabel: false
21+
AfterClass: false
22+
AfterControlStatement: Never
23+
AfterEnum: false
24+
AfterFunction: false
25+
AfterNamespace: false
26+
AfterUnion: false
27+
BeforeCatch: false
28+
BeforeElse: false
29+
IndentBraces: false
30+
SplitEmptyFunction: false
31+
SplitEmptyRecord: true
32+
BreakBeforeBinaryOperators: None
33+
BreakBeforeTernaryOperators: true
34+
BreakConstructorInitializers: BeforeColon
35+
BreakInheritanceList: BeforeColon
36+
ColumnLimit: 0
37+
CompactNamespaces: false
38+
ContinuationIndentWidth: 8
39+
IndentCaseLabels: true
40+
IndentPPDirectives: None
41+
IndentWidth: 4
42+
KeepEmptyLinesAtTheStartOfBlocks: true
43+
MaxEmptyLinesToKeep: 2
44+
NamespaceIndentation: None
45+
ObjCSpaceAfterProperty: false
46+
ObjCSpaceBeforeProtocolList: true
47+
PointerAlignment: Right
48+
ReflowComments: false
49+
SpaceAfterCStyleCast: true
50+
SpaceAfterLogicalNot: false
51+
SpaceAfterTemplateKeyword: false
52+
SpaceBeforeAssignmentOperators: true
53+
SpaceBeforeCpp11BracedList: false
54+
SpaceBeforeCtorInitializerColon: true
55+
SpaceBeforeInheritanceColon: true
56+
SpaceBeforeParens: ControlStatements
57+
SpaceBeforeRangeBasedForLoopColon: false
58+
SpaceInEmptyParentheses: false
59+
SpacesBeforeTrailingComments: 0
60+
SpacesInAngles: false
61+
SpacesInCStyleCastParentheses: false
62+
SpacesInContainerLiterals: false
63+
SpacesInParentheses: false
64+
SpacesInSquareBrackets: false
65+
TabWidth: 4
66+
UseTab: Never

.editorconfig

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
[*]
2-
3-
# ReSharper properties
4-
resharper_namespace_indentation=none
5-
indent_style=tab
6-
tab_width=4
7-
81
[*.yml]
92
indent_style = space
103
indent_size = 2
4+
5+
[*.txt]
6+
indent_style=tab
7+
tab_width=4

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@
3131
out
3232
3rd/uriparser/src/config.h
3333
.idea
34-
.vscode
34+
.lsp
35+
cmake-build-debug
36+
cmake-build-release
37+
cmake-build-debug-visual-studio
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Run manually to reformat a file:
2+
# clang-format -i --style=file <file>
3+
Language: Cpp
4+
BasedOnStyle: Google

3rd/googletest-1.12.1/.gitignore

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Ignore CI build directory
2+
build/
3+
xcuserdata
4+
cmake-build-debug/
5+
.idea/
6+
bazel-bin
7+
bazel-genfiles
8+
bazel-googletest
9+
bazel-out
10+
bazel-testlogs
11+
# python
12+
*.pyc
13+
14+
# Visual Studio files
15+
.vs
16+
*.sdf
17+
*.opensdf
18+
*.VC.opendb
19+
*.suo
20+
*.user
21+
_ReSharper.Caches/
22+
Win32-Debug/
23+
Win32-Release/
24+
x64-Debug/
25+
x64-Release/
26+
27+
# Ignore autoconf / automake files
28+
Makefile.in
29+
aclocal.m4
30+
configure
31+
build-aux/
32+
autom4te.cache/
33+
googletest/m4/libtool.m4
34+
googletest/m4/ltoptions.m4
35+
googletest/m4/ltsugar.m4
36+
googletest/m4/ltversion.m4
37+
googletest/m4/lt~obsolete.m4
38+
googlemock/m4
39+
40+
# Ignore generated directories.
41+
googlemock/fused-src/
42+
googletest/fused-src/
43+
44+
# macOS files
45+
.DS_Store
46+
googletest/.DS_Store
47+
googletest/xcode/.DS_Store
48+
49+
# Ignore cmake generated directories and files.
50+
CMakeFiles
51+
CTestTestfile.cmake
52+
Makefile
53+
cmake_install.cmake
54+
googlemock/CMakeFiles
55+
googlemock/CTestTestfile.cmake
56+
googlemock/Makefile
57+
googlemock/cmake_install.cmake
58+
googlemock/gtest
59+
/bin
60+
/googlemock/gmock.dir
61+
/googlemock/gmock_main.dir
62+
/googlemock/RUN_TESTS.vcxproj.filters
63+
/googlemock/RUN_TESTS.vcxproj
64+
/googlemock/INSTALL.vcxproj.filters
65+
/googlemock/INSTALL.vcxproj
66+
/googlemock/gmock_main.vcxproj.filters
67+
/googlemock/gmock_main.vcxproj
68+
/googlemock/gmock.vcxproj.filters
69+
/googlemock/gmock.vcxproj
70+
/googlemock/gmock.sln
71+
/googlemock/ALL_BUILD.vcxproj.filters
72+
/googlemock/ALL_BUILD.vcxproj
73+
/lib
74+
/Win32
75+
/ZERO_CHECK.vcxproj.filters
76+
/ZERO_CHECK.vcxproj
77+
/RUN_TESTS.vcxproj.filters
78+
/RUN_TESTS.vcxproj
79+
/INSTALL.vcxproj.filters
80+
/INSTALL.vcxproj
81+
/googletest-distribution.sln
82+
/CMakeCache.txt
83+
/ALL_BUILD.vcxproj.filters
84+
/ALL_BUILD.vcxproj

3rd/googletest-1.12.1/BUILD.bazel

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
# Copyright 2017 Google Inc.
2+
# All Rights Reserved.
3+
#
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions are
7+
# met:
8+
#
9+
# * Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
# * Redistributions in binary form must reproduce the above
12+
# copyright notice, this list of conditions and the following disclaimer
13+
# in the documentation and/or other materials provided with the
14+
# distribution.
15+
# * Neither the name of Google Inc. nor the names of its
16+
# contributors may be used to endorse or promote products derived from
17+
# this software without specific prior written permission.
18+
#
19+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
#
31+
# Bazel Build for Google C++ Testing Framework(Google Test)
32+
33+
package(default_visibility = ["//visibility:public"])
34+
35+
licenses(["notice"])
36+
37+
exports_files(["LICENSE"])
38+
39+
config_setting(
40+
name = "qnx",
41+
constraint_values = ["@platforms//os:qnx"],
42+
)
43+
44+
config_setting(
45+
name = "windows",
46+
constraint_values = ["@platforms//os:windows"],
47+
)
48+
49+
config_setting(
50+
name = "freebsd",
51+
constraint_values = ["@platforms//os:freebsd"],
52+
)
53+
54+
config_setting(
55+
name = "openbsd",
56+
constraint_values = ["@platforms//os:openbsd"],
57+
)
58+
59+
config_setting(
60+
name = "msvc_compiler",
61+
flag_values = {
62+
"@bazel_tools//tools/cpp:compiler": "msvc-cl",
63+
},
64+
visibility = [":__subpackages__"],
65+
)
66+
67+
config_setting(
68+
name = "has_absl",
69+
values = {"define": "absl=1"},
70+
)
71+
72+
# Library that defines the FRIEND_TEST macro.
73+
cc_library(
74+
name = "gtest_prod",
75+
hdrs = ["googletest/include/gtest/gtest_prod.h"],
76+
includes = ["googletest/include"],
77+
)
78+
79+
# Google Test including Google Mock
80+
cc_library(
81+
name = "gtest",
82+
srcs = glob(
83+
include = [
84+
"googletest/src/*.cc",
85+
"googletest/src/*.h",
86+
"googletest/include/gtest/**/*.h",
87+
"googlemock/src/*.cc",
88+
"googlemock/include/gmock/**/*.h",
89+
],
90+
exclude = [
91+
"googletest/src/gtest-all.cc",
92+
"googletest/src/gtest_main.cc",
93+
"googlemock/src/gmock-all.cc",
94+
"googlemock/src/gmock_main.cc",
95+
],
96+
),
97+
hdrs = glob([
98+
"googletest/include/gtest/*.h",
99+
"googlemock/include/gmock/*.h",
100+
]),
101+
copts = select({
102+
":qnx": [],
103+
":windows": [],
104+
"//conditions:default": ["-pthread"],
105+
}),
106+
defines = select({
107+
":has_absl": ["GTEST_HAS_ABSL=1"],
108+
"//conditions:default": [],
109+
}),
110+
features = select({
111+
":windows": ["windows_export_all_symbols"],
112+
"//conditions:default": [],
113+
}),
114+
includes = [
115+
"googlemock",
116+
"googlemock/include",
117+
"googletest",
118+
"googletest/include",
119+
],
120+
linkopts = select({
121+
":qnx": ["-lregex"],
122+
":windows": [],
123+
":freebsd": [
124+
"-lm",
125+
"-pthread",
126+
],
127+
":openbsd": [
128+
"-lm",
129+
"-pthread",
130+
],
131+
"//conditions:default": ["-pthread"],
132+
}),
133+
deps = select({
134+
":has_absl": [
135+
"@com_google_absl//absl/debugging:failure_signal_handler",
136+
"@com_google_absl//absl/debugging:stacktrace",
137+
"@com_google_absl//absl/debugging:symbolize",
138+
"@com_google_absl//absl/flags:flag",
139+
"@com_google_absl//absl/flags:parse",
140+
"@com_google_absl//absl/flags:reflection",
141+
"@com_google_absl//absl/flags:usage",
142+
"@com_google_absl//absl/strings",
143+
"@com_google_absl//absl/types:any",
144+
"@com_google_absl//absl/types:optional",
145+
"@com_google_absl//absl/types:variant",
146+
"@com_googlesource_code_re2//:re2",
147+
],
148+
"//conditions:default": [],
149+
}),
150+
)
151+
152+
cc_library(
153+
name = "gtest_main",
154+
srcs = ["googlemock/src/gmock_main.cc"],
155+
features = select({
156+
":windows": ["windows_export_all_symbols"],
157+
"//conditions:default": [],
158+
}),
159+
deps = [":gtest"],
160+
)
161+
162+
# The following rules build samples of how to use gTest.
163+
cc_library(
164+
name = "gtest_sample_lib",
165+
srcs = [
166+
"googletest/samples/sample1.cc",
167+
"googletest/samples/sample2.cc",
168+
"googletest/samples/sample4.cc",
169+
],
170+
hdrs = [
171+
"googletest/samples/prime_tables.h",
172+
"googletest/samples/sample1.h",
173+
"googletest/samples/sample2.h",
174+
"googletest/samples/sample3-inl.h",
175+
"googletest/samples/sample4.h",
176+
],
177+
features = select({
178+
":windows": ["windows_export_all_symbols"],
179+
"//conditions:default": [],
180+
}),
181+
)
182+
183+
cc_test(
184+
name = "gtest_samples",
185+
size = "small",
186+
# All Samples except:
187+
# sample9 (main)
188+
# sample10 (main and takes a command line option and needs to be separate)
189+
srcs = [
190+
"googletest/samples/sample1_unittest.cc",
191+
"googletest/samples/sample2_unittest.cc",
192+
"googletest/samples/sample3_unittest.cc",
193+
"googletest/samples/sample4_unittest.cc",
194+
"googletest/samples/sample5_unittest.cc",
195+
"googletest/samples/sample6_unittest.cc",
196+
"googletest/samples/sample7_unittest.cc",
197+
"googletest/samples/sample8_unittest.cc",
198+
],
199+
linkstatic = 0,
200+
deps = [
201+
"gtest_sample_lib",
202+
":gtest_main",
203+
],
204+
)
205+
206+
cc_test(
207+
name = "sample9_unittest",
208+
size = "small",
209+
srcs = ["googletest/samples/sample9_unittest.cc"],
210+
deps = [":gtest"],
211+
)
212+
213+
cc_test(
214+
name = "sample10_unittest",
215+
size = "small",
216+
srcs = ["googletest/samples/sample10_unittest.cc"],
217+
deps = [":gtest"],
218+
)

0 commit comments

Comments
 (0)