Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
code
pugs
Commits
efac0892
Commit
efac0892
authored
4 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Add ConsoleManager tests
parent
5907c128
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!63
Feature/utils coverage
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/CMakeLists.txt
+1
-0
1 addition, 0 deletions
tests/CMakeLists.txt
tests/test_ConsoleManager.cpp
+37
-0
37 additions, 0 deletions
tests/test_ConsoleManager.cpp
with
38 additions
and
0 deletions
tests/CMakeLists.txt
+
1
−
0
View file @
efac0892
...
...
@@ -50,6 +50,7 @@ add_executable (unit_tests
test_BuiltinFunctionEmbedderTable.cpp
test_BuiltinFunctionProcessor.cpp
test_CastArray.cpp
test_ConsoleManager.cpp
test_CG.cpp
test_ContinueProcessor.cpp
test_ConcatExpressionProcessor.cpp
...
...
This diff is collapsed.
Click to expand it.
tests/test_ConsoleManager.cpp
0 → 100644
+
37
−
0
View file @
efac0892
#ifndef TEST_CONSOLE_MANAGER_HPP
#define TEST_CONSOLE_MANAGER_HPP
#include
<catch2/catch.hpp>
#include
<utils/ConsoleManager.hpp>
#include
<rang.hpp>
// clazy:excludeall=non-pod-global-static
TEST_CASE
(
"ConsoleManager"
,
"[utils]"
)
{
SECTION
(
"is terminal"
)
{
const
bool
is_terminal
=
rang
::
rang_implementation
::
isTerminal
(
std
::
cout
.
rdbuf
());
REQUIRE
(
is_terminal
==
ConsoleManager
::
isTerminal
(
std
::
cout
));
}
SECTION
(
"control settings"
)
{
const
rang
::
control
saved_control
=
rang
::
rang_implementation
::
controlMode
();
ConsoleManager
::
init
(
true
);
REQUIRE
(
rang
::
rang_implementation
::
controlMode
()
==
rang
::
control
::
Force
);
ConsoleManager
::
init
(
false
);
REQUIRE
(
rang
::
rang_implementation
::
controlMode
()
==
rang
::
control
::
Off
);
rang
::
setControlMode
(
saved_control
);
}
}
#endif // TEST_CONSOLE_MANAGER_HPP
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