Skip to content

Commit

Permalink
Initial Version of C++ VCD Tracer Library
Browse files Browse the repository at this point in the history
  • Loading branch information
nakane1chome committed Aug 6, 2022
1 parent 3725014 commit b8c5d14
Show file tree
Hide file tree
Showing 40 changed files with 38,724 additions and 1 deletion.
97 changes: 97 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyNamespace: false
SplitEmptyRecord: false
BreakAfterJavaFieldAnnotations: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakConstructorInitializersBeforeComma: true
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: true
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Priority: 2
Regex: ^"(llvm|llvm-c|clang|clang-c)/
- Priority: 3
Regex: ^(<|"(gtest|gmock|isl|json)/)
- Priority: 1
Regex: .*
IncludeIsMainRegex: (Test)?$
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
Language: Cpp
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
ObjCBlockIndentWidth: 7
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: false
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17
TabWidth: 4
UseTab: Never

5 changes: 5 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm*'
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
19 changes: 19 additions & 0 deletions .cmake-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
additional_commands:
foo:
flags:
- BAR
- BAZ
kwargs:
DEPENDS: '*'
HEADERS: '*'
SOURCES: '*'
bullet_char: '*'
dangle_parens: false
enum_char: .
line_ending: unix
line_width: 120
max_pargs_hwrap: 3
separate_ctrl_name_with_space: false
separate_fn_name_with_space: false
tab_size: 2

3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: nakane1chome
96 changes: 96 additions & 0 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: CMake

on:
pull_request:
push:
branches:
- main
- master

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
# Conan cache environment variables
CONAN_SYSREQUIRES_MODE: enabled
CONAN_USER_HOME: "${{ github.workspace }}/conan-cache"
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-cache/short"

# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
defaults:
run:
shell: bash

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
include:
- os: ubuntu-latest
ENABLE_COVERAGE: ON


steps:
- uses: actions/checkout@v2

- name: Cache
uses: actions/cache@v2
env:
cache-name: cache-conan-modules
with:
path: |
${{ env.CONAN_USER_HOME }}
~/.cache/pip
key: ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }}

- name: Install conan
run: |
pip3 install wheel setuptools gcovr
pip3 install conan --upgrade
- name: Install / Configure dependencies
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
echo "Ubuntu - Fix Conan Path"
sudo update-alternatives --install /usr/bin/conan conan /home/runner/.local/bin/conan 10
sudo update-alternatives --config conan
elif [ "$RUNNER_OS" == "Windows" ]; then
echo "Using chocolatey to install OpenCppCoverage"
choco install opencppcoverage
# Add to Path
echo "C:/Program Files/OpenCppCoverage" >> $GITHUB_PATH
fi;
- name: Configure CMake
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=$BUILD_TYPE -DENABLE_COVERAGE:BOOL=${{ matrix.ENABLE_COVERAGE }}
- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build ./build --config $BUILD_TYPE

- name: Unix - Test and coverage
if: runner.os != 'Windows'
working-directory: ./build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
ctest -C $BUILD_TYPE
gcovr -j $(nproc) --delete --root ../ --print-summary --xml-pretty --xml coverage.xml .
- name: Windows - Test and coverage
if: runner.os == 'Windows'
working-directory: ./build
run: |
OpenCppCoverage.exe --sources cpp_starter_project --export_type cobertura:coverage.xml --cover_children -- ctest -C $BUILD_TYPE
- name: Publish to codecov
uses: codecov/codecov-action@v2
with:
flags: ${{ runner.os }}
name: ${{ runner.os }}-coverage
files: ./build/coverage.xml
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Build directories and binary files
build/
build_clang/
build_cov
out/
cmake-build-*/

# IDE files
.vs/
.idea/
.vscode/
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.swp
*~
Testing/

.#*
coverage.xml

# OS Generated Files
.DS_Store
.AppleDouble
.LSOverride
._*
.Spotlight-V100
.Trashes
.Trash-*
$RECYCLE.BIN/
.TemporaryItems
ehthumbs.db
Thumbs.db
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "export/cpp-vcd-tracer"]
path = _export/cpp-vcd-tracer
url = [email protected]:nakane1chome/cpp-vcd-tracer.git
24 changes: 24 additions & 0 deletions .lgtm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# for full syntax documentation see: https://lgtm.com/help/lgtm/lgtm.yml-configuration-file
path_classifiers:
test:
- "*/fuzz_test/**/*"
- "*/test/**/*"
extraction:
cpp:
prepare:
packages:
- g++-10
- ccache
script:
- mkdir ~/.conan
- cat /usr/local/share/ca-certificates/semmle-cache-ca/semmle-cache-ca.crt >> ~/.conan/cacert.pem
- python3 -m pip install --upgrade pip setuptools
- python3 -m pip install conan
- python3 -m pip install cmake
- source ~/.profile
configure:
command:
- mkdir build
- cmake -D ENABLE_COVERAGE:BOOL=TRUE -S . -B build
index:
build_command: cmake --build ./build -- -j2
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"configurations": [
{
g "name": "(gdb) Launch Tests",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/test/tests",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Enable all-exceptions",
"text": "catch throw",
"ignoreFailures": true
}
]
}
]
}
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "test",
"type" : "shell",
"command" : "${workspaceRoot}/build/test/tests",
"presentation" : { "reveal": "always" },
}
]
}
Loading

0 comments on commit b8c5d14

Please sign in to comment.