Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CT Input Output Library
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
kulvait
CT Input Output Library
Commits
eb7576c7
Commit
eb7576c7
authored
Jan 30, 2020
by
kulvait
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Organization of tests
parent
696bad81
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
64 deletions
+2
-64
tests/PlogSetup.cpp
tests/PlogSetup.cpp
+0
-39
tests/PlogSetup.h
tests/PlogSetup.h
+0
-23
tests/catch_main.cpp
tests/catch_main.cpp
+2
-2
No files found.
tests/PlogSetup.cpp
deleted
100644 → 0
View file @
696bad81
#include "PlogSetup.h"
namespace
CTL
{
namespace
util
{
PlogSetup
::
PlogSetup
(
plog
::
Severity
verbosityLevel
,
std
::
string
csvLogFile
,
bool
logToConsole
)
:
verbosityLevel
(
verbosityLevel
)
,
csvLogFile
(
csvLogFile
)
,
logToConsole
(
logToConsole
)
{
}
void
PlogSetup
::
initLogging
()
{
if
(
!
csvLogFile
.
empty
())
{
static
plog
::
RollingFileAppender
<
plog
::
CsvFormatter
>
fileAppender
(
csvLogFile
.
c_str
(),
0
,
0
);
if
(
logToConsole
)
{
static
plog
::
ColorConsoleAppender
<
plog
::
TxtFormatter
>
consoleAppender
;
plog
::
init
(
verbosityLevel
,
&
fileAppender
).
addAppender
(
&
consoleAppender
);
}
else
{
plog
::
init
(
verbosityLevel
,
&
fileAppender
);
}
}
else
{
if
(
logToConsole
)
{
static
plog
::
ColorConsoleAppender
<
plog
::
TxtFormatter
>
consoleAppender
;
plog
::
init
(
verbosityLevel
,
&
consoleAppender
);
}
}
return
;
}
}
// namespace util
}
// namespace CTL
tests/PlogSetup.h
deleted
100644 → 0
View file @
696bad81
#pragma once
#define PLOG_CAPTURE_FILE
// External dependencies
#include <plog/Appenders/ColorConsoleAppender.h>
#include <plog/Log.h>
#include <string>
namespace
CTL
{
namespace
util
{
class
PlogSetup
{
public:
PlogSetup
(
plog
::
Severity
verbosityLevel
,
std
::
string
csvLogFile
,
bool
logToConsole
);
void
initLogging
();
private:
plog
::
Severity
verbosityLevel
;
// Set to debug to see the debug messages, info messages
std
::
string
csvLogFile
;
// Set to empty string to disable
bool
logToConsole
;
};
}
// namespace util
}
// namespace CTL
tests/catch_main.cpp
View file @
eb7576c7
#define CATCH_CONFIG_RUNNER
#include "PlogSetup.h"
#include "P
LOG/P
logSetup.h"
#include "catch.hpp"
#include "PROG/RunTimeInfo.hpp"
...
...
@@ -15,7 +15,7 @@ int main(int argc, char* argv[])
=
plog
::
debug
;
// Set to debug to see the debug messages, info messages
std
::
string
csvLogFile
=
"/tmp/imageRegistrationLog.csv"
;
// Set NULL to disable
bool
logToConsole
=
true
;
util
::
PlogSetup
plogSetup
(
verbosityLevel
,
csvLogFile
,
logToConsole
);
plog
::
PlogSetup
plogSetup
(
verbosityLevel
,
csvLogFile
,
logToConsole
);
plogSetup
.
initLogging
();
}
int
result
=
Catch
::
Session
().
run
(
argc
,
argv
);
...
...
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