Add tool for visually comparing test results.

This is needed when the strucural comparison fails.
This commit is contained in:
Diomidis Spinellis 2007-11-29 09:13:53 +00:00
parent 8d570e7db7
commit 66b795f23b
1 changed files with 25 additions and 0 deletions

25
tools/viscompare.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
#
# Visually compare the dot files reported as different when running
# the test.
#
# Specify as an argument the name of the file reported as different.
# Example: viscompare.sh Category.dot
# Example2: for i in `cd dot-ref ; ls *.dot`; do ../viscompare.sh $i; done
#
# $Id$
#
filea=`find . -name $1 | sed -n 1p`
fileb=`find . -name $1 | sed -n 2p`
diff $filea $fileb
echo left $filea - right $fileb
dot -Tpng $filea | pngtopnm >a.pnm
dot -Tpng $fileb | pngtopnm >b.pnm
pnmcat -lr a.pnm b.pnm | pnmtopng >comp.png
start comp.png # Windows-specific
echo -n Press enter to finish
read dummy
rm -f a.pnm b.pnm comp.png