| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
if [ "`uname`" = 'Darwin' ]; then |
| 4 |
MSCORE=../../build.xcode/mscore/Debug/mscore.app/Contents/MacOS/mscore |
| 5 |
BROWSER=open |
| 6 |
else |
| 7 |
MSCORE=../../build.debug/mscore/mscore |
| 8 |
BROWSER=rekonq |
| 9 |
fi |
| 10 |
|
| 11 |
if [ -n "$VTEST_MSCORE" ]; then |
| 12 |
MSCORE="$VTEST_MSCORE" |
| 13 |
fi |
| 14 |
|
| 15 |
if [ -n "$VTEST_BROWSER" ]; then |
| 16 |
BROWSER="$VTEST_BROWSER" |
| 17 |
fi |
| 18 |
|
| 19 |
# |
| 20 |
# "compare" - image magick compare program |
| 21 |
# |
| 22 |
if test -n "$1"; then |
| 23 |
SRC=$1 |
| 24 |
else |
| 25 |
SRC="mmrest-1 bravura-mmrest gonville-mmrest mmrest-2 mmrest-4 mmrest-5 mmrest-6 mmrest-7 mmrest-8 mmrest-9\ |
| 26 |
mmrest-10 fmrest-1 fmrest-2 fmrest-3 fmrest-4 fmrest-5 fmrest-6 measure-repeat-1\ |
| 27 |
noteheadposition-1 valign-1 valign-2 valign-3 emmentaler-1 bravura-1 gonville-1 emmentaler-2 bravura-2 gonville-2\ |
| 28 |
emmentaler-3 bravura-3 gonville-3 emmentaler-4 bravura-4 gonville-4 emmentaler-5 bravura-5 gonville-5\ |
| 29 |
emmentaler-6 bravura-6 gonville-6 emmentaler-7 bravura-7 gonville-7\ |
| 30 |
emmentaler-8 bravura-8 gonville-8 emmentaler-9 bravura-9 gonville-9\ |
| 31 |
emmentaler-10 bravura-10 gonville-10 emmentaler-11 bravura-11 gonville-11\ |
| 32 |
emmentaler-text-1 gonville-text-1 bravura-text-1 musejazz-text-1\ |
| 33 |
emmentaler-text-2 gonville-text-2 bravura-text-2 musejazz-text-2\ |
| 34 |
emmentaler-text-3 gonville-text-3 bravura-text-3 musejazz-text-3\ |
| 35 |
frametext ottava slurs-1 slurs-2 slurs-3 slurs-4 hairpins-1 pedal-1 line-1 line-2 line-3 line-4 line-5 gliss-1 gliss-2\ |
| 36 |
chord-layout-1 chord-layout-2 chord-layout-3 chord-layout-4 chord-layout-5\ |
| 37 |
chord-layout-6 chord-layout-7 chord-layout-8 chord-layout-9 chord-layout-10\ |
| 38 |
chord-layout-11 chord-layout-12 chord-layout-13 chord-layout-14 chord-layout-15 chord-layout-16 chord-layout-17\ |
| 39 |
cross-1 cross-2\ |
| 40 |
accidental-1 accidental-2 accidental-3 accidental-4 accidental-5 accidental-mirror\ |
| 41 |
accidental-6 accidental-7 accidental-8 accidental-9 accidental-10\ |
| 42 |
tie-1 tie-2 tie-3 grace-1 grace-2 grace-3 grace-4 tuplets-1 tuplets-2 breath-1\ |
| 43 |
harmony-1 harmony-2 harmony-3 harmony-4 harmony-5 harmony-6 harmony-7\ |
| 44 |
harmony-8 harmony-9 harmony-10 harmony-11 harmony-12\ |
| 45 |
beams-1 beams-2 beams-3 beams-4 beams-5 beams-6 beams-7 beams-8 beams-9 beams-10\ |
| 46 |
beams-11 beams-12 beams-13 beams-14 beams-15 beams-16 beams-17\ |
| 47 |
user-offset-1 user-offset-2 chord-space-1 chord-space-2 tablature-1 image-1\ |
| 48 |
lyrics-1 lyrics-2 lyrics-3 lyrics-4 lyrics-5 lyrics-6 lyrics-7 voice-1 voice-2 slash-1 slash-2\ |
| 49 |
system-1 system-2 system-3 system-4 system-5 small-1 tremolo-1" |
| 50 |
fi |
| 51 |
|
| 52 |
DPI=130 |
| 53 |
|
| 54 |
DIR="$(cd "$(dirname "$0")" && pwd)" |
| 55 |
mkdir -p $DIR/html |
| 56 |
cd $DIR/html |
| 57 |
rm -f *.png |
| 58 |
|
| 59 |
if test -f LOG; then |
| 60 |
rm LOG |
| 61 |
fi |
| 62 |
|
| 63 |
# make sure we don't put a , at the end of last line |
| 64 |
echo "Generate JSON job file" |
| 65 |
JSON_FILE=vtestjob.json |
| 66 |
rm -f $JSON_FILE |
| 67 |
echo "[" >> $JSON_FILE |
| 68 |
for src in $SRC ; do |
| 69 |
echo "{ \"in\" : \"../$src.mscz\", \"out\" : \"$src.png\" }," >> $JSON_FILE |
| 70 |
done |
| 71 |
echo "{}]" >> $JSON_FILE |
| 72 |
|
| 73 |
echo "Generate PNG files" |
| 74 |
$MSCORE -f -j $JSON_FILE -r $DPI 2> LOG |
| 75 |
|
| 76 |
echo "Compare PNG files and references" |
| 77 |
for src in $SRC; do |
| 78 |
cp ../$src-ref.png . |
| •79 |
compare -verbose -metric AE $src-1.png $src-ref.png $src-diff.png |
| 80 |
done 2>&1 | tee /dev/stderr | fgrep -e Image: -e all: >LOG-compare |
| 81 |
|
| 82 |
echo "Generate report" |
| 83 |
F=vtest.html |
| 84 |
rm -f $F |
| 85 |
cp ../style.css . |
| 86 |
echo "<html>" >> $F |
| 87 |
echo " <head>" >> $F |
| 88 |
echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">" >> $F |
| 89 |
echo " </head>" >> $F |
| 90 |
echo " <body>" >> $F |
| 91 |
echo " <div id=\"topbar\">" >> $F |
| 92 |
echo " <span>Current</span>" >> $F |
| 93 |
echo " <span>Reference</span>" >> $F |
| 94 |
echo " <span>Comparison</span>" >> $F |
| 95 |
echo " </div>" >> $F |
| 96 |
echo " <div id=\"topmargin\"></div>" >> $F |
| 97 |
for src in $SRC; do |
| 98 |
echo " <h2 id=\"$src\">$src <a class=\"toc-anchor\" href=\"#$src\">#</a></h2>" >> $F |
| 99 |
echo " <div>" >> $F |
| 100 |
echo " <img src=\"$src-1.png\">" >> $F |
| 101 |
echo " <img src=\"$src-ref.png\">" >> $F |
| 102 |
echo " <img src=\"$src-diff.png\">" >> $F |
| 103 |
echo " </div>" >> $F |
| 104 |
done |
| 105 |
echo " </body>" >> $F |
| 106 |
echo "</html>" >> $F |
| 107 |
|
| 108 |
|
| 109 |
$BROWSER $F 2>/dev/null |
| 110 |
|