Lumiera  0.pre.03
»edit your freedom«
diagnostic-output.hpp
Go to the documentation of this file.
1 /*
2  DIAGNOSTIC-OUTPUT.hpp - some helpers for investigation and value output
3 
4  Copyright (C) Lumiera.org
5  2022, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
35 #ifndef LIB_TEST_DIAGNOSTIC_OUTPUT_H
36 #define LIB_TEST_DIAGNOSTIC_OUTPUT_H
37 
38 
39 #include "lib/format-cout.hpp"
40 #include "lib/test/test-helper.hpp"
41 
42 #include <boost/lexical_cast.hpp>
43 #include <string>
44 
45 
46 using std::string;
47 
48 namespace lib {
49 namespace test{
50 
51 }} // namespace lib::test
52 
53 
54 
55 
56 /* === test helper macros === */
57 
62 #define SHOW_TYPE(_TY_) \
63  cout << "typeof( " << STRINGIFY(_TY_) << " )= " << lib::test::showType<_TY_>() <<endl;
64 #define SHOW_EXPR(_XX_) \
65  cout << "#--◆--# " << STRINGIFY(_XX_) << " ? = " << util::toString(_XX_) <<endl;
66 #define SHOW_EXPL(_XX_) \
67  cout << "#--◆--# " << STRINGIFY(_XX_) << " ? = " << boost::lexical_cast<string>(_XX_) <<endl;
68 
69 
70 #endif /*LIB_TEST_DIAGNOSTIC_OUTPUT_H*/
Automatically use custom string conversion in C++ stream output.
Definition: run.hpp:49
Implementation namespace for support and library code.
A collection of frequently used helper functions to support unit testing.