TPIE

11a2c2d
unittest.h
1 // -*- mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup"; -*-
2 // vi:set ts=4 sts=4 sw=4 noet :
3 // Copyright 2012, The TPIE development team
4 //
5 // This file is part of TPIE.
6 //
7 // TPIE is free software: you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the
9 // Free Software Foundation, either version 3 of the License, or (at your
10 // option) any later version.
11 //
12 // TPIE is distributed in the hope that it will be useful, but WITHOUT ANY
13 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with TPIE. If not, see <http://www.gnu.org/licenses/>
19 
20 #ifndef __TPIE_UNITTEST_H__
21 #define __TPIE_UNITTEST_H__
22 
23 #include <tpie/tpie_export.h>
24 #include <iostream>
25 #include <tpie/types.h>
26 #include <tpie/logstream.h>
27 #include <map>
28 #include <vector>
29 #include <boost/lexical_cast.hpp>
30 #include <algorithm>
31 #include <chrono>
32 #include <stack>
33 
34 namespace tpie {
35 
36 typedef std::chrono::high_resolution_clock test_clock;
37 typedef std::chrono::time_point<test_clock> test_time;
38 inline test_time test_now() {return test_clock::now();}
39 inline double test_millisecs(const test_time & from, const test_time & to) {
40  return std::chrono::duration_cast<std::chrono::duration<double, std::milli> >(to-from).count();
41 }
42 
43 inline double test_secs(const test_time & from, const test_time & to) {
44  return std::chrono::duration_cast<std::chrono::duration<double>>(to-from).count();
45 }
46 
47 class TPIE_EXPORT teststream_buf: public std::basic_streambuf<char, std::char_traits<char> > {
48 private:
49  const static size_t line_size = 2048;
50  char m_line[line_size];
51  bool m_new_line;
52 public:
54  virtual int overflow(int c = traits_type::eof());
55  void stateAlign();
56  virtual int sync();
57 };
58 
59 class TPIE_EXPORT teststream: public std::ostream {
60 private:
61  teststream_buf m_buff;
62  size_t failed;
63  size_t total;
64  test_time time;
65  bool do_time;
66 public:
67  teststream(bool do_time);
68  bool success();
69  friend void result_manip(teststream & s, bool success);
70 };
71 
72 template <class TP>
73 class testmanip {
74  void (*_f)(teststream&, TP);
75  TP _a;
76 public:
77  inline testmanip(void (*f)(teststream&, TP), TP a) : _f(f), _a(a) {}
78  inline friend std::ostream& operator<<(std::ostream& o, const testmanip<TP>& m) {
79  (*m._f)(static_cast<teststream&>(o), m._a);
80  return o;
81  }
82 };
83 
84 TPIE_EXPORT testmanip<bool> result(bool success);
85 TPIE_EXPORT testmanip<bool> success();
86 TPIE_EXPORT testmanip<bool> failure();
87 
88 #define TEST_ENSURE(cond, message) { \
89  if (! (cond) ) { \
90  tpie::log_error() << message \
91  << " (line " << __LINE__ << ")" << std::endl; \
92  return false; \
93  } \
94  }
95 
96 #define TEST_ENSURE_EQUALITY(_v1, _v2, message) { \
97  auto v1 = (_v1); \
98  auto v2 = (_v2); \
99  if ( !(v1 == v2) ) { \
100  tpie::log_error() << message \
101  << " (" << v1 << " != " << v2 \
102  << " line " << __LINE__ << ")" << std::endl; \
103  return false; \
104  } \
105  }
106 
107 #define TEST_FAIL(message) { \
108  tpie::log_error() << message \
109  << " (line " << __LINE__ << ")" << std::endl; \
110  return false; \
111  }
112 
113 
114 class tests;
115 
116 namespace bits {
117  class TPIE_EXPORT test_runner {
118  tests * t;
119  bool result;
120  test_time m_time;
121  public:
122  test_runner(tests * t, const std::string & name);
123 
124  void set_result(bool result);
125  void exception();
126 
127  ~test_runner();
128  };
129 } // namespace bits
130 
131 class TPIE_EXPORT tests {
132 public:
133  static const size_t lineLength = 79;
134 
135  tests(int argc, char ** argv, memory_size_type memory_limit=50);
136  virtual ~tests();
137 
138  template <typename T>
139  tests & setup(T t);
140 
141  template <typename T>
142  tests & finish(T t);
143 
144  template <typename T>
145  tests & test(T fct, const std::string & name);
146 
147  template <typename T, typename T1>
148  tests & test(T fct, const std::string & name,
149  const std::string & p1_name, T1 p1_default);
150 
151  template <typename T, typename T1, typename T2>
152  tests & test(T fct, const std::string & name,
153  const std::string & p1_name, T1 p1_default,
154  const std::string & p2_name, T2 p2_default);
155 
156  template <typename T, typename T1, typename T2, typename T3>
157  tests & test(T fct, const std::string & name,
158  const std::string & p1_name, T1 p1_default,
159  const std::string & p2_name, T2 p2_default,
160  const std::string & p3_name, T3 p3_default);
161 
162  template <typename T, typename T1, typename T2, typename T3, typename T4>
163  tests & test(T fct, const std::string & name,
164  const std::string & p1_name, T1 p1_default,
165  const std::string & p2_name, T2 p2_default,
166  const std::string & p3_name, T3 p3_default,
167  const std::string & p4_name, T4 p4_default);
168 
169  template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
170  tests & test(T fct, const std::string & name,
171  const std::string & p1_name, T1 p1_default,
172  const std::string & p2_name, T2 p2_default,
173  const std::string & p3_name, T3 p3_default,
174  const std::string & p4_name, T4 p4_default,
175  const std::string & p5_name, T5 p5_default);
176 
177  template <typename T>
178  tests & multi_test(T fct, const std::string & name);
179 
180  template <typename T, typename T1>
181  tests & multi_test(T fct, const std::string & name, const std::string & p1_name, T1 p1_default);
182 
183  template <typename T, typename T1, typename T2>
184  tests & multi_test(T fct, const std::string & name,
185  const std::string & p1_name, T1 p1_default,
186  const std::string & p2_name, T2 p2_default);
187 
188  template <typename T, typename T1, typename T2, typename T3>
189  tests & multi_test(T fct, const std::string & name,
190  const std::string & p1_name, T1 p1_default,
191  const std::string & p2_name, T2 p2_default,
192  const std::string & p3_name, T3 p3_default);
193 
194  template <typename T, typename T1, typename T2, typename T3, typename T4>
195  tests & multi_test(T fct, const std::string & name,
196  const std::string & p1_name, T1 p1_default,
197  const std::string & p2_name, T2 p2_default,
198  const std::string & p3_name, T3 p3_default,
199  const std::string & p4_name, T4 p4_default);
200 
201  template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
202  tests & multi_test(T fct, const std::string & name,
203  const std::string & p1_name, T1 p1_default,
204  const std::string & p2_name, T2 p2_default,
205  const std::string & p3_name, T3 p3_default,
206  const std::string & p4_name, T4 p4_default,
207  const std::string & p5_name, T5 p5_default);
208 
209  template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
210  tests & multi_test(T fct, const std::string & name,
211  const std::string & p1_name, T1 p1_default,
212  const std::string & p2_name, T2 p2_default,
213  const std::string & p3_name, T3 p3_default,
214  const std::string & p4_name, T4 p4_default,
215  const std::string & p5_name, T5 p5_default,
216  const std::string & p6_name, T6 p6_default);
217 
218 
219 
220  operator int();
221 protected:
222  virtual void build_information(std::ostream & o);
223 private:
224  void show_usage(std::ostream & o);
225 
226  struct func {
227  virtual void operator()() = 0;
228  virtual ~func() {}
229  };
230 
231  template <typename T>
232  struct func_impl: func {
233  T t;
234  func_impl(T t): t(t) {}
235  virtual void operator()() {t();}
236  };
237 
238 
239  struct test_log_target: public log_target {
240  test_log_target(std::ostream & os = std::cout)
241  : os(os)
242  , threshold(LOG_FATAL)
243  , bufferThreshold(LOG_FATAL)
244  , m_onNameLine(false)
245  , m_onBOL(true)
246  {
247  }
248 
249  ~test_log_target() {
250  if (!m_onBOL) os << std::endl;
251  }
252 
253  void set_test(const std::string & name) {
254  buffer.str("");
255  m_onNameLine = false;
256  m_name = name;
257  set_status(" ");
258  }
259 
260  void set_status(const std::string & status) {
261  if (m_onNameLine) {
262  os << '\r';
263  } else if (!m_onBOL) {
264  os << '\n';
265  }
266 
267  os << m_name << ' ';
268  const size_t maxNameSize = lineLength
269  - 2 // spaces before and after dots
270  - 6; // status message: "[STAT]"
271  if (maxNameSize > m_name.size()) os << std::string(maxNameSize-m_name.size(), '.');
272  os << ' ';
273 
274  os << '[' << status << ']' << std::flush;
275  m_onNameLine = true;
276  m_onBOL = false;
277  }
278 
279  void write_time(size_t n) {
280  os << " " << n << " ms" << std::flush;
281  }
282 
283  void log(log_level level, const char * buf, size_t n) {
284  if (!n) return;
285  if (level <= bufferThreshold) {
286  std::string prefix = LOG_DEBUG > bufferThreshold ? "" : (build_prefix(groups.size()) + " ");
287  std::string msg = prefix + std::string(buf, n);
288  buffer << msg;
289  }
290  if (level > threshold) return;
291  if (m_onNameLine) os << '\n';
292 
293  std::string prefix = LOG_DEBUG > threshold ? "" : (build_prefix(groups.size()) + " ");
294  std::string msg = prefix + std::string(buf, n);
295 
296  os << msg;
297  m_onNameLine = false;
298  m_onBOL = msg[msg.size()-1] == '\n' || msg[msg.size()-1] == '\r';
299  os << std::flush;
300  }
301 
302  void set_threshold(log_level level) {
303  threshold = level;
304  }
305 
306  void set_buffer_threshold(log_level level) {
307  bufferThreshold = level;
308  }
309 
310  void begin_group(const std::string & name) {
311  groups.push(name);
312  std::string msg = build_prefix(groups.size()-1) + "> " + "Entering " + name + '\n';
313 
314  if (LOG_DEBUG <= bufferThreshold) buffer << msg;
315  if (LOG_DEBUG > threshold) return;
316  if (m_onNameLine) os << '\n';
317 
318  os << msg << std::flush;
319  m_onNameLine = false;
320  m_onBOL = true;
321  }
322 
323  void end_group() {
324  std::string msg = build_prefix(groups.size()-1) + "x " + "Leaving " + groups.top() + '\n';
325  groups.pop();
326 
327  if (LOG_DEBUG <= bufferThreshold) buffer << msg;
328  if (LOG_DEBUG > threshold) return;
329  if (m_onNameLine) os << '\n';
330 
331  os << msg << std::flush;
332  m_onNameLine = false;
333  m_onBOL = true;
334  }
335 
336  std::stringstream buffer;
337  private:
338  std::string build_prefix(size_t size) {
339  return std::string(size, '|');
340  }
341 
342  std::stack<std::string> groups;
343  std::ostream & os;
344  log_level threshold;
345  log_level bufferThreshold;
346  bool m_onNameLine;
347  std::string m_name;
348  bool m_onBOL;
349  };
350 
351 
352  void start_test(const std::string & name);
353  void end_test(bool result, size_t time);
354 
355  template <typename T>
356  T get_arg(const std::string & name, T def) const;
357 
358  template <typename T>
359  std::string arg_str(const std::string & name, T def) const;
360 
361  bool bad, usage, version, do_time;
362  size_t tests_runned;
363  std::string exe_name;
364  std::string test_name;
365  bool testAll;
366  std::map<std::string, std::string> args;
367  memory_size_type memory_limit;
368  std::string current_name;
369  std::vector<func *> setups;
370  std::vector<func *> finishs;
371  test_log_target log;
372  std::vector<std::string> m_tests;
373 
374  friend class bits::test_runner;
375 };
376 
377 template <typename src, typename dst>
379  dst operator()(const src & s) {
380  return boost::lexical_cast<dst>(s);
381  }
382 };
383 
384 template <>
385 struct magic_cast_help<bool, std::string> {
386  std::string operator()(bool b) {
387  return b?"true":"false";
388  }
389 };
390 
391 template <>
392 struct magic_cast_help<std::string, bool> {
393  bool operator()(std::string v) {
394  std::transform(v.begin(), v.end(), v.begin(), tolower);
395  return v == "true" || v == "1" || v == "on" || v == "yes";
396  }
397 };
398 
399 template <typename dst, typename src>
400 dst magic_cast(const src & s) {
401  return magic_cast_help<src, dst>()(s);
402 }
403 
404 template <typename T>
405 struct get_arg_help {
406  T operator()(const std::map<std::string, std::string> & args, const std::string & name, T def) {
407  T arg=def;
408  try {
409  std::map<std::string, std::string>::const_iterator i=args.find(name);
410  if (i != args.end()) arg=magic_cast<T>(i->second);
411  } catch (std::bad_cast &) {
412  std::cerr << "The argument " << name << " has the wrong type" << std::endl;
413  }
414  return arg;
415  }
416 };
417 
418 template <>
419 struct get_arg_help<bool> {
420  bool operator()(const std::map<std::string, std::string> & args, const std::string & name, bool) {
421  return args.count(name) != 0;
422  }
423 };
424 
425 template <typename T>
426 T tests::get_arg(const std::string & name, T def) const {
427  return get_arg_help<T>()(args, name, def);
428 }
429 
430 template <typename T>
431 std::string tests::arg_str(const std::string & name, T def) const {
432  std::string dashes((name.size() == 1) ? 1 : 2, '-');
433  return std::string(" [")+dashes+name+" ARG (= "+magic_cast<std::string>(def)+")]";
434 }
435 
436 template <typename T>
437 tests & tests::test(T fct, const std::string & name) {
438  m_tests.push_back(name);
439  if (testAll || name == test_name) {
440  bits::test_runner t(this, name);
441  try {
442  t.set_result(fct());
443  } catch (...) {
444  t.exception();
445  }
446  }
447  return *this;
448 }
449 
450 template <typename T, typename T1>
451 tests & tests::test(T fct, const std::string & name, const std::string & p1_name, T1 p1_default) {
452  m_tests.push_back(name
453  + arg_str(p1_name, p1_default));
454  if (testAll || name == test_name) {
455  bits::test_runner t(this, name);
456  try {
457  t.set_result(fct(get_arg(p1_name, p1_default)));
458  } catch (...) {
459  t.exception();
460  }
461  }
462  return *this;
463 }
464 
465 
466 template <typename T, typename T1, typename T2>
467 tests & tests::test(T fct, const std::string & name, const std::string & p1_name, T1 p1_default, const std::string & p2_name, T2 p2_default) {
468  m_tests.push_back(name
469  + arg_str(p1_name, p1_default)
470  + arg_str(p2_name, p2_default));
471  if (testAll || name == test_name) {
472  bits::test_runner t(this, name);
473  try {
474  t.set_result(fct(get_arg(p1_name, p1_default),
475  get_arg(p2_name, p2_default)));
476  } catch (...) {
477  t.exception();
478  }
479  }
480  return *this;
481 }
482 
483 template <typename T, typename T1, typename T2, typename T3>
484 tests & tests::test(T fct, const std::string & name,
485  const std::string & p1_name, T1 p1_default,
486  const std::string & p2_name, T2 p2_default,
487  const std::string & p3_name, T3 p3_default) {
488  m_tests.push_back(name
489  + arg_str(p1_name, p1_default)
490  + arg_str(p2_name, p2_default)
491  + arg_str(p3_name, p3_default));
492  if (testAll || name == test_name) {
493  bits::test_runner t(this, name);
494  try {
495  t.set_result(fct(get_arg(p1_name, p1_default),
496  get_arg(p2_name, p2_default),
497  get_arg(p3_name, p3_default)));
498  } catch (...) {
499  t.exception();
500  }
501  }
502  return *this;
503 
504 }
505 
506 template <typename T, typename T1, typename T2, typename T3, typename T4>
507 tests & tests::test(T fct, const std::string & name,
508  const std::string & p1_name, T1 p1_default,
509  const std::string & p2_name, T2 p2_default,
510  const std::string & p3_name, T3 p3_default,
511  const std::string & p4_name, T4 p4_default) {
512  m_tests.push_back(name
513  + arg_str(p1_name, p1_default)
514  + arg_str(p2_name, p2_default)
515  + arg_str(p3_name, p3_default)
516  + arg_str(p4_name, p4_default));
517  if (testAll || name == test_name) {
518  bits::test_runner t(this, name);
519  try {
520  t.set_result(fct(get_arg(p1_name, p1_default),
521  get_arg(p2_name, p2_default),
522  get_arg(p3_name, p3_default),
523  get_arg(p4_name, p4_default)));
524  } catch (...) {
525  t.exception();
526  }
527  }
528  return *this;
529 }
530 
531 template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
532 tests & tests::test(T fct, const std::string & name,
533  const std::string & p1_name, T1 p1_default,
534  const std::string & p2_name, T2 p2_default,
535  const std::string & p3_name, T3 p3_default,
536  const std::string & p4_name, T4 p4_default,
537  const std::string & p5_name, T5 p5_default) {
538  m_tests.push_back(name
539  + arg_str(p1_name, p1_default)
540  + arg_str(p2_name, p2_default)
541  + arg_str(p3_name, p3_default)
542  + arg_str(p4_name, p4_default)
543  + arg_str(p5_name, p5_default));
544  if (testAll || name == test_name) {
545  bits::test_runner t(this, name);
546  try {
547  t.set_result(fct(get_arg(p1_name, p1_default),
548  get_arg(p2_name, p2_default),
549  get_arg(p3_name, p3_default),
550  get_arg(p4_name, p4_default),
551  get_arg(p5_name, p5_default)));
552  } catch (...) {
553  t.exception();
554  }
555  }
556  return *this;
557 }
558 
559 
560 template <typename T>
561 tests & tests::multi_test(T fct, const std::string & name) {
562  m_tests.push_back(name);
563  if (testAll || name == test_name) {
564  bits::test_runner t(this, name);
565  try {
566  teststream ts(do_time);
567  fct(ts);
568  t.set_result(ts.success());
569  } catch (...) {
570  t.exception();
571  }
572  }
573  return *this;
574 }
575 
576 template <typename T, typename T1>
577 tests & tests::multi_test(T fct, const std::string & name, const std::string & p1_name, T1 p1_default) {
578  m_tests.push_back(name+ arg_str(p1_name, p1_default));
579  if (testAll || name == test_name) {
580  bits::test_runner t(this, name);
581  try {
582  teststream ts(do_time);
583  fct(ts, get_arg(p1_name, p1_default));
584  t.set_result(ts.success());
585  } catch (...) {
586  t.exception();
587  }
588  }
589  return *this;
590 }
591 
592 template <typename T, typename T1, typename T2>
593 tests & tests::multi_test(T fct, const std::string & name,
594  const std::string & p1_name, T1 p1_default,
595  const std::string & p2_name, T2 p2_default) {
596  m_tests.push_back(name+
597  arg_str(p1_name, p1_default) +
598  arg_str(p2_name, p2_default));
599 
600  if (testAll || name == test_name) {
601  bits::test_runner t(this, name);
602  try {
603  teststream ts(do_time);
604  fct(ts,
605  get_arg(p1_name, p1_default),
606  get_arg(p2_name, p2_default));
607  t.set_result(ts.success());
608  } catch (...) {
609  t.exception();
610  }
611  }
612  return *this;
613 }
614 
615 template <typename T, typename T1, typename T2, typename T3>
616 tests & tests::multi_test(T fct, const std::string & name,
617  const std::string & p1_name, T1 p1_default,
618  const std::string & p2_name, T2 p2_default,
619  const std::string & p3_name, T3 p3_default) {
620  m_tests.push_back(name+
621  arg_str(p1_name, p1_default) +
622  arg_str(p2_name, p2_default) +
623  arg_str(p3_name, p3_default));
624 
625  if (testAll || name == test_name) {
626  bits::test_runner t(this, name);
627  try {
628  teststream ts(do_time);
629  fct(ts,
630  get_arg(p1_name, p1_default),
631  get_arg(p2_name, p2_default),
632  get_arg(p3_name, p3_default));
633  t.set_result(ts.success());
634  } catch (...) {
635  t.exception();
636  }
637  }
638  return *this;
639 }
640 
641 template <typename T, typename T1, typename T2, typename T3, typename T4>
642 tests & tests::multi_test(T fct, const std::string & name,
643  const std::string & p1_name, T1 p1_default,
644  const std::string & p2_name, T2 p2_default,
645  const std::string & p3_name, T3 p3_default,
646  const std::string & p4_name, T4 p4_default) {
647  m_tests.push_back(name+
648  arg_str(p1_name, p1_default) +
649  arg_str(p2_name, p2_default) +
650  arg_str(p3_name, p3_default) +
651  arg_str(p4_name, p4_default));
652 
653  if (testAll || name == test_name) {
654  bits::test_runner t(this, name);
655  try {
656  teststream ts(do_time);
657  fct(ts,
658  get_arg(p1_name, p1_default),
659  get_arg(p2_name, p2_default),
660  get_arg(p3_name, p3_default),
661  get_arg(p4_name, p4_default));
662  t.set_result(ts.success());
663  } catch (...) {
664  t.exception();
665  }
666  }
667  return *this;
668 }
669 
670 template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
671 tests & tests::multi_test(T fct, const std::string & name,
672  const std::string & p1_name, T1 p1_default,
673  const std::string & p2_name, T2 p2_default,
674  const std::string & p3_name, T3 p3_default,
675  const std::string & p4_name, T4 p4_default,
676  const std::string & p5_name, T5 p5_default) {
677  m_tests.push_back(name+
678  arg_str(p1_name, p1_default) +
679  arg_str(p2_name, p2_default) +
680  arg_str(p3_name, p3_default) +
681  arg_str(p4_name, p4_default) +
682  arg_str(p5_name, p5_default));
683 
684  if (testAll || name == test_name) {
685  bits::test_runner t(this, name);
686  try {
687  teststream ts(do_time);
688  fct(ts,
689  get_arg(p1_name, p1_default),
690  get_arg(p2_name, p2_default),
691  get_arg(p3_name, p3_default),
692  get_arg(p4_name, p4_default),
693  get_arg(p5_name, p5_default));
694  t.set_result(ts.success());
695  } catch (...) {
696  t.exception();
697  }
698  }
699  return *this;
700 }
701 
702 template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
703 tests & tests::multi_test(T fct, const std::string & name,
704  const std::string & p1_name, T1 p1_default,
705  const std::string & p2_name, T2 p2_default,
706  const std::string & p3_name, T3 p3_default,
707  const std::string & p4_name, T4 p4_default,
708  const std::string & p5_name, T5 p5_default,
709  const std::string & p6_name, T6 p6_default) {
710  m_tests.push_back(name+
711  arg_str(p1_name, p1_default) +
712  arg_str(p2_name, p2_default) +
713  arg_str(p3_name, p3_default) +
714  arg_str(p4_name, p4_default) +
715  arg_str(p5_name, p5_default) +
716  arg_str(p6_name, p6_default));
717 
718  if (testAll || name == test_name) {
719  bits::test_runner t(this, name);
720  try {
721  teststream ts(do_time);
722  fct(ts,
723  get_arg(p1_name, p1_default),
724  get_arg(p2_name, p2_default),
725  get_arg(p3_name, p3_default),
726  get_arg(p4_name, p4_default),
727  get_arg(p5_name, p5_default),
728  get_arg(p6_name, p6_default));
729  t.set_result(ts.success());
730  } catch (...) {
731  t.exception();
732  }
733  }
734  return *this;
735 }
736 
737 template <typename T>
738 tests & tests::setup(T t) {
739  setups.push_back(new func_impl<T>(t));
740  return *this;
741 }
742 
743 template <typename T>
744 tests & tests::finish(T t) {
745  finishs.push_back(new func_impl<T>(t));
746  return *this;
747 }
748 
749 } //namespace tpie
750 
751 #endif // __TPIE_UNITTEST_H__
tpie::magic_cast_help
Definition: unittest.h:378
types.h
tpie::log_level
log_level
TPIE logging levels, from higest priority to lowest.
Definition: loglevel.h:33
tpie::LOG_FATAL
@ LOG_FATAL
LOG_FATAL is the highest error level and is used for all kinds of errors that would normally impair s...
Definition: loglevel.h:37
tpie::teststream_buf
Definition: unittest.h:47
tpie::bits::test_runner
Definition: unittest.h:117
tpie::teststream
Definition: unittest.h:59
tpie::exception
Definition: exception.h:33
tpie::tests
Definition: unittest.h:131
tpie::pipelining::buffer
pipe_middle< split_factory< bits::buffer_input_t, node, bits::buffer_output_t > > buffer
The buffer node inserts a phase boundary into the pipeline by writing items to disk.
Definition: buffer.h:205
tpie::testmanip
Definition: unittest.h:73
tpie::LOG_DEBUG
@ LOG_DEBUG
LOG_DEBUG is the lowest level and is used by the TPIE library for logging debugging information.
Definition: loglevel.h:54
tpie::log_target
Definition: logstream.h:41
tpie::get_arg_help
Definition: unittest.h:405
logstream.h
tpie
Definition: access_type.h:26