1555 |
05 Nov 12 |
peter |
// $Id$ |
1555 |
05 Nov 12 |
peter |
2 |
|
1555 |
05 Nov 12 |
peter |
3 |
/* |
1635 |
30 Mar 23 |
peter |
Copyright (C) 2012, 2023 Peter Johansson |
1555 |
05 Nov 12 |
peter |
5 |
|
1555 |
05 Nov 12 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
1555 |
05 Nov 12 |
peter |
7 |
|
1555 |
05 Nov 12 |
peter |
svndigest is free software; you can redistribute it and/or modify it |
1555 |
05 Nov 12 |
peter |
under the terms of the GNU General Public License as published by |
1555 |
05 Nov 12 |
peter |
the Free Software Foundation; either version 3 of the License, or |
1555 |
05 Nov 12 |
peter |
(at your option) any later version. |
1555 |
05 Nov 12 |
peter |
12 |
|
1555 |
05 Nov 12 |
peter |
svndigest is distributed in the hope that it will be useful, but |
1555 |
05 Nov 12 |
peter |
WITHOUT ANY WARRANTY; without even the implied warranty of |
1555 |
05 Nov 12 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1555 |
05 Nov 12 |
peter |
General Public License for more details. |
1555 |
05 Nov 12 |
peter |
17 |
|
1555 |
05 Nov 12 |
peter |
You should have received a copy of the GNU General Public License |
1555 |
05 Nov 12 |
peter |
along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
1555 |
05 Nov 12 |
peter |
20 |
*/ |
1555 |
05 Nov 12 |
peter |
21 |
|
1619 |
12 Mar 23 |
peter |
22 |
#include <config.h> |
1619 |
12 Mar 23 |
peter |
23 |
|
1555 |
05 Nov 12 |
peter |
24 |
#include "Suite.h" |
1555 |
05 Nov 12 |
peter |
25 |
|
1555 |
05 Nov 12 |
peter |
26 |
#include "lib/SVN.h" |
1555 |
05 Nov 12 |
peter |
27 |
#include "lib/SVNlog.h" |
1555 |
05 Nov 12 |
peter |
28 |
|
1555 |
05 Nov 12 |
peter |
29 |
#include <cstdlib> |
1555 |
05 Nov 12 |
peter |
30 |
#include <fstream> |
1555 |
05 Nov 12 |
peter |
31 |
#include <ostream> |
1555 |
05 Nov 12 |
peter |
32 |
#include <sstream> |
1555 |
05 Nov 12 |
peter |
33 |
#include <string> |
1555 |
05 Nov 12 |
peter |
34 |
|
1555 |
05 Nov 12 |
peter |
35 |
using namespace theplu::svndigest; |
1555 |
05 Nov 12 |
peter |
36 |
|
1555 |
05 Nov 12 |
peter |
37 |
int main(int argc, char* argv[]) |
1555 |
05 Nov 12 |
peter |
38 |
{ |
1555 |
05 Nov 12 |
peter |
39 |
test::Suite suite(argc, argv, true); |
1555 |
05 Nov 12 |
peter |
40 |
SVN* svn=SVN::instance("toy_project"); |
1555 |
05 Nov 12 |
peter |
41 |
if (!svn) { |
1555 |
05 Nov 12 |
peter |
42 |
suite.out() << "error: cannot create SVN instance\n"; |
1555 |
05 Nov 12 |
peter |
43 |
return EXIT_FAILURE; |
1555 |
05 Nov 12 |
peter |
44 |
} |
1555 |
05 Nov 12 |
peter |
45 |
|
1555 |
05 Nov 12 |
peter |
46 |
SVNlog log("toy_project/late_copy/Node.h"); |
1555 |
05 Nov 12 |
peter |
47 |
|
1555 |
05 Nov 12 |
peter |
48 |
const SVNlog::container& commits = log.commits(); |
1555 |
05 Nov 12 |
peter |
49 |
suite.out() << commits.size() << " commits\n"; |
1555 |
05 Nov 12 |
peter |
50 |
typedef SVNlog::container::const_iterator log_iterator; |
1555 |
05 Nov 12 |
peter |
51 |
if (commits.size()!=10) { |
1555 |
05 Nov 12 |
peter |
52 |
suite.add(false); |
1555 |
05 Nov 12 |
peter |
53 |
suite.out() << "expecte size 10\n"; |
1555 |
05 Nov 12 |
peter |
54 |
} |
1555 |
05 Nov 12 |
peter |
55 |
|
1555 |
05 Nov 12 |
peter |
56 |
log_iterator commit = commits.begin(); |
1555 |
05 Nov 12 |
peter |
57 |
if (commit->revision()!=4 || commit->author()!="jari") { |
1555 |
05 Nov 12 |
peter |
58 |
suite.out() << "expected first commit r4 jari\n"; |
1555 |
05 Nov 12 |
peter |
59 |
suite.add(false); |
1555 |
05 Nov 12 |
peter |
60 |
} |
1555 |
05 Nov 12 |
peter |
61 |
|
1555 |
05 Nov 12 |
peter |
62 |
for (; commit!=commits.end(); ++commit) |
1555 |
05 Nov 12 |
peter |
63 |
suite.out() << "r" << commit->revision() << " " |
1555 |
05 Nov 12 |
peter |
64 |
<< commit->author() << " " |
1555 |
05 Nov 12 |
peter |
65 |
<< commit->message() << " " |
1555 |
05 Nov 12 |
peter |
66 |
<< commit->date() << " " |
1555 |
05 Nov 12 |
peter |
67 |
<< "\n"; |
1555 |
05 Nov 12 |
peter |
68 |
return suite.exit_status(); |
1555 |
05 Nov 12 |
peter |
69 |
} |
1555 |
05 Nov 12 |
peter |
70 |
|