-
Notifications
You must be signed in to change notification settings - Fork 1
Debugging
If you get an error like
[ben.longstaff@moby tests]$ saru-run-test single broken_test.py
saru_bug.py : FAILED
==MESSAGE==
saru-run-test : execution of test failed with error code 127
==STDERR==
: No such file or directorythen you can just run the file in python to get more output
python26 broken_test.pyAll of the saru headers must occur at the top of the file before anything else
If you edited your file in windows its possible that it added a \r character at the end of the line. You can check this by running your script at the command line as
./broken_test.pyif the output looks like
[ben.longstaff@moby tests]$ ./broken_test.py : No such file or directoryYou can fix this by opening the file in vim and typing
:set ff=unixthen save the file again.
If to run your test you typed
saru-run-test single test1.cppyou can run the test in gdb by typing
gdb ./.saru/bin/test1.cpp.testand run gdb as per normal.
NOTE: If you change your source code you need to run saru-run-test single test1.cpp again and reload the file in GDB for your changes to be applied to your debugging session.
valgrind ./.saru/bin/test1.cpp.testIf you have a large code base and a difficult bug to track down, Delta is a good tool for reducing your code base. Tutorial and a roadmap for using delta debugging Also see
Notes You need a test for interestingness (shell script) Add the delta tools to your path export PATH=~/delta-2006.08.03/:$PATH run multi delta giving it the test for interestingness and the file to modify
multidelta -level=0 ./delta_script.bash src/server.cpp
When it finishes you need to rebuild the binary and check that it still breaks in the right place, as the script just checks for interestingness, not the point at which the interestingness occurs. The repeat with levels 1 to 5 (ish), then you can manually remove any bits of junk that delta missed and check that it still fails correctly.
If there are included libraries you can then copy the library source into the server.cpp file and update the makefile to remove the library from the objects list. If it no longer segfaults then its a compiler issue.