Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
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
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
Libraries
spdlog
Commits
08de6425
Commit
08de6425
authored
Jun 20, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added stdout tests
parent
ab9e1b3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
1 deletion
+84
-1
tests/CMakeLists.txt
tests/CMakeLists.txt
+2
-1
tests/test_stdout_api.cpp
tests/test_stdout_api.cpp
+82
-0
No files found.
tests/CMakeLists.txt
View file @
08de6425
...
...
@@ -13,7 +13,8 @@ set(SPDLOG_UTESTS_SOURCES
main.cpp
test_mpmc_q.cpp
test_sink.h
test_fmt_helper.cpp
)
test_fmt_helper.cpp
test_stdout_api.cpp
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
enable_testing
()
...
...
tests/test_stdout_api.cpp
0 → 100644
View file @
08de6425
/*
* This content is released under the MIT License as specified in https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE
*/
#include "includes.h"
#include "spdlog/sinks/stdout_sinks.h"
#include "spdlog/sinks/stdout_color_sinks.h"
TEST_CASE
(
"stdout_st"
,
"[stdout]"
)
{
auto
l
=
spdlog
::
stdout_logger_st
(
"test"
);
l
->
set_pattern
(
"%+"
);
l
->
set_level
(
spdlog
::
level
::
trace
);
l
->
trace
(
"Test stdout_st"
);
spdlog
::
drop_all
();
}
TEST_CASE
(
"stdout_mt"
,
"[stdout]"
)
{
auto
l
=
spdlog
::
stdout_logger_mt
(
"test"
);
l
->
set_pattern
(
"%+"
);
l
->
set_level
(
spdlog
::
level
::
debug
);
l
->
debug
(
"Test stdout_mt"
);
spdlog
::
drop_all
();
}
TEST_CASE
(
"stderr_st"
,
"[stderr]"
)
{
auto
l
=
spdlog
::
stderr_logger_st
(
"test"
);
l
->
set_pattern
(
"%+"
);
l
->
info
(
"Test stderr_st"
);
spdlog
::
drop_all
();
}
TEST_CASE
(
"stderr_mt"
,
"[stderr]"
)
{
auto
l
=
spdlog
::
stderr_logger_mt
(
"test"
);
l
->
set_pattern
(
"%+"
);
l
->
info
(
"Test stderr_mt"
);
l
->
warn
(
"Test stderr_mt"
);
l
->
error
(
"Test stderr_mt"
);
l
->
critical
(
"Test stderr_mt"
);
spdlog
::
drop_all
();
}
// color loggers
TEST_CASE
(
"stdout_color_st"
,
"[stdout]"
)
{
auto
l
=
spdlog
::
stdout_color_st
(
"test"
);
l
->
set_pattern
(
"%+"
);
l
->
info
(
"Test stdout_color_st"
);
spdlog
::
drop_all
();
}
TEST_CASE
(
"stdout_color_mt"
,
"[stdout]"
)
{
auto
l
=
spdlog
::
stdout_color_mt
(
"test"
);
l
->
set_pattern
(
"%+"
);
l
->
set_level
(
spdlog
::
level
::
trace
);
l
->
trace
(
"Test stdout_color_mt"
);
spdlog
::
drop_all
();
}
TEST_CASE
(
"stderr_color_st"
,
"[stderr]"
)
{
auto
l
=
spdlog
::
stderr_color_st
(
"test"
);
l
->
set_pattern
(
"%+"
);
l
->
set_level
(
spdlog
::
level
::
debug
);
l
->
debug
(
"Test stderr_color_st"
);
spdlog
::
drop_all
();
}
TEST_CASE
(
"stderr_color_mt"
,
"[stderr]"
)
{
auto
l
=
spdlog
::
stderr_color_mt
(
"test"
);
l
->
set_pattern
(
"%+"
);
l
->
info
(
"Test stderr_color_mt"
);
l
->
warn
(
"Test stderr_color_mt"
);
l
->
error
(
"Test stderr_color_mt"
);
l
->
critical
(
"Test stderr_color_mt"
);
spdlog
::
drop_all
();
}
\ No newline at end of file
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