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 {
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 
45  {
46  std::cout << "Didn't run any tests!\n";
47  return EXIT_FAILURE;
48  }
49  return result;
50 }
GLsizei const GLchar *const * string
GLdouble f
std::ostream & cout()
GLenum GLfloat param
int main(int argc, char *const argv[])
static command_line_params & instance(int argc=0, char *const argv[]=0)
int i
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