Advertisement
Alaricy

шаблон рантест

Dec 1st, 2022 (edited)
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. template <typename Func>
  7. void RunTestImpl(const Func& fnc, const string& funcstr) {
  8.     fnc();
  9.     cerr <<funcstr<<":OK"<<endl;    
  10. }
  11.  
  12. #define RUN_TEST(func)  RunTestImpl((func),#func)
  13.  
  14. void Test1() {
  15. //cerr << "Всякое успешное тестирование: ";
  16. }
  17.  
  18. int main() {
  19.     RUN_TEST(Test1);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement