Skip to content

Commit

Permalink
simplify vtest script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jojo-Schmitz committed May 17, 2016
1 parent 3aa52cd commit c7db56f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions vtest/README.md
Expand Up @@ -4,6 +4,7 @@ MuseScore Visual Tests
The shell script "gen" creates a subdirectory `html` with the
HTML file `vtest.html` for visual compare including all needed
image files.
Travis generates this too and then uploads to http://vtest.musescore.org/index.html

Requirements
---
Expand Down
12 changes: 5 additions & 7 deletions vtest/gen
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

if [ "`uname`" = 'Darwin' ]; then
MSCORE=../../build.xcode/mscore/Debug/mscore.app/Contents/MacOS/mscore
Expand Down Expand Up @@ -57,7 +57,7 @@ fi

DPI=130

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR="$(cd "$(dirname "$0")" && pwd)"
mkdir -p $DIR/html
cd $DIR/html

Expand All @@ -69,13 +69,11 @@ if test -f LOG; then
echo "Generate JSON job file"
JSON_FILE=vtestjob.json
rm -f $JSON_FILE
IFS=' ' read -r -a SRC_ARRAY <<< "$SRC"
echo "[" >> $JSON_FILE
for src in "${SRC_ARRAY[@]::${#SRC_ARRAY[@]}-1}" ; do
for src in $SRC ; do
echo "{ \"in\" : \"../$src.mscz\", \"out\" : \"$src.png\" }," >> $JSON_FILE
done
echo "{ \"in\" : \"../${SRC_ARRAY[@]: -1:1}.mscz\", \"out\" : \"${SRC_ARRAY[@]: -1:1}.png\" }" >> $JSON_FILE
echo "]" >> $JSON_FILE
echo "{}]" >> $JSON_FILE

echo "Generate PNG files"
$MSCORE -j $JSON_FILE -r $DPI 2> LOG
Expand Down Expand Up @@ -113,5 +111,5 @@ echo " </body>" >> $F
echo "</html>" >> $F


$BROWSER $F
$BROWSER $F 2>/dev/null

0 comments on commit c7db56f

Please sign in to comment.