source: trunk/test/copyright.cc @ 592

Last change on this file since 592 was 592, checked in by Peter Johansson, 13 years ago

adding skeleton for copyright test

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1// $Id: copyright.cc 592 2008-04-13 22:49:48Z peter $
2
3/*
4  Copyright (C) 2008 Peter Johansson
5
6  This file is part of svndigest, http://trac.thep.lu.se/svndigest
7
8  svndigest 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  svndigest 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 "Configuration.h"
25#include "File.h"
26#include "SVN.h"
27#include "SVNinfo.h"
28
29#include <cassert>
30#include <iostream>
31#include <fstream>
32#include <string>
33
34int main( int argc, char* argv[])
35{
36  using namespace theplu::svndigest;
37  bool verbose=false;
38  if (argc>1 && argv[1]==std::string("-v") )
39    verbose=true;
40
41  std::string root("toy_project");
42  if (verbose)
43    std::cout << "Create SVN instance" << std::endl;
44  SVN* svn=SVN::instance(root);
45  if (!svn)
46    return 1;
47
48  // Extract repository location
49  if (verbose)
50    std::cout << "Extract repository location" << std::endl;
51  std::string repo=SVNinfo(root).repos_root_url();
52  if (verbose)
53    std::cout << "Create File object" << std::endl;
54  File file(0,root+"/README","");
55 
56  if (verbose)
57    std::cout << "Get stats for file" << std::endl;
58  file.parse(verbose, true);
59 
60  if (verbose)
61    std::cout << "Updating copyright statements" << std::endl;
62  std::map<std::string, Alias> alias;
63  file.print_copyright(alias, verbose);
64
65  if (verbose)
66    std::cout << "Done!" << std::endl;
67  return 0;
68}
69
Note: See TracBrowser for help on using the repository browser.