m_essaid wrote:
John_Laird
Hi,
I'm interested about how you deal with your diff utility
Personnaly I create a batch file which launches WinMerge with the appropriate left and right file preloaded.
If the test reveals a difference, in my mail I write in html a link which launches the batch file.
The purpose of the DIFF above was to verify whether or not the software product I am testing is configured how I think it is before the test gets run (that is in an assumed state). WinMerge is a much better tool if you need a human to look at the data, in this case I do not, so I use GNU DIFF (Linux ported to Windows) which I think works better when a human does not need to intervene. See here:
https://www.gnu.org/software/diffutils/manual/diffutils.html#Invoking-diff
The software configuration is determined by how objects are setup in the product I am testing...so we have a dialog box that gives the user a count of how many types of each object there is. I push that object count text to file, then DIFF that against a 'test control' file and that tells me before the meat of the test gets run that the configuration is not as expected (because it can impact test results). Its one of the checks I have TC/TE run before I allow the test to continue in order to save time on the server (this particular test requires an hour to run).
In another part of the same test I am recursively DIFF-ing two paired folders with a large number of files (both text and binary) in a complex directory tree. So I use these arguments instead for that:
def diffSummaryTwoFolderOutputs(output1, output2, binary):
diffCmd = "\"C:\\Program Files (x86)\\GnuWin32\\bin\\diff.exe\" " + output1 + " " + output2 + " --brief --recursive"
if binary is True:
diffCmd += " --binary"
execResult = WshShell.Exec(diffCmd)
sout = execResult.StdOut.ReadAll()
return sout
^Then I put that result in a 'summary report' text file. If there are any differences found, everything gets neatly packaged into a ZIP file (>300MB of data) for later analysis by me or another human to see if the differences found are desirable or not, or just noise. WinMerge, or some other, more human friendly tool is later used for analysis.