Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
unit-tests
unit-tests-main.cpp
Go to the documentation of this file.
1
#define CATCH_CONFIG_RUNNER
2
#include "
unit-tests-common.h
"
3
#include <iostream>
4
5
int
main
(
int
argc,
char
*
const
argv[])
6
{
7
command_line_params::instance
(argc, argv);
8
9
std::vector<char*> new_argvs;
10
11
std::cout
<<
"Running tests with the following parameters: "
;
12
for
(
auto
i
= 0;
i
< argc;
i
++)
13
{
14
std::string
param
(argv[
i
]);
15
std::cout
<< param <<
" "
;
16
}
17
std::cout
<< std::endl;
18
19
for
(
auto
i
= 0;
i
< argc;
i
++)
20
{
21
std::string
param
(argv[
i
]);
22
if
(param !=
"into"
&& param !=
"from"
)
23
{
24
new_argvs.push_back(argv[i]);
25
}
26
else
27
{
28
i++;
29
if
(i < argc && param ==
"from"
)
30
{
31
auto
filename
= argv[
i
];
32
std::ifstream
f
(
filename
);
33
if
(!f.good())
34
{
35
std::cout
<<
"Could not load "
<<
filename
<<
"!"
<< std::endl;
36
return
EXIT_FAILURE;
37
}
38
}
39
}
40
}
41
42
auto
result
= Catch::Session().run(static_cast<int>(new_argvs.size()), new_argvs.data());
43
44
if
(!
command_line_params::instance
().
_found_any_section
)
45
{
46
std::cout
<<
"Didn't run any tests!\n"
;
47
return
EXIT_FAILURE;
48
}
49
return
result
;
50
}
string
GLsizei const GLchar *const * string
Definition:
glad/glad/glad.h:2862
f
GLdouble f
Definition:
glad/glad/glad.h:1518
Catch::cout
std::ostream & cout()
unit-tests-common.h
command_line_params::_found_any_section
bool _found_any_section
Definition:
unit-tests-common.h:305
param
GLenum GLfloat param
Definition:
glad/glad/glad.h:1401
main
int main(int argc, char *const argv[])
Definition:
unit-tests-main.cpp:5
command_line_params::instance
static command_line_params & instance(int argc=0, char *const argv[]=0)
Definition:
unit-tests-common.h:299
test-non-realtime.filename
string filename
Definition:
test-non-realtime.py:17
i
int i
Definition:
rs-pcl-color.cpp:54
result
GLuint64EXT * result
Definition:
glext.h:10921
librealsense2
Author(s): Sergey Dorodnicov
, Doron Hirshberg
, Mark Horn
, Reagan Lopez
, Itay Carpis
autogenerated on Mon May 3 2021 02:50:13