How do I use Valgrind with Squish?

Last edited on

How to use Valgrind with Squish

If you want to do memory leak testing, Valgrind is the best choice if you are on Linux or any other OS it is supported on.

Here is how to use it with Squish:

1. Create a shell script to wrap the AUT invocation

valgrind --log-file=/tmp/valgrind.log /path/to/real/aut

Where “/path/to/real/aut” should be replaced with the path to your application.

2. Make the shell script executable with

chmod +x shellScriptName

3. Try running your shell script to make sure it works.

4. Specify the shell script as AUT.

5. Increase the startup timeout as it will take longer to start.

6. Run your test, and inspect the log file.

The above should work well for memory access errors. You may run into issues with the leak report at the end, however. Valgrind produces a final report, but Squish may kill the process too early. Changing the Hard and SoftExitTimeouts to large values may help here. The best solution is to explicitly end the Application and snooze aftewards to give Valgrind some time to generate its report.