source: branches/0.7-stable/test/config_test.cc @ 1082

Last change on this file since 1082 was 925, checked in by Peter Johansson, 12 years ago

refs #417 extending tests of Configuration and using Suite class in test

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
RevLine 
[556]1// $Id: config_test.cc 925 2009-12-02 01:24:41Z peter $
2
3/*
[847]4  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
5  Copyright (C) 2009 Peter Johansson
[556]6
[687]7  This file is part of svndigest, http://dev.thep.lu.se/svndigest
[556]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
[693]11  the Free Software Foundation; either version 3 of the License, or
[556]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
[693]20  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
[556]21*/
22
[925]23#include "Suite.h"
24
[556]25#include "Configuration.h"
26
27namespace theplu{
28namespace svndigest{
[925]29  void test_codon(test::Suite&);
[556]30}} // end of namespace svndigest and theplu
31
32
33int main( int argc, char* argv[])
34{
35  using namespace theplu::svndigest;
[925]36  test::Suite suite(argc, argv, false);
[556]37
[925]38  test_codon(suite);
[556]39                                                                               
[925]40  if (suite.ok()) {
41    suite.out() << "Test is Ok!" << std::endl;
[556]42    return 0;
[925]43  }
44  suite.out() << "Test failed." << std::endl;
45  return 1;
[556]46}
47
48
49namespace theplu{
50namespace svndigest{
51
[925]52  void test_codon(test::Suite& suite)
[556]53  {
54    const Configuration& c(Configuration::instance());
55    if (!c.codon("foo.h")){
[925]56      suite.out() << "No codon for foo.h\n";
57      suite.add(false);
[556]58    }
59    if (!c.codon("../dir/test.cc")){
[925]60      suite.out() << "No codon for test.cc\n";
61      suite.add(false);
[556]62    }
[925]63    if (!c.codon("bootstrap")){
64      suite.out() << "No codon for bootstrap\n";
65      suite.add(false);
66    }
[556]67  }
68 
69}} // end of namespace svndigest and theplu
Note: See TracBrowser for help on using the repository browser.