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
46b4e0f1
Verified
Commit
46b4e0f1
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: pipeline
parent
fc67222c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#8499
passed
3 years ago
Stage: info
Stage: setup
Stage: build
Stage: test
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+3
-0
3 additions, 0 deletions
CMakeLists.txt
test/CMakeLists.txt
+1
-0
1 addition, 0 deletions
test/CMakeLists.txt
test/test_connection.cpp
+37
-4
37 additions, 4 deletions
test/test_connection.cpp
with
41 additions
and
4 deletions
CMakeLists.txt
+
3
−
0
View file @
46b4e0f1
...
...
@@ -27,6 +27,9 @@ project(libcaosdb_inttests
set
(
CMAKE_CXX_STANDARD 17
)
set
(
CMAKE_CXX_STANDARD_REQUIRED ON
)
# ignore some warnings here
add_compile_options
(
-Wno-unused-parameter -Wno-unused-result
)
set
(
CMAKE_MODULE_PATH
"
${
PROJECT_SOURCE_DIR
}
/cmake"
${
CMAKE_MODULE_PATH
}
)
enable_testing
()
...
...
This diff is collapsed.
Click to expand it.
test/CMakeLists.txt
+
1
−
0
View file @
46b4e0f1
...
...
@@ -24,6 +24,7 @@ set(test_cases
)
find_package
(
caosdb REQUIRED
)
message
(
STATUS
"Found libcaosdb:
${
caosdb_DIR
}
"
)
include
(
FetchGTest
)
# add special cmake functions for gtest
...
...
This diff is collapsed.
Click to expand it.
test/test_connection.cpp
+
37
−
4
View file @
46b4e0f1
...
...
@@ -26,9 +26,42 @@
#include
<memory>
#include
"gtest/gtest_pred_impl.h"
TEST
(
test_connection
,
localhost_8080
)
{
caosdb
::
CaosDBConnectionConfig
config
(
"localhost"
,
8000
);
using
caosdb
::
info
::
v1alpha1
::
VersionInfo
;
EXPECT_EQ
(
"localhost"
,
config
.
getHost
());
EXPECT_EQ
(
8000
,
config
.
getPort
());
TEST
(
test_connection
,
config_somehost_25323
)
{
int
port
=
25323
;
std
::
string
host
=
"somehost"
;
caosdb
::
CaosDBConnectionConfig
config
(
host
,
port
);
ASSERT_EQ
(
host
,
config
.
getHost
());
ASSERT_EQ
(
port
,
config
.
getPort
());
}
TEST
(
test_connection
,
connect_somehost_42347_fails
)
{
int
port
=
42347
;
std
::
string
host
=
"somehost"
;
caosdb
::
CaosDBConnectionConfig
config
(
host
,
port
);
caosdb
::
CaosDBConnection
connection
(
config
);
ASSERT_THROW
(
connection
.
getVersionInfo
(),
std
::
runtime_error
);
}
TEST
(
test_connection
,
connection_caosdb_server_8080_success
)
{
int
port
=
8080
;
std
::
string
host
=
"caosdb-server"
;
int
major
=
0
;
int
minor
=
0
;
int
patch
=
1
;
std
::
string
pre_release
=
""
;
std
::
string
build
=
""
;
caosdb
::
CaosDBConnectionConfig
config
(
host
,
port
);
caosdb
::
CaosDBConnection
connection
(
config
);
const
VersionInfo
&
v_info
=
connection
.
getVersionInfo
();
ASSERT_EQ
(
major
,
v_info
.
major
());
ASSERT_EQ
(
minor
,
v_info
.
minor
());
ASSERT_EQ
(
patch
,
v_info
.
patch
());
ASSERT_EQ
(
pre_release
,
v_info
.
pre_release
());
ASSERT_EQ
(
build
,
v_info
.
build
());
}
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