Use Purify's command-line options to integrate Purify with existing makefiles, batch files, or Perl scripts. For example, if you have a test script that runs a program, you can modify the script to instrument the program before running it. To do this, change the line that runs Exename.exe to:
purify Exename.exe
You can also have your test script instrument Exename.exe (making sure the script starts with the uninstrumented version of the program) and then run the instrumented version throughout your tests. To do this, add the following line to the beginning of your script:
purify /Run=no /Replace=yes Exename.exe
This line instructs Purify to save the original Exename.exe to a .original file, then instrument Exename.exe without actually running it. Now, whenever your test script runs Exename.exe, the instrumented version of your program runs instead, providing Purify's diagnostic information.
You can run Purify using the /SaveTextData option to save Purify data to an ASCII text file (.txt) so that your test harness or script can work with it. To work with the data, update your test harness or script to search through the output based on any criteria you find useful. For example, your script might raise a failure condition if any Purify error messages or warning messages were found in the output.
Notes:
§ If you are using Microsoft Windows 2000 or higher, the Windows File Protection feature (WFP) may cause problems when you use Purify's /replace command line option. For a workaround to this problem, click .
§ To use command-line options with makefiles and scripts, ensure that the Purify program and cache directories appear in your Path environment variable.
§ You can also use Purify to collect coverage data with your makefiles and scripts.
(C) Copyright IBM Corporation 1992, 2010.