Lumiera  0.pre.03
»edit your freedom«
helloworldtest.cpp
Go to the documentation of this file.
1 /*
2  HelloWorld(Test) - how to use this test framework...
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
28 #include "lib/test/run.hpp"
29 #include "lib/util.hpp"
30 
31 #include <boost/lexical_cast.hpp>
32 #include <iostream>
33 
34 using boost::lexical_cast;
35 using util::isnil;
36 using std::cout;
37 using std::endl;
38 
39 
40 namespace lumiera{
41 namespace test {
42 
43  /**************************************/
47  class HelloWorld_test : public Test
48  {
49  virtual void
50  run (Arg arg)
51  {
52  int num= isnil(arg)? 1 : lexical_cast<int> (arg[1]);
53 
54  for ( ; 0 < num-- ; )
55  greeting();
56  }
57 
58  void
59  greeting()
60  {
61  cout << "This is how the world ends..." <<endl;
62  }
63  };
64 
65 
66 
67 
68 
77  LAUNCHER (HelloWorld_test, "unit common");
78 
79 
80 
81 }} // namespace lumiera::test
Definition: run.hpp:49
Hellooooooo the world is just a test.
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Lumiera public interface.
Definition: advice.cpp:113