LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_ut.cc
Go to the documentation of this file.
1 // vim: set sw=2 expandtab :
2 #define BOOST_TEST_ALTERNATIVE_INIT_API
3 #undef BOOST_TEST_MAIN
4 #define BOOST_TEST_NO_MAIN
5 #include "boost/test/unit_test.hpp"
6 
8 
9 using namespace boost::unit_test;
10 
11 #include <cstring>
12 
13 void
15 {
16  int app_return_val = artapp(framework::master_test_suite().argc,
17  framework::master_test_suite().argv,
18  true);
19  BOOST_REQUIRE_EQUAL(app_return_val, 0);
20 }
21 
22 bool
24 {
25  // framework::master_test_suite().add(BOOST_TEST_CASE(&art_ut));
26  auto ts = BOOST_TEST_SUITE("art_ut");
27  ts->add(BOOST_TEST_CASE(&art_ut));
28  framework::master_test_suite().add(ts);
29  return true;
30 }
31 
32 int
33 main(int argc, char* argv[])
34 {
35  char const* cmp = "-c";
36  char to[] = "--config";
37  for (int i = 0; i < argc; ++i) {
38  if (strncmp(cmp, argv[i], 2) == 0) {
39  argv[i] = to;
40  break;
41  }
42  }
43  return unit_test_main(&init_unit_test_suite, argc, argv);
44 }
45 
46 // Local Variables:
47 // mode: c++
48 // End:
void art_ut()
Definition: lar_ut.cc:14
int main(int argc, char *argv[])
Definition: lar_ut.cc:33
int artapp(int argc, char *argv[], bool report_unused)
Definition: artapp.cc:26
bool init_unit_test_suite()
Definition: lar_ut.cc:23