Advertisement
Guest User

Untitled

a guest
May 4th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. class customListener : public testing::EmptyTestEventListener
  2. {
  3. customListener(int *iteration) : m_iteration(iteration) {}
  4.  
  5. virtual void OnTestIterationStart(const testing::UnitTest& unit_test, int iteration)
  6. {
  7. *m_iteration = iteration;
  8. }
  9. }
  10.  
  11. int g_iteration;
  12.  
  13. int main(int argc, char **argv)
  14. {
  15. testing::InitGoogleTest(&argc, argv);
  16.  
  17. if(argc > 1)
  18. g_array_length = atoi(argv[1]);
  19.  
  20. testing::TestEventListeners& listners = testing::UnitTest::GetInstance()->listeners();
  21. listners.Append(new printers::customListener(&g_iteration));
  22.  
  23. return RUN_ALL_TESTS();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement