Lumiera  0.pre.03
»edit your freedom«
testrunner.cpp
Go to the documentation of this file.
1 /*
2  Testrunner - execute a suite of test objects, possibly filtered by category
3 
4  Copyright (C)
5  2007,2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
21 #include "include/lifecycle.h"
22 #include "lib/test/testoption.hpp"
23 #include "lib/test/suite.hpp"
24 
28 
29 
37 int main (int argc, const char* argv[])
38 {
39  lib::Cmdline args (argc,argv);
40  test::TestOption optparser (args);
41  test::Suite suite (optparser.getTestgroup(), optparser.optSeed());
42  LifecycleHook::trigger (ON_GLOBAL_INIT);
43 
44  if (optparser.shouldDescribe())
45  suite.describe();
46  else
47  optparser.handleHelpRequest() || suite.run (args);
48 
49  LifecycleHook::trigger (ON_GLOBAL_SHUTDOWN);
50  return suite.getExitCode();
51 }
Installing and invoking of application lifecycle event callbacks.
Commandline options for our unittest test-suite executable.
int main(int argc, const char *argv[])
run all tests or any single test specified in the first command line argument.
Definition: testrunner.cpp:37
const char * ON_GLOBAL_SHUTDOWN
to be triggered at the end of main()
Building and running a suite of tests, implemented as test classes.
const string getTestgroup()
Definition: testoption.cpp:86
Support for selecting and configuring testcases via commandline arguments.
Definition: testoption.hpp:51
const char * ON_GLOBAL_INIT
to be triggered in main()
define and register a callback for a specific lifecycle event.
Definition: lifecycle.h:67
bool handleHelpRequest()
handles the –help switch by printing a syntax description
Definition: testoption.cpp:125
Enables running a collection of tests.
Definition: suite.hpp:59
Abstraction of the usual int argc, int** argv-Commandline, to be able to treat it as a vector of stri...
Definition: cmdline.hpp:48