1

This test is PASSING, but when run under valgrind, it is HANGING.

  void testingRaiseSignal() {                                                                                             
    std::raise(SIGTERM);                                                                                                  
  }                                                                                                                       
  TEST(expectexittest, ishanging) {                                                                                       
    EXPECT_EXIT(testingRaiseSignal(), ::testing::KilledBySignal(SIGTERM), "");                                            
  } 

Can you explain why it it hanging only under valgrind?

Michal
  • 2,078
  • 19
  • 29
  • A bug in Valgrind ? A bug in your test (e.g. because of Valgrind slow down ) ? It looks better to file a bug on Valgrind, with the detailed instructions about how to reproduce it (and preferrably, a small compilable C program) – phd Jul 23 '17 at 11:32
  • Bug in the test? Do you see any bugs in this code? I still doubt it's valgrind bug, I suspect it has more with how gtest EXPECT_EXIT works.. – Michal Jul 24 '17 at 13:08
  • Interpret 'your test' as 'the whole closure used by your test, including the test tool, the used libraries; the OS and the hardware'. That being said, Valgrind is not supposed to change the behaviour of a program, except the timinig. So, you should file a bug on valgrind bugzilla, giving the relevant details and preferably a small compilable C program. – phd Jul 25 '17 at 20:08

0 Answers0