Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
run_testmanager.cpp
Go to the documentation of this file.
1 /*
2  @file $Id: run_testmanager.cpp #$
3 
4  @brief
5 
6  @author
7  $LastChangedBy: aoym $
8 
9  @date $LastChangedDate: 2013-04-12 13:28:01 #$
10 
11  @version $LastChangedRevision: 1144 $
12 */
13 
14 #include "main.h"
15 #include "test.h"
16 #include "testlist.h"
17 #include "testManager.h"
18 
19 //====================================================================
20 int run_testmanager(int argc, char **argv)
21 {
22  TestManager& testmanager = TestManager::Instance(); // find singleton
23 
24 #ifdef USE_TESTMANAGER_AUTOREGISTER
25  //- tests are registered automatically at start up.
26 
27 #else
28  //- register tests manually:
29  //
30  // testmanager.registerTest(
31  // "Gauge.Plaquette",
32  // Test_Gauge::plaquette
33  // );
34 #endif
35 
36  if (argc > 1) {
37  if (string(argv[1]) == "-a") { // run all tests
38  testmanager.batch_recursive();
39  } else {
40  // argv[] = { "./bridge.elf", test1, (test2, ...) }
41  testmanager.batch_recursive(argc - 1, argv + 1);
42  }
43  } else {
44  testmanager.interactive();
45  }
46 
47  return 0;
48 }
TestManager class for managing and performing tests.
Definition: testManager.h:64
void batch_recursive(const std::string &arg="")
int run_testmanager(int argc, char **argv)
static TestManager & Instance()
Definition: testManager.cpp:41
void interactive()
Definition: testManager.cpp:85