Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
0db5680e
Commit
0db5680e
authored
Jun 16, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Combine gauge unit tests into a single file
parent
e1557797
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
48 deletions
+22
-48
libcaf_core/CMakeLists.txt
libcaf_core/CMakeLists.txt
+1
-2
libcaf_core/test/telemetry/gauge.cpp
libcaf_core/test/telemetry/gauge.cpp
+21
-2
libcaf_core/test/telemetry/int_gauge.cpp
libcaf_core/test/telemetry/int_gauge.cpp
+0
-44
No files found.
libcaf_core/CMakeLists.txt
View file @
0db5680e
...
@@ -309,9 +309,8 @@ caf_add_test_suites(caf-core-test
...
@@ -309,9 +309,8 @@ caf_add_test_suites(caf-core-test
string_view
string_view
sum_type
sum_type
telemetry.collector.prometheus
telemetry.collector.prometheus
telemetry.
dbl_
gauge
telemetry.gauge
telemetry.histogram
telemetry.histogram
telemetry.int_gauge
telemetry.label
telemetry.label
telemetry.metric_registry
telemetry.metric_registry
thread_hook
thread_hook
...
...
libcaf_core/test/telemetry/
dbl_
gauge.cpp
→
libcaf_core/test/telemetry/gauge.cpp
View file @
0db5680e
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
* http://www.boost.org/LICENSE_1_0.txt. *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
******************************************************************************/
#define CAF_SUITE telemetry.
dbl_
gauge
#define CAF_SUITE telemetry.gauge
#include "caf/telemetry/
dbl_
gauge.hpp"
#include "caf/telemetry/gauge.hpp"
#include "caf/test/dsl.hpp"
#include "caf/test/dsl.hpp"
...
@@ -42,3 +42,22 @@ CAF_TEST(double gauges can increment and decrement) {
...
@@ -42,3 +42,22 @@ CAF_TEST(double gauges can increment and decrement) {
CAF_MESSAGE
(
"users can create gauges with custom start values"
);
CAF_MESSAGE
(
"users can create gauges with custom start values"
);
CAF_CHECK_EQUAL
(
telemetry
::
dbl_gauge
{
42.0
}.
value
(),
42.0
);
CAF_CHECK_EQUAL
(
telemetry
::
dbl_gauge
{
42.0
}.
value
(),
42.0
);
}
}
CAF_TEST
(
integer
gauges
can
increment
and
decrement
)
{
telemetry
::
int_gauge
g
;
CAF_MESSAGE
(
"gauges start at 0"
);
CAF_CHECK_EQUAL
(
g
.
value
(),
0
);
CAF_MESSAGE
(
"gauges are incrementable"
);
g
.
inc
();
g
.
inc
(
2
);
CAF_CHECK_EQUAL
(
g
.
value
(),
3
);
CAF_MESSAGE
(
"gauges are decrementable"
);
g
.
dec
();
g
.
dec
(
5
);
CAF_CHECK_EQUAL
(
g
.
value
(),
-
3
);
CAF_MESSAGE
(
"gauges allow setting values"
);
g
.
value
(
42
);
CAF_CHECK_EQUAL
(
g
.
value
(),
42
);
CAF_MESSAGE
(
"users can create gauges with custom start values"
);
CAF_CHECK_EQUAL
(
telemetry
::
int_gauge
{
42
}.
value
(),
42
);
}
libcaf_core/test/telemetry/int_gauge.cpp
deleted
100644 → 0
View file @
e1557797
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2020 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#define CAF_SUITE telemetry.int_gauge
#include "caf/telemetry/int_gauge.hpp"
#include "caf/test/dsl.hpp"
using
namespace
caf
;
CAF_TEST
(
integer
gauges
can
increment
and
decrement
)
{
telemetry
::
int_gauge
g
;
CAF_MESSAGE
(
"gauges start at 0"
);
CAF_CHECK_EQUAL
(
g
.
value
(),
0
);
CAF_MESSAGE
(
"gauges are incrementable"
);
g
.
inc
();
g
.
inc
(
2
);
CAF_CHECK_EQUAL
(
g
.
value
(),
3
);
CAF_MESSAGE
(
"gauges are decrementable"
);
g
.
dec
();
g
.
dec
(
5
);
CAF_CHECK_EQUAL
(
g
.
value
(),
-
3
);
CAF_MESSAGE
(
"gauges allow setting values"
);
g
.
value
(
42
);
CAF_CHECK_EQUAL
(
g
.
value
(),
42
);
CAF_MESSAGE
(
"users can create gauges with custom start values"
);
CAF_CHECK_EQUAL
(
telemetry
::
int_gauge
{
42
}.
value
(),
42
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment