libept
tests.h
Go to the documentation of this file.
1 #ifndef EPT_TESTS_H
2 #define EPT_TESTS_H
3 
12 #include <string>
13 #include <sstream>
14 #include <exception>
15 #include <functional>
16 #include <vector>
17 
18 namespace ept {
19 namespace tests {
20 struct LocationInfo;
21 }
22 }
23 
24 /*
25  * These global arguments will be shadowed by local variables in functions that
26  * implement tests.
27  *
28  * They are here to act as default root nodes to fulfill method signatures when
29  * tests are called from outside other tests.
30  */
32 
33 namespace ept {
34 namespace tests {
35 
53 struct LocationInfo : public std::stringstream
54 {
56 
61  std::ostream& operator()();
62 };
63 
66 {
67  const char* file;
68  int line;
69  const char* call;
70  std::string local_info;
71 
72  TestStackFrame(const char* file, int line, const char* call)
73  : file(file), line(line), call(call)
74  {
75  }
76 
77  TestStackFrame(const char* file, int line, const char* call, const LocationInfo& local_info)
78  : file(file), line(line), call(call), local_info(local_info.str())
79  {
80  }
81 
82  std::string format() const;
83 
84  void format(std::ostream& out) const;
85 };
86 
87 struct TestStack : public std::vector<TestStackFrame>
88 {
89  using vector::vector;
90 
92  std::string backtrace() const;
93 
95  void backtrace(std::ostream& out) const;
96 };
97 
102 struct TestFailed : public std::exception
103 {
104  std::string message;
106 
107  TestFailed(const std::exception& e);
108 
109  template<typename ...Args>
110  TestFailed(const std::exception& e, Args&&... args)
111  : TestFailed(e)
112  {
113  add_stack_info(std::forward<Args>(args)...);
114  }
115 
116  TestFailed(const std::string& message) : message(message) {}
117 
118  template<typename ...Args>
119  TestFailed(const std::string& message, Args&&... args)
120  : TestFailed(message)
121  {
122  add_stack_info(std::forward<Args>(args)...);
123  }
124 
125  const char* what() const noexcept override { return message.c_str(); }
126 
127  template<typename ...Args>
128  void add_stack_info(Args&&... args) { stack.emplace_back(std::forward<Args>(args)...); }
129 };
130 
135 #define EPT_TEST_INFO(name) \
136  ept::tests::LocationInfo ept_test_location_info; \
137  ept::tests::LocationInfo& name = ept_test_location_info
138 
139 
141 template<typename A>
142 void assert_true(const A& actual)
143 {
144  if (actual) return;
145  std::stringstream ss;
146  ss << "actual value " << actual << " is not true";
147  throw TestFailed(ss.str());
148 };
149 
150 void assert_true(std::nullptr_t actual);
151 
153 template<typename A>
154 void assert_false(const A& actual)
155 {
156  if (!actual) return;
157  std::stringstream ss;
158  ss << "actual value " << actual << " is not false";
159  throw TestFailed(ss.str());
160 };
161 
162 void assert_false(std::nullptr_t actual);
163 
168 template<typename A, typename E>
169 void assert_equal(const A& actual, const E& expected)
170 {
171  if (actual == expected) return;
172  std::stringstream ss;
173  ss << "value '" << actual << "' is different than the expected '" << expected << "'";
174  throw TestFailed(ss.str());
175 }
176 
181 template<typename A, typename E>
182 void assert_not_equal(const A& actual, const E& expected)
183 {
184  if (actual != expected) return;
185  std::stringstream ss;
186  ss << "value '" << actual << "' is not different than the expected '" << expected << "'";
187  throw TestFailed(ss.str());
188 }
189 
191 template<typename A, typename E>
192 void assert_less(const A& actual, const E& expected)
193 {
194  if (actual < expected) return;
195  std::stringstream ss;
196  ss << "value '" << actual << "' is not less than the expected '" << expected << "'";
197  throw TestFailed(ss.str());
198 }
199 
201 template<typename A, typename E>
202 void assert_less_equal(const A& actual, const E& expected)
203 {
204  if (actual <= expected) return;
205  std::stringstream ss;
206  ss << "value '" << actual << "' is not less than or equals to the expected '" << expected << "'";
207  throw TestFailed(ss.str());
208 }
209 
211 template<typename A, typename E>
212 void assert_greater(const A& actual, const E& expected)
213 {
214  if (actual > expected) return;
215  std::stringstream ss;
216  ss << "value '" << actual << "' is not greater than the expected '" << expected << "'";
217  throw TestFailed(ss.str());
218 }
219 
221 template<typename A, typename E>
222 void assert_greater_equal(const A& actual, const E& expected)
223 {
224  if (actual >= expected) return;
225  std::stringstream ss;
226  ss << "value '" << actual << "' is not greater than or equals to the expected '" << expected << "'";
227  throw TestFailed(ss.str());
228 }
229 
231 void assert_startswith(const std::string& actual, const std::string& expected);
232 
234 void assert_endswith(const std::string& actual, const std::string& expected);
235 
237 void assert_contains(const std::string& actual, const std::string& expected);
238 
240 void assert_not_contains(const std::string& actual, const std::string& expected);
241 
248 void assert_re_matches(const std::string& actual, const std::string& expected);
249 
256 void assert_not_re_matches(const std::string& actual, const std::string& expected);
257 
258 
259 template<class A>
260 struct Actual
261 {
263  Actual(const A& actual) : _actual(actual) {}
264  ~Actual() {}
265 
266  void istrue() const { assert_true(_actual); }
267  void isfalse() const { assert_false(_actual); }
268  template<typename E> void operator==(const E& expected) const { assert_equal(_actual, expected); }
269  template<typename E> void operator!=(const E& expected) const { assert_not_equal(_actual, expected); }
270  template<typename E> void operator<(const E& expected) const { return assert_less(_actual, expected); }
271  template<typename E> void operator<=(const E& expected) const { return assert_less_equal(_actual, expected); }
272  template<typename E> void operator>(const E& expected) const { return assert_greater(_actual, expected); }
273  template<typename E> void operator>=(const E& expected) const { return assert_greater_equal(_actual, expected); }
274 };
275 
277 {
278  const char* _actual;
279  ActualCString(const char* s) : _actual(s) {}
280 
281  void istrue() const { return assert_true(_actual); }
282  void isfalse() const { return assert_false(_actual); }
283  void operator==(const char* expected) const;
284  void operator==(const std::string& expected) const;
285  void operator!=(const char* expected) const;
286  void operator!=(const std::string& expected) const;
287  void operator<(const std::string& expected) const;
288  void operator<=(const std::string& expected) const;
289  void operator>(const std::string& expected) const;
290  void operator>=(const std::string& expected) const;
291  void startswith(const std::string& expected) const;
292  void endswith(const std::string& expected) const;
293  void contains(const std::string& expected) const;
294  void not_contains(const std::string& expected) const;
295  void matches(const std::string& re) const;
296  void not_matches(const std::string& re) const;
297 };
298 
299 struct ActualStdString : public Actual<std::string>
300 {
301  ActualStdString(const std::string& s) : Actual<std::string>(s) {}
302 
303  void startswith(const std::string& expected) const;
304  void endswith(const std::string& expected) const;
305  void contains(const std::string& expected) const;
306  void not_contains(const std::string& expected) const;
307  void matches(const std::string& re) const;
308  void not_matches(const std::string& re) const;
309 };
310 
311 struct ActualDouble : public Actual<double>
312 {
313  using Actual::Actual;
314 
315  void almost_equal(double expected, unsigned places) const;
316  void not_almost_equal(double expected, unsigned places) const;
317 };
318 
319 template<typename A>
320 inline Actual<A> actual(const A& actual) { return Actual<A>(actual); }
321 inline ActualCString actual(const char* actual) { return ActualCString(actual); }
322 inline ActualCString actual(char* actual) { return ActualCString(actual); }
323 inline ActualStdString actual(const std::string& actual) { return ActualStdString(actual); }
324 inline ActualDouble actual(double actual) { return ActualDouble(actual); }
325 
326 struct ActualFunction : public Actual<std::function<void()>>
327 {
328  using Actual::Actual;
329 
330  void throws(const std::string& what_match) const;
331 };
332 
333 inline ActualFunction actual_function(std::function<void()> actual) { return ActualFunction(actual); }
334 
335 
343 #define wassert(...) \
344  do { try { \
345  __VA_ARGS__ ; \
346  } catch (TestFailed& e) { \
347  e.add_stack_info(__FILE__, __LINE__, #__VA_ARGS__, ept_test_location_info); \
348  throw; \
349  } catch (std::exception& e) { \
350  throw TestFailed(e, __FILE__, __LINE__, #__VA_ARGS__, ept_test_location_info); \
351  } } while(0)
352 
354 #define wassert_true(...) wassert(actual(__VA_ARGS__).istrue())
355 
357 #define wassert_false(...) wassert(actual(__VA_ARGS__).isfalse())
358 
366 #define wcallchecked(func) \
367  [&]() { try { \
368  return func; \
369  } catch (TestFailed& e) { \
370  e.add_stack_info(__FILE__, __LINE__, #func, ept_test_location_info); \
371  throw; \
372  } catch (std::exception& e) { \
373  throw TestFailed(e, __FILE__, __LINE__, #func, ept_test_location_info); \
374  } }()
375 
376 
377 struct TestCase;
378 
383 {
385  std::string test_case;
386 
388  std::string test_method;
389 
391  std::string error_message;
392 
395 
397  std::string exception_typeid;
398 
400  bool skipped = false;
401 
402 
403  TestMethodResult(const std::string& test_case, const std::string& test_method)
404  : test_case(test_case), test_method(test_method) {}
405 
407  {
408  error_message = e.what();
409  error_stack = e.stack;
410  if (error_message.empty())
411  error_message = "test failed with an empty error message";
412  }
413 
414  void set_exception(std::exception& e)
415  {
416  error_message = e.what();
417  if (error_message.empty())
418  error_message = "test threw an exception with an empty error message";
419  exception_typeid = typeid(e).name();
420  }
421 
423  {
424  error_message = "unknown exception caught";
425  }
426 
427  void set_setup_exception(std::exception& e)
428  {
429  error_message = "[setup failed: ";
430  error_message += e.what();
431  error_message += "]";
432  }
433 
434  void set_teardown_exception(std::exception& e)
435  {
436  error_message = "[teardown failed: ";
437  error_message += e.what();
438  error_message += "]";
439  }
440 
441  bool is_success() const
442  {
443  return error_message.empty();
444  }
445 };
446 
451 {
453  std::string test_case;
455  std::vector<TestMethodResult> methods;
457  std::string fail_setup;
460  std::string fail_teardown;
462  bool skipped = false;
463 
464  TestCaseResult(const std::string& test_case) : test_case(test_case) {}
465 
467  {
468  fail_setup = "test case setup method threw an unknown exception";
469  }
470 
471  void set_setup_failed(std::exception& e)
472  {
473  fail_setup = "test case setup method threw an exception: ";
474  fail_setup += e.what();
475  }
476 
478  {
479  fail_teardown = "test case teardown method threw an unknown exception";
480  }
481 
482  void set_teardown_failed(std::exception& e)
483  {
484  fail_teardown = "test case teardown method threw an exception: ";
485  fail_teardown += e.what();
486  }
487 
489  {
490  methods.emplace_back(std::move(e));
491  }
492 
493  bool is_success() const
494  {
495  if (!fail_setup.empty() || !fail_teardown.empty()) return false;
496  for (const auto& m: methods)
497  if (!m.is_success())
498  return false;
499  return true;
500  }
501 };
502 
503 struct TestCase;
504 struct TestCaseResult;
505 struct TestMethod;
506 struct TestMethodResult;
507 
515 {
516  virtual ~TestController() {}
517 
523  virtual bool test_case_begin(const TestCase& test_case, const TestCaseResult& test_case_result) { return true; }
524 
528  virtual void test_case_end(const TestCase& test_case, const TestCaseResult& test_case_result) {}
529 
535  virtual bool test_method_begin(const TestMethod& test_method, const TestMethodResult& test_method_result) { return true; }
536 
540  virtual void test_method_end(const TestMethod& test_method, const TestMethodResult& test_method_result) {}
541 };
542 
550 {
552  std::string whitelist;
553 
555  std::string blacklist;
556 
557  bool test_case_begin(const TestCase& test_case, const TestCaseResult& test_case_result) override;
558  void test_case_end(const TestCase& test_case, const TestCaseResult& test_case_result) override;
559  bool test_method_begin(const TestMethod& test_method, const TestMethodResult& test_method_result) override;
560  void test_method_end(const TestMethod& test_method, const TestMethodResult& test_method_result) override;
561 
562  bool test_method_should_run(const std::string& fullname) const;
563 };
564 
565 
573 {
575  std::vector<TestCase*> entries;
576 
583  void register_test_case(TestCase& test_case);
584 
588  std::vector<TestCaseResult> run_tests(TestController& controller);
589 
591  static TestRegistry& get();
592 };
593 
598 {
600  std::string name;
601 
603  std::function<void()> test_function;
604 
605  TestMethod(const std::string& name, std::function<void()> test_function)
606  : name(name), test_function(test_function) {}
607 };
608 
609 
614 struct TestCase
615 {
617  std::string name;
618 
620  std::vector<TestMethod> methods;
621 
622  TestCase(const std::string& name)
623  : name(name)
624  {
626  }
627  virtual ~TestCase() {}
628 
636  virtual void register_tests() = 0;
637 
641  virtual void setup() {}
642 
646  virtual void teardown() {}
647 
651  virtual void method_setup(TestMethodResult&) {}
652 
657 
665  virtual TestCaseResult run_tests(TestController& controller);
666 
679  virtual TestMethodResult run_test(TestController& controller, TestMethod& method);
680 
684  template<typename ...Args>
685  void add_method(const std::string& name, std::function<void()> test_function)
686  {
687  methods.emplace_back(name, test_function);
688  }
689 
693  template<typename ...Args>
694  void add_method(const std::string& name, std::function<void()> test_function, Args&&... args)
695  {
696  methods.emplace_back(name, test_function, std::forward<Args>(args)...);
697  }
698 
704  template<typename FUNC, typename ...Args>
705  void add_method(const std::string& name, FUNC test_function, Args&&... args)
706  {
707  methods.emplace_back(name, [test_function, args...]() { test_function(args...); });
708  }
709 };
710 
711 
722 struct Fixture
723 {
724  virtual ~Fixture() {}
725 
726  // Called before each test
727  virtual void test_setup() {}
728 
729  // Called after each test
730  virtual void test_teardown() {}
731 };
732 
736 template<typename FIXTURE>
737 struct FixtureTestCase : public TestCase
738 {
739  typedef FIXTURE Fixture;
740 
741  Fixture* fixture = 0;
742  std::function<Fixture*()> make_fixture;
743 
744  template<typename... Args>
745  FixtureTestCase(const std::string& name, Args... args)
746  : TestCase(name)
747  {
748  make_fixture = [=]() { return new Fixture(args...); };
749  }
750 
751  void setup() override
752  {
753  TestCase::setup();
754  fixture = make_fixture();
755  }
756 
757  void teardown() override
758  {
759  delete fixture;
760  fixture = 0;
762  }
763 
764  void method_setup(TestMethodResult& mr) override
765  {
767  if (fixture) fixture->test_setup();
768  }
769 
771  {
772  if (fixture) fixture->test_teardown();
774  }
775 
782  template<typename FUNC, typename ...Args>
783  void add_method(const std::string& name, FUNC test_function, Args&&... args)
784  {
785  methods.emplace_back(name, [this, test_function, args...] { test_function(*fixture, args...); });
786  }
787 };
788 
789 #if 0
790  struct Test
791  {
792  std::string name;
793  std::function<void()> test_func;
794  };
795 
797  virtual void add_tests() {}
798 #endif
799 
800 
801 }
802 }
803 
804 #endif
virtual bool test_case_begin(const TestCase &test_case, const TestCaseResult &test_case_result)
Called before running a test case.
Definition: tests.h:523
void isfalse() const
Definition: tests.h:267
TestCase(const std::string &name)
Definition: tests.h:622
static TestRegistry & get()
Get the singleton instance of TestRegistry.
Definition: tests.cc:420
Definition: tests.h:326
TestFailed(const std::string &message)
Definition: tests.h:116
std::string test_case
Name of the test case.
Definition: tests.h:385
Definition: tests.h:260
Simple default implementation of TestController.
Definition: tests.h:549
virtual void test_method_end(const TestMethod &test_method, const TestMethodResult &test_method_result)
Called after running a test method.
Definition: tests.h:540
LocationInfo()
Definition: tests.h:55
FIXTURE Fixture
Definition: tests.h:739
void add_method(const std::string &name, std::function< void()> test_function)
Register a new test method.
Definition: tests.h:685
const char * file
Definition: tests.h:67
Definition: tests.h:299
virtual ~TestController()
Definition: tests.h:516
std::string error_message
If non-empty, the test failed with this error.
Definition: tests.h:391
ActualStdString(const std::string &s)
Definition: tests.h:301
bool is_success() const
Definition: tests.h:493
const char * _actual
Definition: tests.h:278
void assert_equal(const A &actual, const E &expected)
Test function that ensures that the actual value is the same as a reference one.
Definition: tests.h:169
TestMethod(const std::string &name, std::function< void()> test_function)
Definition: tests.h:605
TestStackFrame(const char *file, int line, const char *call)
Definition: tests.h:72
bool is_success() const
Definition: tests.h:441
Definition: packagerecord-test.cc:4
virtual bool test_method_begin(const TestMethod &test_method, const TestMethodResult &test_method_result)
Called before running a test method.
Definition: tests.h:535
void set_setup_exception(std::exception &e)
Definition: tests.h:427
void set_exception(std::exception &e)
Definition: tests.h:414
String functions.
Definition: apt.cc:38
void isfalse() const
Definition: tests.h:282
TestStack error_stack
Stack frame of where the error happened.
Definition: tests.h:394
void assert_not_contains(const std::string &actual, const std::string &expected)
Ensure that the string actual does not contain expected.
Definition: tests.cc:132
virtual void test_setup()
Definition: tests.h:727
void assert_less_equal(const A &actual, const E &expected)
Ensure that the actual value is less or equal than the reference value.
Definition: tests.h:202
const char * call
Definition: tests.h:69
void operator>=(const E &expected) const
Definition: tests.h:273
std::string local_info
Definition: tests.h:70
void set_setup_failed(std::exception &e)
Definition: tests.h:471
Base class for test fixtures.
Definition: tests.h:722
void set_setup_failed()
Definition: tests.h:466
TestStack stack
Definition: tests.h:105
Definition: tests.h:276
void operator!=(const E &expected) const
Definition: tests.h:269
void set_teardown_exception(std::exception &e)
Definition: tests.h:434
void istrue() const
Definition: tests.h:266
void assert_not_re_matches(const std::string &actual, const std::string &expected)
Ensure that the string actual does not match the extended regular expression expected.
Definition: tests.cc:185
void assert_greater_equal(const A &actual, const E &expected)
Ensure that the actual value is greather or equal than the reference value.
Definition: tests.h:222
std::string exception_typeid
If non-empty, the test raised an exception and this is its type ID.
Definition: tests.h:397
Abstract interface for the objects that supervise test execution.
Definition: tests.h:514
FixtureTestCase(const std::string &name, Args... args)
Definition: tests.h:745
std::vector< TestMethodResult > methods
Outcome of all the methods that have been run.
Definition: tests.h:455
Result of running a test method.
Definition: tests.h:382
virtual ~TestCase()
Definition: tests.h:627
virtual void test_case_end(const TestCase &test_case, const TestCaseResult &test_case_result)
Called after running a test case.
Definition: tests.h:528
Test case that includes a fixture.
Definition: tests.h:737
std::string message
Definition: tests.h:104
void assert_not_equal(const A &actual, const E &expected)
Test function that ensures that the actual value is different than a reference one.
Definition: tests.h:182
std::string test_case
Name of the test case.
Definition: tests.h:453
A _actual
Definition: tests.h:262
TestMethodResult(const std::string &test_case, const std::string &test_method)
Definition: tests.h:403
void operator<=(const E &expected) const
Definition: tests.h:271
std::function< void()> test_function
Main body of the test method.
Definition: tests.h:603
Test method information.
Definition: tests.h:597
virtual void method_setup(TestMethodResult &)
Set up before the test method is run.
Definition: tests.h:651
void assert_startswith(const std::string &actual, const std::string &expected)
Ensure that the string actual starts with expected.
Definition: tests.cc:108
void set_teardown_failed(std::exception &e)
Definition: tests.h:482
TestFailed(const std::string &message, Args &&... args)
Definition: tests.h:119
Definition: tests.h:87
Information about one stack frame in the test execution stack.
Definition: tests.h:65
TestFailed(const std::exception &e, Args &&... args)
Definition: tests.h:110
std::string name
Name of the test case.
Definition: tests.h:617
~Actual()
Definition: tests.h:264
std::vector< TestMethod > methods
All registered test methods.
Definition: tests.h:620
std::function< Fixture *()> make_fixture
Definition: tests.h:742
void assert_endswith(const std::string &actual, const std::string &expected)
Ensure that the string actual ends with expected.
Definition: tests.cc:116
void operator==(const E &expected) const
Definition: tests.h:268
bool operator<=(const T &a, const std::set< T > &b)
Definition: operators.h:177
void add_stack_info(Args &&... args)
Definition: tests.h:128
void teardown() override
Clean up after the test case is run.
Definition: tests.h:757
void register_test_case(TestCase &test_case)
Register a new test case.
Definition: tests.cc:428
std::vector< TestCase * > entries
All known test cases.
Definition: tests.h:575
void assert_true(std::nullptr_t actual)
Definition: tests.cc:194
void setup() override
Set up the test case before it is run.
Definition: tests.h:751
Actual(const A &actual)
Definition: tests.h:263
void assert_contains(const std::string &actual, const std::string &expected)
Ensure that the string actual contains expected.
Definition: tests.cc:124
void istrue() const
Definition: tests.h:281
Actual< A > actual(const A &actual)
Definition: tests.h:320
void assert_greater(const A &actual, const E &expected)
Ensure that the actual value is greater than the reference value.
Definition: tests.h:212
void assert_false(std::nullptr_t actual)
Definition: tests.cc:199
int line
Definition: tests.h:68
Add information to the test backtrace for the tests run in the current scope.
Definition: tests.h:53
virtual ~Fixture()
Definition: tests.h:724
void add_method(const std::string &name, FUNC test_function, Args &&... args)
Register a new test metheod, with arguments.
Definition: tests.h:705
std::string fail_teardown
Set to a non-empty string if the teardown method of the test case failed.
Definition: tests.h:460
std::string whitelist
Any method not matching this glob expression will not be run.
Definition: tests.h:552
void assert_re_matches(const std::string &actual, const std::string &expected)
Ensure that the string actual matches the extended regular expression expected.
Definition: tests.cc:176
void method_teardown(TestMethodResult &mr) override
Clean up after the test method is run.
Definition: tests.h:770
virtual void setup()
Set up the test case before it is run.
Definition: tests.h:641
std::string name
Name of the test method.
Definition: tests.h:600
virtual void test_teardown()
Definition: tests.h:730
virtual void teardown()
Clean up after the test case is run.
Definition: tests.h:646
void add_method(const std::string &name, std::function< void()> test_function, Args &&... args)
Register a new test method.
Definition: tests.h:694
void set_failed(TestFailed &e)
Definition: tests.h:406
bool endswith(const std::string &str, const std::string &part)
Check if a string ends with the given substring.
Definition: string.h:28
void set_unknown_exception()
Definition: tests.h:422
std::string test_method
Name of the test method.
Definition: tests.h:388
struct ept::apt::AptImplementation tests
void method_setup(TestMethodResult &mr) override
Set up before the test method is run.
Definition: tests.h:764
TestCaseResult(const std::string &test_case)
Definition: tests.h:464
Definition: tests.h:311
std::string fail_setup
Set to a non-empty string if the setup method of the test case failed.
Definition: tests.h:457
ActualFunction actual_function(std::function< void()> actual)
Definition: tests.h:333
void operator<(const E &expected) const
Definition: tests.h:270
TestStackFrame(const char *file, int line, const char *call, const LocationInfo &local_info)
Definition: tests.h:77
void assert_less(const A &actual, const E &expected)
Ensure that the actual value is less than the reference value.
Definition: tests.h:192
Result of running a whole test case.
Definition: tests.h:450
void add_method(const std::string &name, FUNC test_function, Args &&... args)
Add a method that takes a reference to the fixture as argument.
Definition: tests.h:783
bool startswith(const std::string &str, const std::string &part)
Check if a string starts with the given substring.
Definition: string.h:20
void operator>(const E &expected) const
Definition: tests.h:272
void add_test_method(TestMethodResult &&e)
Definition: tests.h:488
Exception raised when a test assertion fails, normally by Location::fail_test.
Definition: tests.h:102
virtual void method_teardown(TestMethodResult &)
Clean up after the test method is run.
Definition: tests.h:656
std::string blacklist
Any method matching this glob expression will not be run.
Definition: tests.h:555
const ept::tests::LocationInfo ept_test_location_info
Definition: tests.cc:20
void register_tests() override
Definition: apt-test.cc:4
Test case collecting several test methods, and self-registering with the singleton instance of TestRe...
Definition: tests.h:614
const char * what() const noexcept override
Definition: tests.h:125
void set_teardown_failed()
Definition: tests.h:477
ActualCString(const char *s)
Definition: tests.h:279
Test registry.
Definition: tests.h:572