1 | // $Id: config_test.cc 925 2009-12-02 01:24:41Z peter $ |
---|
2 | |
---|
3 | /* |
---|
4 | Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
---|
5 | Copyright (C) 2009 Peter Johansson |
---|
6 | |
---|
7 | This file is part of svndigest, http://dev.thep.lu.se/svndigest |
---|
8 | |
---|
9 | svndigest is free software; you can redistribute it and/or modify it |
---|
10 | under the terms of the GNU General Public License as published by |
---|
11 | the Free Software Foundation; either version 3 of the License, or |
---|
12 | (at your option) any later version. |
---|
13 | |
---|
14 | svndigest is distributed in the hope that it will be useful, but |
---|
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
17 | General Public License for more details. |
---|
18 | |
---|
19 | You should have received a copy of the GNU General Public License |
---|
20 | along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
---|
21 | */ |
---|
22 | |
---|
23 | #include "Suite.h" |
---|
24 | |
---|
25 | #include "Configuration.h" |
---|
26 | |
---|
27 | namespace theplu{ |
---|
28 | namespace svndigest{ |
---|
29 | void test_codon(test::Suite&); |
---|
30 | }} // end of namespace svndigest and theplu |
---|
31 | |
---|
32 | |
---|
33 | int main( int argc, char* argv[]) |
---|
34 | { |
---|
35 | using namespace theplu::svndigest; |
---|
36 | test::Suite suite(argc, argv, false); |
---|
37 | |
---|
38 | test_codon(suite); |
---|
39 | |
---|
40 | if (suite.ok()) { |
---|
41 | suite.out() << "Test is Ok!" << std::endl; |
---|
42 | return 0; |
---|
43 | } |
---|
44 | suite.out() << "Test failed." << std::endl; |
---|
45 | return 1; |
---|
46 | } |
---|
47 | |
---|
48 | |
---|
49 | namespace theplu{ |
---|
50 | namespace svndigest{ |
---|
51 | |
---|
52 | void test_codon(test::Suite& suite) |
---|
53 | { |
---|
54 | const Configuration& c(Configuration::instance()); |
---|
55 | if (!c.codon("foo.h")){ |
---|
56 | suite.out() << "No codon for foo.h\n"; |
---|
57 | suite.add(false); |
---|
58 | } |
---|
59 | if (!c.codon("../dir/test.cc")){ |
---|
60 | suite.out() << "No codon for test.cc\n"; |
---|
61 | suite.add(false); |
---|
62 | } |
---|
63 | if (!c.codon("bootstrap")){ |
---|
64 | suite.out() << "No codon for bootstrap\n"; |
---|
65 | suite.add(false); |
---|
66 | } |
---|
67 | } |
---|
68 | |
---|
69 | }} // end of namespace svndigest and theplu |
---|