Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
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-cpplib
Commits
526ba9ab
Commit
526ba9ab
authored
10 months ago
by
Joscha Schmiedt
Browse files
Options
Downloads
Patches
Plain Diff
WIP: Adapt test_package for Conan 2.0
parent
b7d2dc5e
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!61
Release 0.3.0
,
!49
Resolve "EXTERN: Adapt to Conan 2"
Pipeline
#52499
failed
10 months ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-cppinttest
#52500
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test_package/CMakeLists.txt
+2
-8
2 additions, 8 deletions
test_package/CMakeLists.txt
test_package/conanfile.py
+19
-10
19 additions, 10 deletions
test_package/conanfile.py
with
21 additions
and
18 deletions
test_package/CMakeLists.txt
+
2
−
8
View file @
526ba9ab
cmake_minimum_required
(
VERSION 3.1
)
cmake_minimum_required
(
VERSION 3.1
3
)
project
(
PackageTest CXX
)
#######################################################################
...
...
@@ -12,9 +12,6 @@ set(test_cases
### Set up tests using GoogleTest (GTest)
###################################################
# dependencies
include
(
${
CMAKE_BINARY_DIR
}
/conanbuildinfo.cmake
)
conan_basic_setup
(
KEEP_RPATHS
)
# supress warnings during build of gtest
cmake_policy
(
SET CMP0054 NEW
)
...
...
@@ -29,10 +26,7 @@ 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
}
)
target_link_libraries
(
${
test_case_name
}
PRIVATE GTest::gtest GTest::gtest_main caosdb::caosdb
)
if
(
"
${
CMAKE_BUILD_TYPE
}
"
MATCHES
"Debug"
)
target_link_libraries
(
${
test_case_name
}
PRIVATE caosdb_grpc
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
test_package/conanfile.py
+
19
−
10
View file @
526ba9ab
import
os
from
conans
import
ConanFile
,
CMake
,
tools
from
conan
import
ConanFile
from
conan.tools.cmake
import
CMake
,
cmake_layout
,
CMakeDeps
,
CMakeToolchain
from
conan.tools.files
import
copy
from
conan.tools.build
import
cross_building
class
LibcaosdbTestConan
(
ConanFile
):
settings
=
"
os
"
,
"
compiler
"
,
"
build_type
"
,
"
arch
"
generators
=
"
cmake
"
build_requires
=
[
(
"
gtest/1.11.0
"
),
]
def
layout
(
self
):
cmake_layout
(
self
,
src_folder
=
"
.
"
)
def
generate
(
self
):
tc
=
CMakeToolchain
(
self
)
tc
.
generate
()
cmake
=
CMakeDeps
(
self
)
cmake
.
generate
()
def
build
(
self
):
cmake
=
CMake
(
self
)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is
# in "test_package"
cmake
.
configure
()
cmake
.
build
()
def
imports
(
self
):
self
.
copy
(
"
*.dll
"
,
dst
=
"
bin
"
,
src
=
"
bin
"
)
self
.
copy
(
"
*.dylib*
"
,
dst
=
"
bin
"
,
src
=
"
lib
"
)
self
.
copy
(
'
*.so*
'
,
dst
=
'
bin
'
,
src
=
'
lib
'
)
copy
(
"
*.dll
"
,
dst
=
"
bin
"
,
src
=
"
bin
"
)
copy
(
"
*.dylib*
"
,
dst
=
"
bin
"
,
src
=
"
lib
"
)
copy
(
'
*.so*
'
,
dst
=
'
bin
'
,
src
=
'
lib
'
)
def
test
(
self
):
if
not
tools
.
cross_building
(
self
):
if
not
cross_building
(
self
):
cmake
=
CMake
(
self
)
cmake
.
test
()
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