Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cppinttest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cppinttest
Commits
306b6c2c
Verified
Commit
306b6c2c
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: set version to 0.0.12
parent
a700a514
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!9
F consolidation
,
!7
ENH: Add test for extended extern C interface
Pipeline
#12111
passed
3 years ago
Stage: info
Stage: setup
Stage: build
Stage: test
Changes
4
Pipelines
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
conanfile.txt
+1
-1
1 addition, 1 deletion
conanfile.txt
test/CMakeLists.txt.orig
+125
-0
125 additions, 0 deletions
test/CMakeLists.txt.orig
test/test_transaction.cpp
+0
-1
0 additions, 1 deletion
test/test_transaction.cpp
test/test_transaction.cpp.orig
+855
-0
855 additions, 0 deletions
test/test_transaction.cpp.orig
with
981 additions
and
2 deletions
conanfile.txt
+
1
−
1
View file @
306b6c2c
[requires]
caosdb/0.0.1
1
caosdb/0.0.1
2
gtest/1.11.0
[generators]
...
...
This diff is collapsed.
Click to expand it.
test/CMakeLists.txt.orig
0 → 100644
+
125
−
0
View file @
306b6c2c
#
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
# Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
#######################################################################
### append test cases here (file name without the ".cpp" suffix)
#######################################################################
set(test_cases
test_connection
test_transaction
test_ccaosdb
)
include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)
function(add_compiler_flag flag)
string(FIND "${CMAKE_CXX_FLAGS}" "${flag}" cxx_present)
if(cxx_present EQUAL -1)
check_cxx_compiler_flag("${flag}" flag_supported)
if(flag_supported)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE)
endif()
unset(flag_supported CACHE)
endif()
unset(cxx_present CACHE)
endfunction()
### but ignore these
add_compiler_flag("-Wno-unused-parameter")
add_compiler_flag("-Wno-unused-result")
add_compiler_flag("-g")
#######################################################
### Linting with clang-tidy and include-what-you-use
#######################################################
option(LINTING "clang-tidy and iwye" ON)
if(LINTING)
### set paranoid compiler flags
#add_compiler_flag("-Wall")
#add_compiler_flag("-Wextra")
#add_compiler_flag("-pedantic")
#add_compiler_flag("-Werror")
find_program(iwyu
NAMES include-what-you-use iwyu
PATHS ${CMAKE_SOURCE_DIR}/tools/include-what-you-use/${iwyu_os}/bin)
if(NOT iwyu)
message(WARNING "include-what-you-use: Not found")
else()
message(STATUS "include-what-you-use: ${iwyu}")
set(_CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${iwyu}
"-Xiwyu" "--no_fwd_decls"
"-Xiwyu" "--cxx17ns")
endif()
find_program(clang_tidy NAMES clang-tidy clang-tidy-11)
if(NOT clang_tidy)
message(WARNING "clang-tidy: Not found")
else()
message(STATUS "clang-tidy: ${clang_tidy}")
set(_CMAKE_CXX_CLANG_TIDY "${clang_tidy}"
"--header-filter=caosdb/.*[^\(\.pb\.h\)]$"
"--warnings-as-errors=*"
"--fix")
set(_CMAKE_CXX_CLANG_TIDY_CHECKS
<<<<<<< HEAD
"--checks=*,-fuchsia-*,-llvmlibc-*,-cert-err58-cpp,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type,-google-readability-avoid-underscore-in-googletest-name,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-cppcoreguidelines-avoid-goto,-hicpp-avoid-goto,-readability-function-cognitive-complexity,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay")
=======
"--checks=*,-fuchsia-*,-llvmlibc-*,-cert-err58-cpp,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type,-google-readability-avoid-underscore-in-googletest-name,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-cppcoreguidelines-avoid-goto,-hicpp-avoid-goto,-readability-function-cognitive-complexity,-cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes")
>>>>>>> f-files
endif()
else()
message(STATUS "LINTING is OFF")
endif()
###################################################
### Set up tests using GoogleTest (GTest)
###################################################
# add special cmake functions for gtest
include(GoogleTest REQUIRED)
# loop over all test cases and add them to the test runner
list(LENGTH test_cases len_test_cases)
math(EXPR len_test_cases "${len_test_cases} - 1")
foreach (i RANGE "${len_test_cases}")
list(GET test_cases ${i} test_case_name)
add_executable(${test_case_name} ${test_case_name}.cpp)
target_link_libraries(${test_case_name} PRIVATE ${CONAN_LIBS_CAOSDB}
${CONAN_LIBS_GTEST} ${CONAN_LIBS_GRPC} ${CONAN_LIBS_ABSEIL}
${CONAN_LIBS_OPENSSL} ${CONAN_LIBS_C-ARES} ${CONAN_LIBS_BZIP2}
${CONAN_LIBS_PROTOBUF} ${CONAN_LIBS_ZLIB} ${CONAN_LIBS_RE2}
${CONAN_LIBS_BOOST})
target_include_directories(${test_case_name}
PUBLIC ${CONAN_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
if(LINTING)
set_target_properties(${test_case_name}
PROPERTIES
CXX_CLANG_TIDY "${_CMAKE_CXX_CLANG_TIDY};${_CMAKE_CXX_CLANG_TIDY_CHECKS}"
CXX_INCLUDE_WHAT_YOU_USE "${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}")
endif()
gtest_discover_tests(${test_case_name}
PROPERTIES
LABELS "caosdb-cpplib-int-tests")
endforeach ()
This diff is collapsed.
Click to expand it.
test/test_transaction.cpp
+
0
−
1
View file @
306b6c2c
...
...
@@ -441,7 +441,6 @@ TEST_F(test_transaction, test_multi_retrieve) {
// Exists so should be fine ...
EXPECT_FALSE
(
result_set
.
at
(
1
).
HasErrors
());
// ... but this does not
EXPECT_EQ
(
result_set
.
at
(
2
).
GetId
(),
"22"
);
EXPECT_TRUE
(
result_set
.
at
(
2
).
HasErrors
());
...
...
This diff is collapsed.
Click to expand it.
test/test_transaction.cpp.orig
0 → 100644
+
855
−
0
View file @
306b6c2c
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment