#
# -d changes the Ghostscript device used for creating PNG files
# (usually png16m for direct PNG creation and pngmono for printer simulation)
+#
+# if any filenames follow, those are the tests to run. In absence
+# of any filenames, the contents of input/regression are used.
cpu_count=${CPU_COUNT:-1}
backend_opt='--png ${resolution:+=-dresolution=$resolution} ${gsdevice:+=-dpixmap-format=$gsdevice}'
{
$1 gs -sDEVICE=${gsdevice:-pngmono} -q -dNOPAUSE \
-r${resolution:-300} -dNOPLATFONTS \
+ -dAutoRotatePages=/None \
-dTextAlphaBits=1 -dGraphicsAlphaBits=1 \
-sOutputFile="${2%.pdf}-%d.png" "$2" -c quit
};;
esac
done
+shift $((OPTIND-1))
+
if [ -z "$file_loc" ]; then
echo "Must specify old (-o) or new (-n) regtest PNG creation on command line"
exit 1
rm -rf $LILYPOND_BUILD_DIR/out-png-check/$file_loc
mkdir -p $LILYPOND_BUILD_DIR/out-png-check/$file_loc
+OLDPWD="$PWD"
cd $LILYPOND_BUILD_DIR/out-png-check/$file_loc
-ls $LILYPOND_GIT/input/regression/*.ly > dir.txt
+if [ "$*" = "" ]
+then
+ ls $LILYPOND_GIT/input/regression/*.ly > dir.txt
+else
+ : > dir.txt
+ for i
+ do
+ case "$i" in /*)
+ echo "$i" >> dir.txt;;
+ *)
+ echo "$OLDPWD/$i" >> dir.txt
+ esac
+ done
+fi
+
$LILYPOND_BUILD_DIR/out/bin/lilypond $(eval echo $backend_opt) --relocate \
-dinclude-settings=$LILYPOND_GIT/scripts/auxiliar/NoTagline.ly \
-djob-count=$cpu_count -dread-file-list "dir.txt"
diff_count=0
for filename in new-regtest-results/*.png; do
trimFile=$(basename $filename)
- if [ -e old-regtest-results/$trimFile ]; then
+ if [ -e "old-regtest-results/$trimFile" ]; then
convert new-regtest-results/$trimFile -level 50% NewTest.png
convert old-regtest-results/$trimFile -level 50% OldTest.png
difference=$(compare -metric AE NewTest.png OldTest.png null: 2>&1 )