Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test config #7

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:

env:
UBSAN_OPTIONS: print_stacktrace=1
ASAN_OPTIONS: print_stats=1:atexit=1
ASAN_OPTIONS: print_stats=1:atexit=1:detect_odr_violation=2

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:

env:
UBSAN_OPTIONS: print_stacktrace=1
ASAN_OPTIONS: print_stats=1:atexit=1
ASAN_OPTIONS: print_stats=1:atexit=1:detect_odr_violation=2

jobs:

Expand Down
70 changes: 20 additions & 50 deletions tests/.clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Generated from CLion Inspection settings
---
Checks: '-*,
clang-diagnostic-*,
llvm-*,
bugprone-argument-comment,
bugprone-assert-side-effect,
bugprone-bad-signal-to-kill-thread,
Expand Down Expand Up @@ -55,6 +57,7 @@ cert-dcl21-cpp,
cert-dcl58-cpp,
cert-err34-c,
cert-err52-cpp,
cert-err58-cpp,
cert-err60-cpp,
cert-flp30-c,
cert-msc50-cpp,
Expand All @@ -70,64 +73,32 @@ google-explicit-constructor,
google-runtime-operator,
hicpp-exception-baseclass,
hicpp-multiway-paths-covered,
misc-misplaced-const,
misc-new-delete-overloads,
misc-no-recursion,
misc-non-copyable-objects,
misc-throw-by-value-catch-by-reference,
misc-unconventional-assign-operator,
misc-uniqueptr-reset-release,
modernize-avoid-bind,
modernize-concat-nested-namespaces,
modernize-deprecated-headers,
modernize-deprecated-ios-base-aliases,
modernize-loop-convert,
modernize-make-shared,
modernize-make-unique,
modernize-pass-by-value,
modernize-raw-string-literal,
modernize-redundant-void-arg,
modernize-replace-auto-ptr,
modernize-replace-disallow-copy-and-assign-macro,
modernize-replace-random-shuffle,
modernize-return-braced-init-list,
modernize-shrink-to-fit,
modernize-unary-static-assert,
modernize-use-auto,
modernize-use-bool-literals,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-nodiscard,
modernize-use-noexcept,
modernize-use-nullptr,
modernize-use-override,
modernize-use-transparent-functors,
modernize-use-uncaught-exceptions,
misc-*,
-misc-const-correctness,
-misc-include-cleaner
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-misc-unused-parameters,
-misc-use-anonymous-namespace,
modernize-*,
-modernize-macro-to-enum,
-modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-default-member-init,
-modernize-use-using,
-modernize-use-trailing-return-type,
mpi-buffer-deref,
mpi-type-mismatch,
openmp-use-default-none,
performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
performance-no-automatic-move,
performance-noexcept-move-constructor,
performance-trivially-destructible,
performance-type-promotion-in-math-fn,
performance-unnecessary-copy-initialization,
performance-unnecessary-value-param,
performance-*,
portability-simd-intrinsics,
readability-avoid-const-params-in-decls,
readability-const-return-type,
readability-container-size-empty,
readability-convert-member-functions-to-static,
readability-delete-null-pointer,
readability-deleted-default,
readability-identifier-naming,
readability-inconsistent-declaration-parameter-name,
readability-make-member-function-const,
readability-misleading-indentation,
Expand All @@ -144,5 +115,4 @@ readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uniqueptr-delete-release,
readability-use-anyofallof,
cert-err58-cpp'
readability-use-anyofallof'
61 changes: 39 additions & 22 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,21 @@ endif()

set(LINK_THREADS_LIBRARY_MANUALLY False)

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Linux")

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck)
if (CMAKE_CXX_CPPCHECK)
set(CPPCHECK_EXITCODE_ON_ERROR 0)
list(APPEND
CMAKE_CXX_CPPCHECK
"--force"
"--template=gcc"
"--inline-suppr"
)
else()
message(WARNING "Could not find cppcheck")
endif()

find_program(LSB_RELEASE_EXEC lsb_release)
if (NOT LSB_RELEASE_EXEC)
message(WARNING "Could not get linux distro info, pthread linking on ubuntu 20 with g++ might be broken")
Expand All @@ -49,12 +63,30 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
list(GET LSB_DISTRIBUTOR_ID_AND_RELEASE_VERSION_SHORT 1 LSB_RELEASE_VERSION_SHORT)

string(TOLOWER "${LSB_DISTRIBUTOR_ID_SHORT}" LSB_DISTRIBUTOR_ID_SHORT)
if (LSB_DISTRIBUTOR_ID_SHORT STREQUAL "ubuntu" AND LSB_RELEASE_VERSION_SHORT VERSION_LESS_EQUAL "20.04")
set(LINK_THREADS_LIBRARY_MANUALLY True)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (LSB_DISTRIBUTOR_ID_SHORT STREQUAL "ubuntu" AND LSB_RELEASE_VERSION_SHORT VERSION_LESS_EQUAL "20.04")
set(LINK_THREADS_LIBRARY_MANUALLY True)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
endif()
endif()
if (CMAKE_CXX_CPPCHECK)
if (LSB_DISTRIBUTOR_ID_SHORT STREQUAL "ubuntu" AND LSB_RELEASE_VERSION_SHORT VERSION_GREATER_EQUAL "24.04")
set(CPPCHECK_EXITCODE_ON_ERROR 1)
list(APPEND
CMAKE_CXX_CPPCHECK
"--check-level=exhaustive"
)
endif()
endif()
endif()

if (CMAKE_CXX_CPPCHECK)
list(APPEND
CMAKE_CXX_CPPCHECK
"--error-exitcode=${CPPCHECK_EXITCODE_ON_ERROR}"
)
endif()
endif()

# Empty by default
Expand Down Expand Up @@ -96,6 +128,8 @@ function(configure_gcc_or_clang_gcc_options)
-Wswitch-default
-Wswitch-enum
-Wold-style-cast
-Wdeprecated
-Weffc++
-Werror
-pedantic-errors
)
Expand All @@ -114,7 +148,6 @@ function(configure_gcc_or_clang_gcc_options)
-Wlogical-op
-Wunsafe-loop-optimizations
-Wduplicated-cond
-Weffc++
-Wsign-promo
-fdiagnostics-color=always)
endif()
Expand All @@ -125,7 +158,6 @@ function(configure_gcc_or_clang_gcc_options)
-Wshift-overflow
-Wshift-sign-overflow
-Wshorten-64-to-32
-Wdeprecated-dynamic-exception-spec
-Wthread-safety
-fcolor-diagnostics
-fansi-escape-codes
Expand Down Expand Up @@ -268,21 +300,6 @@ function(manually_add_byte_order_to_cppcheck_arguments)
endfunction()


if (CMAKE_SYSTEM_NAME MATCHES "Linux")
find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck)
if (NOT CMAKE_CXX_CPPCHECK)
message(WARNING "Could not find cppcheck")
else()
list(APPEND
CMAKE_CXX_CPPCHECK
"--force"
"--template=gcc"
"--error-exitcode=0"
"--inline-suppr"
)
endif()
endif()

message(STATUS "+-")
message(STATUS "| TEST_COMPILE_DEFINITIONS = ${TEST_COMPILE_DEFINITIONS}")
message(STATUS "| TEST_COMPILE_OPTIONS = ${TEST_COMPILE_OPTIONS}")
Expand Down
Loading