cipra  1.2.1
A C++11 Unit Testing Framework based on Test::More
 All Classes Namespaces Functions Variables Typedefs Pages
tap13.hpp
1 // -*- c++ -*-
2 /* This file is a part of the cipra Unit Testing Framework.
3  * Copyright (C) 2012, Patrick M. Niedzielski.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  *
18  * 3. The names of its contributors may not be used to endorse or
19  * promote products derived from this software without specific
20  * prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33  * OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #ifndef CIPRA_TAP13_HPP
37 #define CIPRA_TAP13_HPP
38 
39 #include <string>
40 #include <iostream>
41 #include <memory>
42 
43 namespace cipra {
44  namespace tap13 {
45 
47 
54  namespace details {
64  class output_helper {
65  public:
73  virtual std::ostream &operator()(std::ostream &)
74  = 0;
75  };
81  typedef std::unique_ptr<output_helper> output;
82 
94  inline std::ostream &operator<<(std::ostream &,
95  output);
96  }
98 
111 
122  inline details::output header();
135  inline details::output plan(int total);
150  inline details::output diagnostic(std::string text);
162  inline details::output yamlish_diagnostic(/* ... */);
177  inline details::output todo(std::string text);
192  inline details::output skip(std::string text);
206  inline details::output ok(int number, std::string name);
220  inline details::output not_ok(int number, std::string name);
234  inline details::output bail_out(std::string why);
236  }
237 }
238 
239 #include "tap13.ipp"
240 
241 #endif // #ifdef CIPRA_TAP13_HPP