source: trunk/test/parser.cc @ 144

Last change on this file since 144 was 144, checked in by Jari Häkkinen, 15 years ago

test programs compile and all tests return success (but they cheat).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1// $Id: parser.cc 144 2006-08-09 20:37:20Z jari $
2
3/*
4  Copyright (C) 2006 Jari, Häkkinen, Peter Johansson
5
6  This file is part of svnstat, http://lev.thep.lu.se/trac/svnstat
7
8  svnstat is free software; you can redistribute it and/or modify it
9  under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12
13  svnstat is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21  02111-1307, USA.
22*/
23
24#include "Parser.h"
25
26#include <fstream>
27#include <iostream>
28
29int main(const int argc,const char* argv[])
30{
31  using namespace theplu::svnstat;
32  std::ostream* out;
33  if (argc>1 && argv[1]==std::string("-v"))
34    out = &std::cout;
35  else {
36    out = new std::ofstream("/dev/null");
37    if (argc>1)
38      std::cout << "parser -v : for printing extra information\n";
39  }
40  bool ok = true;
41
42  Parser p("../lib/Parser.h");
43  for (size_t i=0; i<p.type().size(); ++i)
44    *out << i+1 << " " << p.type()[i] << std::endl;
45
46  if (out!=&std::cout)
47    delete out;
48  return (ok ? 0 : -1);
49}
Note: See TracBrowser for help on using the repository browser.