Bug #1029
cout and gdb for unit tests
0%
Description
In the process of writing unit tests I find my code generates seg faults. OK, sort of good, thats what the tests are for. The tests however suppress all cout output from the code they are testing, and will not cout themselves either. GDB also will not run over the unit test executable. Valgrind will, which is helpful, but does not always give line numbers. By and large the lack of couts make it extremely difficult to track the cause of the seg faults (is the test environment causing the problem, is the main code flawed, if so where, etc). Can anything be done about this? Thanks.
Updated by Dobbs, Adam over 11 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Ah, cerr does work, fantastic. Thanks Chris.
Updated by Rogers, Chris over 11 years ago
- Status changed from Closed to Open
- Target version set to Future MAUS release
- % Done changed from 100 to 0
Yes, I thought cout works as well - maybe I forgot to reset it properly in a test. Let me check...
Updated by Rogers, Chris over 11 years ago
Ah no, I disabled cout because of all the Geant4 junk that obscures the test output...
Updated by Rogers, Chris over 11 years ago
- Status changed from Open to Rejected
I'll just reject the bug but I might be able to do something if its really irritating.
Updated by Dobbs, Adam over 11 years ago
I'm satisfied. cout-ing everything would produce a mess, whereas now I can just add cerr as needed specifically for the tests.