Skip to content

Commit

Permalink
Version update (#3)
Browse files Browse the repository at this point in the history
Update the repo for 2022,  add a number of tests, fix clang-tidy issues and add a move to the DelayedObjects objects.  Update formatting, and add precommit
  • Loading branch information
phlptp authored Sep 24, 2022
1 parent 1ffdb2b commit 0783d98
Show file tree
Hide file tree
Showing 79 changed files with 5,697 additions and 4,317 deletions.
1 change: 0 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ build_script:
test_script:
- cd build
- ps: ctest --output-on-failure -C Debug

11 changes: 11 additions & 0 deletions .ci/azure-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
steps:
- task: CMake@1
inputs:
cmakeArgs: .. -DCMAKE_CXX_STANDARD=$(concurrency.std) -DCMAKE_BUILD_TYPE=$(concurrency.build_type) $(concurrency.options)
displayName: "Configure"
env:
GIT_SSL_NO_VERIFY: 1

- script: cmake --build .
displayName: "Build"
workingDirectory: build
15 changes: 15 additions & 0 deletions .ci/azure-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
# Note that silkeh/clang does not include ca-certificates, so check the shasum for verification
- bash: |
wget --no-check-certificate "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz"
echo "29faa62fb3a0b6323caa3d9557e1a5f1205614c0d4c5c2a9917f16a74f7eff68 cmake-3.14.3-Linux-x86_64.tar.gz" | shasum -sca 256
displayName: Download CMake
- task: ExtractFiles@1
inputs:
archiveFilePatterns: "cmake*.tar.gz"
destinationFolder: "cmake_program"
displayName: Extract CMake

- bash: echo "##vso[task.prependpath]$(Build.SourcesDirectory)/cmake_program/cmake-3.14.3-Linux-x86_64/bin"
displayName: Add CMake to PATH
18 changes: 0 additions & 18 deletions .ci/azure-steps.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .ci/azure-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
steps:
- script: ctest --output-on-failure -C $(concurrency.build_type) -T test
displayName: "Test"
workingDirectory: build

- task: PublishTestResults@2
inputs:
testResultsFormat: "cTest"
testResultsFiles: "**/Test.xml"
4 changes: 2 additions & 2 deletions .ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# must be installed.
# - Doxygen configuration file must have the destination directory empty and
# source code directory with a $(TRAVIS_BUILD_DIR) prefix.
# - An gh-pages branch should already exist. See below for mor info on hoe to
# - An gh-pages branch should already exist. See below for more info on how to
# create a gh-pages branch.
#
# Required global variables:
Expand Down Expand Up @@ -95,7 +95,7 @@ if [ -d "html" ] && [ -f "html/index.html" ]; then
git commit -m "Deploy code docs to GitHub Pages Travis build: ${TRAVIS_BUILD_NUMBER}" -m "Commit: ${TRAVIS_COMMIT}"

# Force push to the remote gh-pages branch.
# The ouput is redirected to /dev/null to hide any sensitive credential data
# The output is redirected to /dev/null to hide any sensitive credential data
# that might otherwise be exposed.
git push --force "https://${GH_REPO_TOKEN}@${GH_REPO_REF}" > /dev/null 2>&1
else
Expand Down
1 change: 0 additions & 1 deletion .ci/build_doxygen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ export PATH="${DEPS_DIR}/doxygen/build/bin:${PATH}"
cd "${TRAVIS_BUILD_DIR}"

set +evx

20 changes: 16 additions & 4 deletions .ci/tsan-cache.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
set(CMAKE_C_FLAGS "-fsanitize=thread,undefined -g -O1 -stdlib=libc++" CACHE STRING "Flags used by the compiler during all build types.")
set(CMAKE_CXX_FLAGS "-fsanitize=thread,undefined -g -O1 -stdlib=libc++" CACHE STRING "Flags used by the compiler during all build types.")
set(CMAKE_EXE_LINKER_FLAGS "-fsanitize=thread,undefined -stdlib=libc++" CACHE STRING "Flags used by the linker during all build types.")
set(CMAKE_MODULE_LINKER_FLAGS "-fsanitize=thread,undefined -stdlib=libc++" CACHE STRING "Flags used by the linker during all build types.")
set(CMAKE_C_FLAGS
"-fsanitize=thread,undefined -g -O1 -stdlib=libc++"
CACHE STRING "Flags used by the compiler during all build types."
)
set(CMAKE_CXX_FLAGS
"-fsanitize=thread,undefined -g -O1 -stdlib=libc++"
CACHE STRING "Flags used by the compiler during all build types."
)
set(CMAKE_EXE_LINKER_FLAGS
"-fsanitize=thread,undefined -stdlib=libc++"
CACHE STRING "Flags used by the linker during all build types."
)
set(CMAKE_MODULE_LINKER_FLAGS
"-fsanitize=thread,undefined -stdlib=libc++"
CACHE STRING "Flags used by the linker during all build types."
)
22 changes: 22 additions & 0 deletions .circleci/asan_suppression.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Lines starting with # are ignored.
# Turn off checks for the source file (use absolute path or path relative
# to the current working directory):
src:*functional.cpp
# Turn off checks for a particular functions (use mangled names):
#fun:MyFooBar
#fun:_Z8MyFooBarv
# Extended regular expressions are supported:
#fun:bad_(foo|bar)
#src:bad_source[1-9].c
# Shell like usage of * is supported (* is treated as .*):
#src:bad/sources/*
#fun:*BadFunction*
# Specific sanitizer tools may introduce categories.
#src:/special/path/*=special_sources
# Sections can be used to limit ignorelist entries to specific sanitizers
#[address]
#fun:*BadASanFunc*
# Section names are regular expressions
#[cfi-vcall|cfi-icall]
#fun:*BadCfiCall
# Entries without sections are placed into [*] and apply to all sanitizers
35 changes: 22 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: 2
aliases:

- &run_concurrency
name: run_concurrency
environment:
Expand All @@ -9,38 +8,49 @@ aliases:
cd build
eval cmake .. ${CMAKE_FLAGS}
make -j 4
ctest --output-on-failure
ctest --verbose
jobs:
concurrencygccTSan:
docker:
- image: helics/buildenv:gcc12-builder
environment:
CMAKE_FLAGS: '-DCMAKE_CXX_FLAGS="-fsanitize=thread -g -O1 " '
TSAN_OPTIONS: "second_deadlock_stack=1 suppressions=/root/project/.circleci/tsan_suppression.txt history_size=4"

steps:
- checkout
- run: *run_concurrency

concurrencyTSan:
docker:
- image: helics/buildenv:builder
- image: helics/buildenv:sanitizers-14
environment:
CMAKE_FLAGS: '-DCMAKE_CXX_FLAGS="-fsanitize=thread -g -O1 "'
TSAN_OPTIONS: 'second_deadlock_stack=1'
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=thread -nostdinc++ -nostdlib++ -L/root/develop/libcxx_tsan/lib -lc++ -lc++abi -I/root/develop/libcxx_tsan/include -I/root/develop/libcxx_tsan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O2 -Wl,-rpath,/root/develop/libcxx_tsan/lib" '
TSAN_OPTIONS: "suppressions=/root/project/.circleci/tsan_suppression.txt"

steps:
- checkout
- run: *run_concurrency

concurrencyASan:
docker:
- image: helics/buildenv:sanitizers
- image: helics/buildenv:sanitizers-14
environment:
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=undefined,address -fsanitize-address-use-after-scope -stdlib=libc++ -L/root/develop/libcxx_asan/lib -lc++abi -I/root/develop/libcxx_asan/include -I/root/develop/libcxx_asan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -Wl,-rpath=/root/develop/libcxx_asan/lib -fsanitize-blacklist=/root/project/.circleci/asan_blacklist.txt" '
LSAN_OPTIONS: 'suppressions=/root/project/.circleci/leak_suppression.txt'
UBSAN_OPTIONS: 'print_stacktrace=1'
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=undefined,address -lc++ -lc++abi -fsanitize-address-use-after-scope -fsanitize-ignorelist=/root/project/.circleci/asan_suppression.txt -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -fsanitize-blacklist=/root/project/.circleci/asan_blacklist.txt" '
LSAN_OPTIONS: "suppressions=/root/project/.circleci/leak_suppression.txt"
UBSAN_OPTIONS: "print_stacktrace=1"
ASAN_OPTIONS: "alloc_dealloc_mismatch=0"

steps:
- checkout
- run: *run_concurrency

concurrencyMSan:
docker:
- image: helics/buildenv:sanitizers
- image: helics/buildenv:sanitizers-14
environment:
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=memory -stdlib=libc++ -L/root/develop/libcxx_msan/lib -lc++abi -I/root/develop/libcxx_msan/include -I/root/develop/libcxx_msan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -Wl,-rpath=/root/develop/libcxx_msan/lib" '
CMAKE_FLAGS: '-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_FLAGS="-fsanitize=memory -nostdinc++ -nostdlib++ -L/root/develop/libcxx_msan/lib -lc++ -lc++abi -I/root/develop/libcxx_msan/include -I/root/develop/libcxx_msan/include/c++/v1 -Wno-unused-command-line-argument -fno-omit-frame-pointer -g -O1 -Wl,-rpath,/root/develop/libcxx_msan/lib" '

steps:
- checkout
Expand All @@ -53,5 +63,4 @@ workflows:
- concurrencyMSan
- concurrencyASan
- concurrencyTSan


- concurrencygccTSan
4 changes: 4 additions & 0 deletions .circleci/tsan_suppression.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This is a known purposeful leak and possible resulting race condition detection on closing of shared libraries

# potential race condition from
race:cxa_at_exit_wrapper
118 changes: 58 additions & 60 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,82 +1,80 @@
---
AccessModifierOffset: '-2'
---
AccessModifierOffset: "-2"
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignConsecutiveAssignments: "false"
AlignConsecutiveDeclarations: "false"
#AlignConsecutiveMacros: 'true'
AlignEscapedNewlines: Right
AlignOperands: 'false'
AlignTrailingComments: 'false'
AlignOperands: "false"
AlignTrailingComments: "false"
#AllowAllArgumentsOnNextLine: 'false'
#AllowAllConstructorInitializersOnNextLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: "false"
AllowShortBlocksOnASingleLine: "false"
AllowShortCaseLabelsOnASingleLine: "false"
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: 'true'
AllowShortIfStatementsOnASingleLine: "true"
#AllowShortLambdasOnASingleLine: 'Inline'
AllowShortLoopsOnASingleLine: 'false'
AllowShortLoopsOnASingleLine: "false"
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false'
AlwaysBreakTemplateDeclarations: 'true'
BinPackArguments: 'false'
BinPackParameters: 'false'
AlwaysBreakBeforeMultilineStrings: "false"
AlwaysBreakTemplateDeclarations: "true"
BinPackArguments: "false"
BinPackParameters: "false"
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
BeforeCatch: true
BreakBeforeTernaryOperators: 'false'
BreakBeforeTernaryOperators: "false"
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: 'false'
ColumnLimit: 100
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'false'
ConstructorInitializerIndentWidth: '4'
ContinuationIndentWidth: '4'
Cpp11BracedListStyle: 'true'
DerivePointerAlignment: 'false'
DisableFormat: 'false'
FixNamespaceComments: 'true'
IncludeBlocks: Regroup
IndentCaseLabels: 'true'
IndentPPDirectives: AfterHash
IndentWidth: '4'
IndentWrappedFunctionNames: 'true'
#BreakInheritanceList: AfterColon
BreakStringLiterals: "false"
ColumnLimit: 80
CompactNamespaces: "false"
ConstructorInitializerAllOnOneLineOrOnePerLine: "false"
ConstructorInitializerIndentWidth: "4"
ContinuationIndentWidth: "4"
Cpp11BracedListStyle: "true"
DerivePointerAlignment: "false"
DisableFormat: "false"
FixNamespaceComments: "true"
#IncludeBlocks: Regroup
IndentCaseLabels: "true"
IndentWidth: "4"
IndentWrappedFunctionNames: "true"
JavaScriptQuotes: Double
KeepEmptyLinesAtTheStartOfBlocks: 'false'
KeepEmptyLinesAtTheStartOfBlocks: "false"
Language: Cpp
MaxEmptyLinesToKeep: '1'
MaxEmptyLinesToKeep: "1"
NamespaceIndentation: Inner
ObjCSpaceAfterProperty: 'true'
ObjCSpaceBeforeProtocolList: 'true'
PenaltyBreakBeforeFirstCallParameter: '120'
PenaltyBreakComment: '300'
PenaltyBreakFirstLessLess: '30'
PenaltyBreakString: '1000'
PenaltyExcessCharacter: '1000000'
PenaltyReturnTypeOnItsOwnLine: '40'
ObjCSpaceAfterProperty: "true"
ObjCSpaceBeforeProtocolList: "true"
PenaltyBreakBeforeFirstCallParameter: "90"
PenaltyBreakComment: "100"
PenaltyBreakFirstLessLess: "30"
PenaltyBreakString: "1000"
PenaltyExcessCharacter: "1000000"
PenaltyReturnTypeOnItsOwnLine: "40"
PointerAlignment: Left
ReflowComments: 'false'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'false'
ReflowComments: "true"
SortIncludes: "true"
SortUsingDeclarations: "true"
SpaceAfterCStyleCast: "false"
#SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'false'
SpaceBeforeCtorInitializerColon: 'false'
SpaceBeforeInheritanceColon: 'false'
SpaceAfterTemplateKeyword: "false"
SpaceBeforeAssignmentOperators: "true"
#SpaceBeforeCpp11BracedList: 'false'
#SpaceBeforeCtorInitializerColon: 'false'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: '1'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
#SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: "false"
SpacesBeforeTrailingComments: "2"
SpacesInAngles: "false"
SpacesInCStyleCastParentheses: "false"
SpacesInContainerLiterals: "false"
SpacesInParentheses: "false"
SpacesInSquareBrackets: "false"
Standard: Cpp11
TabWidth: '4'
TabWidth: "4"
UseTab: Never
Loading

0 comments on commit 0783d98

Please sign in to comment.