Skip to content

Commit 64c67dc

Browse files
committed
Initial commit
0 parents  commit 64c67dc

Some content is hidden

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

55 files changed

+10006
-0
lines changed

.clang-format

+226
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: Google
4+
AccessModifierOffset: -1
5+
AlignAfterOpenBracket: Align
6+
AlignArrayOfStructures: None
7+
AlignConsecutiveMacros: None
8+
AlignConsecutiveAssignments: None
9+
AlignConsecutiveBitFields: None
10+
AlignConsecutiveDeclarations: None
11+
AlignEscapedNewlines: Left
12+
AlignOperands: Align
13+
AlignTrailingComments: true
14+
AllowAllArgumentsOnNextLine: true
15+
AllowAllParametersOfDeclarationOnNextLine: true
16+
AllowShortEnumsOnASingleLine: true
17+
AllowShortBlocksOnASingleLine: Never
18+
AllowShortCaseLabelsOnASingleLine: false
19+
AllowShortFunctionsOnASingleLine: All
20+
AllowShortLambdasOnASingleLine: All
21+
AllowShortIfStatementsOnASingleLine: WithoutElse
22+
AllowShortLoopsOnASingleLine: true
23+
AlwaysBreakAfterDefinitionReturnType: None
24+
AlwaysBreakAfterReturnType: None
25+
AlwaysBreakBeforeMultilineStrings: true
26+
AlwaysBreakTemplateDeclarations: Yes
27+
AttributeMacros:
28+
- __capability
29+
BinPackArguments: true
30+
BinPackParameters: true
31+
BraceWrapping:
32+
AfterCaseLabel: false
33+
AfterClass: false
34+
AfterControlStatement: Never
35+
AfterEnum: false
36+
AfterFunction: false
37+
AfterNamespace: false
38+
AfterObjCDeclaration: false
39+
AfterStruct: false
40+
AfterUnion: false
41+
AfterExternBlock: false
42+
BeforeCatch: false
43+
BeforeElse: false
44+
BeforeLambdaBody: false
45+
BeforeWhile: false
46+
IndentBraces: false
47+
SplitEmptyFunction: true
48+
SplitEmptyRecord: true
49+
SplitEmptyNamespace: true
50+
BreakBeforeBinaryOperators: None
51+
BreakBeforeConceptDeclarations: true
52+
BreakBeforeBraces: Attach
53+
BreakBeforeInheritanceComma: false
54+
BreakInheritanceList: BeforeColon
55+
BreakBeforeTernaryOperators: true
56+
BreakConstructorInitializersBeforeComma: false
57+
BreakConstructorInitializers: BeforeColon
58+
BreakAfterJavaFieldAnnotations: false
59+
BreakStringLiterals: true
60+
ColumnLimit: 100
61+
CommentPragmas: '^ IWYU pragma:'
62+
QualifierAlignment: Leave
63+
CompactNamespaces: false
64+
ConstructorInitializerIndentWidth: 4
65+
ContinuationIndentWidth: 4
66+
Cpp11BracedListStyle: true
67+
DeriveLineEnding: true
68+
DerivePointerAlignment: true
69+
DisableFormat: false
70+
EmptyLineAfterAccessModifier: Never
71+
EmptyLineBeforeAccessModifier: LogicalBlock
72+
ExperimentalAutoDetectBinPacking: false
73+
PackConstructorInitializers: NextLine
74+
BasedOnStyle: ''
75+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
76+
AllowAllConstructorInitializersOnNextLine: true
77+
FixNamespaceComments: true
78+
ForEachMacros:
79+
- foreach
80+
- Q_FOREACH
81+
- BOOST_FOREACH
82+
IfMacros:
83+
- KJ_IF_MAYBE
84+
IncludeBlocks: Regroup
85+
IncludeCategories:
86+
- Regex: '^<ext/.*\.h>'
87+
Priority: 2
88+
SortPriority: 0
89+
CaseSensitive: false
90+
- Regex: '^<.*\.h>'
91+
Priority: 1
92+
SortPriority: 0
93+
CaseSensitive: false
94+
- Regex: '^<.*'
95+
Priority: 2
96+
SortPriority: 0
97+
CaseSensitive: false
98+
- Regex: '.*'
99+
Priority: 3
100+
SortPriority: 0
101+
CaseSensitive: false
102+
IncludeIsMainRegex: '([-_](test|unittest))?$'
103+
IncludeIsMainSourceRegex: ''
104+
IndentAccessModifiers: false
105+
IndentCaseLabels: true
106+
IndentCaseBlocks: false
107+
IndentGotoLabels: true
108+
IndentPPDirectives: None
109+
IndentExternBlock: AfterExternBlock
110+
IndentRequires: false
111+
IndentWidth: 2
112+
IndentWrappedFunctionNames: false
113+
InsertTrailingCommas: None
114+
JavaScriptQuotes: Leave
115+
JavaScriptWrapImports: true
116+
KeepEmptyLinesAtTheStartOfBlocks: false
117+
LambdaBodyIndentation: Signature
118+
MacroBlockBegin: ''
119+
MacroBlockEnd: ''
120+
MaxEmptyLinesToKeep: 1
121+
NamespaceIndentation: None
122+
ObjCBinPackProtocolList: Never
123+
ObjCBlockIndentWidth: 2
124+
ObjCBreakBeforeNestedBlockParam: true
125+
ObjCSpaceAfterProperty: false
126+
ObjCSpaceBeforeProtocolList: true
127+
PenaltyBreakAssignment: 2
128+
PenaltyBreakBeforeFirstCallParameter: 1
129+
PenaltyBreakComment: 300
130+
PenaltyBreakFirstLessLess: 120
131+
PenaltyBreakOpenParenthesis: 0
132+
PenaltyBreakString: 1000
133+
PenaltyBreakTemplateDeclaration: 10
134+
PenaltyExcessCharacter: 1000000
135+
PenaltyReturnTypeOnItsOwnLine: 200
136+
PenaltyIndentedWhitespace: 0
137+
PointerAlignment: Left
138+
PPIndentWidth: -1
139+
RawStringFormats:
140+
- Language: Cpp
141+
Delimiters:
142+
- cc
143+
- CC
144+
- cpp
145+
- Cpp
146+
- CPP
147+
- 'c++'
148+
- 'C++'
149+
CanonicalDelimiter: ''
150+
BasedOnStyle: google
151+
- Language: TextProto
152+
Delimiters:
153+
- pb
154+
- PB
155+
- proto
156+
- PROTO
157+
EnclosingFunctions:
158+
- EqualsProto
159+
- EquivToProto
160+
- PARSE_PARTIAL_TEXT_PROTO
161+
- PARSE_TEST_PROTO
162+
- PARSE_TEXT_PROTO
163+
- ParseTextOrDie
164+
- ParseTextProtoOrDie
165+
- ParseTestProto
166+
- ParsePartialTestProto
167+
CanonicalDelimiter: pb
168+
BasedOnStyle: google
169+
ReferenceAlignment: Pointer
170+
ReflowComments: true
171+
RemoveBracesLLVM: false
172+
SeparateDefinitionBlocks: Leave
173+
ShortNamespaceLines: 1
174+
SortIncludes: CaseSensitive
175+
SortJavaStaticImport: Before
176+
SortUsingDeclarations: true
177+
SpaceAfterCStyleCast: false
178+
SpaceAfterLogicalNot: false
179+
SpaceAfterTemplateKeyword: true
180+
SpaceBeforeAssignmentOperators: true
181+
SpaceBeforeCaseColon: false
182+
SpaceBeforeCpp11BracedList: false
183+
SpaceBeforeCtorInitializerColon: true
184+
SpaceBeforeInheritanceColon: true
185+
SpaceBeforeParens: ControlStatements
186+
SpaceBeforeParensOptions:
187+
AfterControlStatements: true
188+
AfterForeachMacros: true
189+
AfterFunctionDefinitionName: false
190+
AfterFunctionDeclarationName: false
191+
AfterIfMacros: true
192+
AfterOverloadedOperator: false
193+
BeforeNonEmptyParentheses: false
194+
SpaceAroundPointerQualifiers: Default
195+
SpaceBeforeRangeBasedForLoopColon: true
196+
SpaceInEmptyBlock: false
197+
SpaceInEmptyParentheses: false
198+
SpacesBeforeTrailingComments: 2
199+
SpacesInAngles: Never
200+
SpacesInConditionalStatement: false
201+
SpacesInContainerLiterals: true
202+
SpacesInCStyleCastParentheses: false
203+
SpacesInLineCommentPrefix:
204+
Minimum: 1
205+
Maximum: -1
206+
SpacesInParentheses: false
207+
SpacesInSquareBrackets: false
208+
SpaceBeforeSquareBrackets: false
209+
BitFieldColonSpacing: Both
210+
Standard: Auto
211+
StatementAttributeLikeMacros:
212+
- Q_EMIT
213+
StatementMacros:
214+
- Q_UNUSED
215+
- QT_REQUIRE_VERSION
216+
TabWidth: 8
217+
UseCRLF: false
218+
UseTab: Never
219+
WhitespaceSensitiveMacros:
220+
- STRINGIZE
221+
- PP_STRINGIZE
222+
- BOOST_PP_STRINGIZE
223+
- NS_SWIFT_NAME
224+
- CF_SWIFT_NAME
225+
...
226+

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.{cmd,[cC][mM][dD]} text eol=crlf
3+
*.{bat,[bB][aA][tT]} text eol=crlf

.github/workflows/add_build.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: address sanitizer
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# Step 1: Checkout the code from the repository
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
# Step 2: Add LLVM repository and install Clang 17 and libc++
19+
- name: Install Clang 17 and libc++ from LLVM repo
20+
run: |
21+
sudo apt update
22+
sudo apt install -y wget lsb-release software-properties-common
23+
# Add the official LLVM repository
24+
wget https://apt.llvm.org/llvm.sh
25+
chmod +x llvm.sh
26+
sudo ./llvm.sh 17
27+
sudo apt install -y libc++-17-dev libc++abi-17-dev libomp-17-dev
28+
29+
# Step 3: Set Clang 17 as the default compiler and use libc++
30+
- name: Set Clang 17 as default for both clang and clang++
31+
run: |
32+
# Set clang and clang++ to Clang 17
33+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 100
34+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 100
35+
sudo update-alternatives --set clang /usr/bin/clang-17
36+
sudo update-alternatives --set clang++ /usr/bin/clang++-17
37+
38+
# Verify the correct versions are set
39+
clang --version
40+
clang++ --version
41+
42+
# Step 4: Create a build directory and build the project with Clang and libc++
43+
- name: Build project with Clang 17 and libc++
44+
run: |
45+
mkdir -p build
46+
cd build
47+
cmake .. -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
48+
make
49+
50+
# Step 5: Run tests with CTest
51+
- name: Run tests
52+
run: |
53+
cd build/tests
54+
./coros_test
55+

.github/workflows/clang_test.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Clang 17
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# Step 1: Checkout the code from the repository
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
# Step 2: Add LLVM repository and install Clang 17 and libc++
19+
- name: Install Clang 17 and libc++ from LLVM repo
20+
run: |
21+
sudo apt update
22+
sudo apt install -y wget lsb-release software-properties-common
23+
# Add the official LLVM repository
24+
wget https://apt.llvm.org/llvm.sh
25+
chmod +x llvm.sh
26+
sudo ./llvm.sh 17
27+
sudo apt install -y libc++-17-dev libc++abi-17-dev libomp-17-dev
28+
29+
# Step 3: Set Clang 17 as the default compiler and use libc++
30+
- name: Set Clang 17 as default for both clang and clang++
31+
run: |
32+
# Set clang and clang++ to Clang 17
33+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 100
34+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 100
35+
sudo update-alternatives --set clang /usr/bin/clang-17
36+
sudo update-alternatives --set clang++ /usr/bin/clang++-17
37+
38+
# Verify the correct versions are set
39+
clang --version
40+
clang++ --version
41+
42+
# Step 4: Create a build directory and build the project with Clang and libc++
43+
- name: Build project with Clang 17 and libc++
44+
run: |
45+
mkdir -p build
46+
cd build
47+
cmake .. -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
48+
make
49+
50+
# Step 5: Run tests with CTest
51+
- name: Run tests
52+
run: |
53+
cd build/tests
54+
./coros_test
55+

.github/workflows/gcc_test.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: GCC 13
2+
3+
# Trigger the workflow on push or pull request to the main branch
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest # Use the latest Ubuntu environment
15+
16+
steps:
17+
# Step 1: Checkout the code from the repository
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
# Step 2: Install GCC 13 and CMake
22+
- name: Install GCC 13 and CMake
23+
run: |
24+
sudo apt update
25+
sudo apt install -y software-properties-common
26+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
27+
sudo apt update
28+
sudo apt install -y gcc-13 g++-13 cmake
29+
30+
# Step 3: Set GCC 13 as the default compiler
31+
- name: Set GCC 13 as default
32+
run: |
33+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
34+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
35+
36+
# Step 4: Create a build directory and build the project with CMake
37+
- name: Build project
38+
run: |
39+
mkdir -p build
40+
cd build
41+
cmake ..
42+
make
43+
44+
- name: Run tests
45+
run: |
46+
cd build/tests
47+
./coros_test
48+
49+
50+

0 commit comments

Comments
 (0)