mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
update
This commit is contained in:
148
.clang-tidy
148
.clang-tidy
@@ -1,148 +0,0 @@
|
|||||||
# Generated from CLion Inspection settings
|
|
||||||
---
|
|
||||||
Checks: '-*,
|
|
||||||
bugprone-argument-comment,
|
|
||||||
bugprone-assert-side-effect,
|
|
||||||
bugprone-bad-signal-to-kill-thread,
|
|
||||||
bugprone-branch-clone,
|
|
||||||
bugprone-copy-constructor-init,
|
|
||||||
bugprone-dangling-handle,
|
|
||||||
bugprone-dynamic-static-initializers,
|
|
||||||
bugprone-fold-init-type,
|
|
||||||
bugprone-forward-declaration-namespace,
|
|
||||||
bugprone-forwarding-reference-overload,
|
|
||||||
bugprone-inaccurate-erase,
|
|
||||||
bugprone-incorrect-roundings,
|
|
||||||
bugprone-integer-division,
|
|
||||||
bugprone-lambda-function-name,
|
|
||||||
bugprone-macro-parentheses,
|
|
||||||
bugprone-macro-repeated-side-effects,
|
|
||||||
bugprone-misplaced-operator-in-strlen-in-alloc,
|
|
||||||
bugprone-misplaced-pointer-arithmetic-in-alloc,
|
|
||||||
bugprone-misplaced-widening-cast,
|
|
||||||
bugprone-move-forwarding-reference,
|
|
||||||
bugprone-multiple-statement-macro,
|
|
||||||
bugprone-no-escape,
|
|
||||||
bugprone-not-null-terminated-result,
|
|
||||||
bugprone-parent-virtual-call,
|
|
||||||
bugprone-posix-return,
|
|
||||||
bugprone-reserved-identifier,
|
|
||||||
bugprone-sizeof-container,
|
|
||||||
bugprone-sizeof-expression,
|
|
||||||
bugprone-spuriously-wake-up-functions,
|
|
||||||
bugprone-string-constructor,
|
|
||||||
bugprone-string-integer-assignment,
|
|
||||||
bugprone-string-literal-with-embedded-nul,
|
|
||||||
bugprone-suspicious-enum-usage,
|
|
||||||
bugprone-suspicious-include,
|
|
||||||
bugprone-suspicious-memset-usage,
|
|
||||||
bugprone-suspicious-missing-comma,
|
|
||||||
bugprone-suspicious-semicolon,
|
|
||||||
bugprone-suspicious-string-compare,
|
|
||||||
bugprone-suspicious-memory-comparison,
|
|
||||||
bugprone-suspicious-realloc-usage,
|
|
||||||
bugprone-swapped-arguments,
|
|
||||||
bugprone-terminating-continue,
|
|
||||||
bugprone-throw-keyword-missing,
|
|
||||||
bugprone-too-small-loop-variable,
|
|
||||||
bugprone-undefined-memory-manipulation,
|
|
||||||
bugprone-undelegated-constructor,
|
|
||||||
bugprone-unhandled-self-assignment,
|
|
||||||
bugprone-unused-raii,
|
|
||||||
bugprone-unused-return-value,
|
|
||||||
bugprone-use-after-move,
|
|
||||||
bugprone-virtual-near-miss,
|
|
||||||
cert-dcl21-cpp,
|
|
||||||
cert-dcl58-cpp,
|
|
||||||
cert-err34-c,
|
|
||||||
cert-err52-cpp,
|
|
||||||
cert-err60-cpp,
|
|
||||||
cert-flp30-c,
|
|
||||||
cert-msc50-cpp,
|
|
||||||
cert-msc51-cpp,
|
|
||||||
cert-str34-c,
|
|
||||||
cppcoreguidelines-interfaces-global-init,
|
|
||||||
cppcoreguidelines-narrowing-conversions,
|
|
||||||
cppcoreguidelines-pro-type-member-init,
|
|
||||||
cppcoreguidelines-pro-type-static-cast-downcast,
|
|
||||||
cppcoreguidelines-slicing,
|
|
||||||
google-default-arguments,
|
|
||||||
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,
|
|
||||||
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,
|
|
||||||
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-inconsistent-declaration-parameter-name,
|
|
||||||
readability-make-member-function-const,
|
|
||||||
readability-misleading-indentation,
|
|
||||||
readability-misplaced-array-index,
|
|
||||||
readability-non-const-parameter,
|
|
||||||
readability-redundant-control-flow,
|
|
||||||
readability-redundant-declaration,
|
|
||||||
readability-redundant-function-ptr-dereference,
|
|
||||||
readability-redundant-smartptr-get,
|
|
||||||
readability-redundant-string-cstr,
|
|
||||||
readability-redundant-string-init,
|
|
||||||
readability-simplify-subscript-expr,
|
|
||||||
readability-static-accessed-through-instance,
|
|
||||||
readability-static-definition-in-anonymous-namespace,
|
|
||||||
readability-string-compare,
|
|
||||||
readability-uniqueptr-delete-release,
|
|
||||||
readability-use-anyofallof'
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
/cmake-build/
|
/cmake-build/
|
||||||
|
/.idea
|
||||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "extlibs/googletest"]
|
||||||
|
path = extlibs/googletest
|
||||||
|
url = https://github.com/google/googletest.git
|
||||||
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
@@ -1,8 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
@@ -1,8 +1,16 @@
|
|||||||
cmake_minimum_required(VERSION 3.26)
|
cmake_minimum_required(VERSION 3.26)
|
||||||
set(CMAKE_CXX_STANDARD 26)
|
|
||||||
project(uml)
|
project(uml)
|
||||||
|
|
||||||
add_library(uml source/Vector3.cpp)
|
set(CMAKE_CXX_STANDARD 26)
|
||||||
add_subdirectory(source)
|
option(BUILD_TESTS "Build test programs" ON)
|
||||||
|
add_library(uml STATIC source/Vector3.cpp)
|
||||||
|
|
||||||
target_include_directories(uml PUBLIC include)
|
add_subdirectory(source)
|
||||||
|
add_subdirectory(extlibs)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
|
||||||
|
target_include_directories(uml PUBLIC include)
|
||||||
|
|
||||||
|
if (BUILD_TESTS)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
endif ()
|
||||||
@@ -2,17 +2,25 @@
|
|||||||
"version": 3,
|
"version": 3,
|
||||||
"configurePresets": [
|
"configurePresets": [
|
||||||
{
|
{
|
||||||
"name": "base",
|
"name": "windows-base",
|
||||||
"hidden": true,
|
"hidden": true,
|
||||||
|
"generator": "Ninja",
|
||||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
|
"CMAKE_C_COMPILER": "cl.exe",
|
||||||
|
"CMAKE_CXX_COMPILER": "cl.exe"
|
||||||
|
},
|
||||||
|
"condition": {
|
||||||
|
"type": "equals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "Windows"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "x64-debug",
|
"name": "x64-debug",
|
||||||
"displayName": "Debug",
|
"displayName": "x64 Debug",
|
||||||
"inherits": "base",
|
"inherits": "windows-base",
|
||||||
"architecture": {
|
"architecture": {
|
||||||
"value": "x64",
|
"value": "x64",
|
||||||
"strategy": "external"
|
"strategy": "external"
|
||||||
@@ -23,11 +31,63 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "x64-release",
|
"name": "x64-release",
|
||||||
"displayName": "Release",
|
"displayName": "x64 Release",
|
||||||
"inherits": "x64-debug",
|
"inherits": "x64-debug",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Release"
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x86-debug",
|
||||||
|
"displayName": "x86 Debug",
|
||||||
|
"inherits": "windows-base",
|
||||||
|
"architecture": {
|
||||||
|
"value": "x86",
|
||||||
|
"strategy": "external"
|
||||||
|
},
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x86-release",
|
||||||
|
"displayName": "x86 Release",
|
||||||
|
"inherits": "x86-debug",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "linux-base",
|
||||||
|
"hidden": true,
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||||
|
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_C_COMPILER": "gcc",
|
||||||
|
"CMAKE_CXX_COMPILER": "g++"
|
||||||
|
},
|
||||||
|
"condition": {
|
||||||
|
"type": "equals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "Linux"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "linux-debug",
|
||||||
|
"displayName": "Linux Debug",
|
||||||
|
"inherits": "linux-base",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "linux-release",
|
||||||
|
"displayName": "Linux Release",
|
||||||
|
"inherits": "linux-debug",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
1
extlibs/CMakeLists.txt
Normal file
1
extlibs/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
add_subdirectory(googletest)
|
||||||
1
extlibs/googletest
Submodule
1
extlibs/googletest
Submodule
Submodule extlibs/googletest added at d83fee138a
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
namespace uml
|
namespace uml
|
||||||
{
|
{
|
||||||
|
|||||||
9
tests/CMakeLists.txt
Normal file
9
tests/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
enable_testing()
|
||||||
|
|
||||||
|
project(unit-tests)
|
||||||
|
|
||||||
|
file(GLOB TEST_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||||
|
include(GoogleTest)
|
||||||
|
add_executable(unit-tests ${TEST_SRC_FILES})
|
||||||
|
target_link_libraries(unit-tests PRIVATE gtest gtest_main uml)
|
||||||
|
gtest_discover_tests(unit-tests)
|
||||||
0
tests/UnitTestColor.cpp
Normal file
0
tests/UnitTestColor.cpp
Normal file
Reference in New Issue
Block a user