596 |
14 Apr 08 |
peter |
1 |
#ifndef _theplu_svndigest_test_suite_ |
596 |
14 Apr 08 |
peter |
2 |
#define _theplu_svndigest_test_suite_ |
596 |
14 Apr 08 |
peter |
3 |
|
596 |
14 Apr 08 |
peter |
// $Id$ |
596 |
14 Apr 08 |
peter |
5 |
|
596 |
14 Apr 08 |
peter |
6 |
/* |
978 |
12 Dec 09 |
peter |
Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
1478 |
29 May 12 |
peter |
Copyright (C) 2009, 2010, 2012 Peter Johansson |
596 |
14 Apr 08 |
peter |
9 |
|
687 |
04 Aug 08 |
peter |
This file is part of svndigest, http://dev.thep.lu.se/svndigest |
596 |
14 Apr 08 |
peter |
11 |
|
596 |
14 Apr 08 |
peter |
svndigest is free software; you can redistribute it and/or modify it |
596 |
14 Apr 08 |
peter |
under the terms of the GNU General Public License as published by |
693 |
11 Sep 08 |
jari |
the Free Software Foundation; either version 3 of the License, or |
596 |
14 Apr 08 |
peter |
(at your option) any later version. |
596 |
14 Apr 08 |
peter |
16 |
|
596 |
14 Apr 08 |
peter |
svndigest distributed in the hope that it will be useful, but |
596 |
14 Apr 08 |
peter |
WITHOUT ANY WARRANTY; without even the implied warranty of |
596 |
14 Apr 08 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
596 |
14 Apr 08 |
peter |
General Public License for more details. |
596 |
14 Apr 08 |
peter |
21 |
|
596 |
14 Apr 08 |
peter |
You should have received a copy of the GNU General Public License |
693 |
11 Sep 08 |
jari |
along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
596 |
14 Apr 08 |
peter |
24 |
*/ |
596 |
14 Apr 08 |
peter |
25 |
|
1182 |
25 Aug 10 |
peter |
// used to tell automake that test should be skipped |
1182 |
25 Aug 10 |
peter |
27 |
#define EXIT_SKIP 77 |
1182 |
25 Aug 10 |
peter |
28 |
|
1525 |
01 Oct 12 |
peter |
// include from topdir to allow VPATH build |
1525 |
01 Oct 12 |
peter |
30 |
#include "test/environment.h" |
596 |
14 Apr 08 |
peter |
31 |
|
596 |
14 Apr 08 |
peter |
32 |
#include <string> |
596 |
14 Apr 08 |
peter |
33 |
|
596 |
14 Apr 08 |
peter |
34 |
namespace theplu { |
596 |
14 Apr 08 |
peter |
35 |
namespace svndigest { |
801 |
06 Jul 09 |
peter |
36 |
class Stats; |
801 |
06 Jul 09 |
peter |
37 |
class StatsCollection; |
801 |
06 Jul 09 |
peter |
38 |
|
596 |
14 Apr 08 |
peter |
39 |
namespace test { |
596 |
14 Apr 08 |
peter |
40 |
|
744 |
08 Jan 09 |
peter |
41 |
class Suite |
744 |
08 Jan 09 |
peter |
42 |
{ |
744 |
08 Jan 09 |
peter |
43 |
public: |
744 |
08 Jan 09 |
peter |
44 |
Suite(int argc, char* argv[], bool need_test_repo=false); |
744 |
08 Jan 09 |
peter |
45 |
~Suite(void); |
744 |
08 Jan 09 |
peter |
46 |
|
744 |
08 Jan 09 |
peter |
47 |
/** |
744 |
08 Jan 09 |
peter |
If b is false, set ok to false |
744 |
08 Jan 09 |
peter |
49 |
|
744 |
08 Jan 09 |
peter |
\return b |
744 |
08 Jan 09 |
peter |
51 |
*/ |
744 |
08 Jan 09 |
peter |
52 |
bool add(bool b); |
744 |
08 Jan 09 |
peter |
53 |
|
744 |
08 Jan 09 |
peter |
54 |
/** |
1162 |
13 Aug 10 |
peter |
\return EXIT_FAILURE or EXIT_SUCCESS depending on ok() |
1162 |
13 Aug 10 |
peter |
56 |
*/ |
1162 |
13 Aug 10 |
peter |
57 |
int exit_status(void) const; |
1162 |
13 Aug 10 |
peter |
58 |
|
1162 |
13 Aug 10 |
peter |
59 |
/** |
744 |
08 Jan 09 |
peter |
\return true if all tests are OK |
744 |
08 Jan 09 |
peter |
61 |
*/ |
744 |
08 Jan 09 |
peter |
62 |
bool ok(void) const; |
744 |
08 Jan 09 |
peter |
63 |
|
744 |
08 Jan 09 |
peter |
64 |
std::ostream& out(void) const; |
744 |
08 Jan 09 |
peter |
65 |
|
744 |
08 Jan 09 |
peter |
66 |
/** |
1478 |
29 May 12 |
peter |
Wrapper around std system that calls \a cmd to shell. If return |
1478 |
29 May 12 |
peter |
value is different from \a xret exception is thrown |
1478 |
29 May 12 |
peter |
69 |
*/ |
1478 |
29 May 12 |
peter |
70 |
void system(const std::string& cmd, int xret=0) const; |
1478 |
29 May 12 |
peter |
71 |
|
1478 |
29 May 12 |
peter |
72 |
/** |
744 |
08 Jan 09 |
peter |
\return true if we are running in verbose mode |
744 |
08 Jan 09 |
peter |
74 |
*/ |
744 |
08 Jan 09 |
peter |
75 |
bool verbose(void) const; |
744 |
08 Jan 09 |
peter |
76 |
|
744 |
08 Jan 09 |
peter |
77 |
private: |
744 |
08 Jan 09 |
peter |
78 |
bool ok_; |
744 |
08 Jan 09 |
peter |
79 |
|
744 |
08 Jan 09 |
peter |
80 |
void checkout_test_wc(void) const; |
744 |
08 Jan 09 |
peter |
81 |
void update_test_wc(void) const; |
744 |
08 Jan 09 |
peter |
82 |
}; |
744 |
08 Jan 09 |
peter |
83 |
|
803 |
10 Jul 09 |
peter |
84 |
bool check_all(const Stats&, test::Suite&); |
803 |
10 Jul 09 |
peter |
85 |
bool check_total(const Stats&, test::Suite&); |
803 |
10 Jul 09 |
peter |
86 |
|
803 |
10 Jul 09 |
peter |
87 |
bool consistent(const StatsCollection&, test::Suite&); |
803 |
10 Jul 09 |
peter |
88 |
bool consistent(const Stats&, test::Suite&); |
803 |
10 Jul 09 |
peter |
89 |
|
1207 |
07 Oct 10 |
peter |
// return true if a and b are different |
1207 |
07 Oct 10 |
peter |
// sends differences to cout |
1207 |
07 Oct 10 |
peter |
92 |
bool diff(const std::string& a, const std::string& b); |
1207 |
07 Oct 10 |
peter |
93 |
|
801 |
06 Jul 09 |
peter |
94 |
bool equal(const StatsCollection& a, const StatsCollection& b, |
801 |
06 Jul 09 |
peter |
95 |
test::Suite& suite); |
801 |
06 Jul 09 |
peter |
96 |
|
801 |
06 Jul 09 |
peter |
97 |
bool equal(const Stats& a, const Stats& b, test::Suite& suite); |
801 |
06 Jul 09 |
peter |
98 |
|
596 |
14 Apr 08 |
peter |
99 |
/** |
596 |
14 Apr 08 |
peter |
\return absolute path to file |
801 |
06 Jul 09 |
peter |
\param local_path path relative to builddir |
596 |
14 Apr 08 |
peter |
102 |
*/ |
596 |
14 Apr 08 |
peter |
103 |
std::string filename(const std::string& local_path); |
596 |
14 Apr 08 |
peter |
104 |
|
801 |
06 Jul 09 |
peter |
105 |
/** |
801 |
06 Jul 09 |
peter |
\return absolute path to file |
801 |
06 Jul 09 |
peter |
\param path path relative to srcdir |
801 |
06 Jul 09 |
peter |
108 |
*/ |
801 |
06 Jul 09 |
peter |
109 |
std::string src_filename(const std::string& path); |
1478 |
29 May 12 |
peter |
110 |
|
1478 |
29 May 12 |
peter |
111 |
|
596 |
14 Apr 08 |
peter |
112 |
}}} |
596 |
14 Apr 08 |
peter |
113 |
|
596 |
14 Apr 08 |
peter |
114 |
#endif |