source: trunk/test/Suite.h @ 1182

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

Merge release 0.8 into trunk

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1#ifndef _theplu_svndigest_test_suite_
2#define _theplu_svndigest_test_suite_
3
4// $Id: Suite.h 1182 2010-08-25 01:02:41Z peter $
5
6/*
7  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009, 2010 Peter Johansson
9
10  This file is part of svndigest, http://dev.thep.lu.se/svndigest
11
12  svndigest is free software; you can redistribute it and/or modify it
13  under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 3 of the License, or
15  (at your option) any later version.
16
17  svndigest distributed in the hope that it will be useful, but
18  WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21
22  You should have received a copy of the GNU General Public License
23  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
24*/
25
26// used to tell automake that test should be skipped
27#define EXIT_SKIP 77
28
29#include "environment.h"
30
31#include <string>
32
33namespace theplu {
34namespace svndigest {
35  class Stats;
36  class StatsCollection;
37
38namespace test {
39
40  class Suite
41  {
42  public:
43    Suite(int argc, char* argv[], bool need_test_repo=false);
44    ~Suite(void);
45
46    /**
47       If b is false, set ok to false
48
49       \return b
50    */
51    bool add(bool b);
52
53    /**
54       \return EXIT_FAILURE or EXIT_SUCCESS depending on ok()
55     */
56    int exit_status(void) const;
57
58    /**
59       \return true if all tests are OK
60     */
61    bool ok(void) const;
62
63    std::ostream& out(void) const;
64
65    /**
66       \return true if we are running in verbose mode
67     */
68    bool verbose(void) const;
69
70  private:
71    bool ok_;
72
73    void checkout_test_wc(void) const;
74    void update_test_wc(void) const;
75  };
76
77  bool check_all(const Stats&, test::Suite&);
78  bool check_total(const Stats&, test::Suite&);
79  bool check_comment_or_copy(const Stats&, test::Suite&);
80
81  bool consistent(const StatsCollection&, test::Suite&);
82  bool consistent(const Stats&, test::Suite&);
83
84  bool equal(const StatsCollection& a, const StatsCollection& b, 
85             test::Suite& suite);
86
87  bool equal(const Stats& a, const Stats& b, test::Suite& suite);
88
89  /**
90     \return absolute path to file
91     \param local_path path relative to builddir
92   */
93  std::string filename(const std::string& local_path);
94
95  /**
96     \return absolute path to file
97     \param path path relative to srcdir
98   */
99  std::string src_filename(const std::string& path);
100}}}
101
102#endif
Note: See TracBrowser for help on using the repository browser.