| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | # simple standalone iotest for Capella import |
| 4 | # run mtest/capella/io directory as "./iotest" |
| 5 | # note that the debug build must be used with the -t option to get the beams right in the .mscx files |
| 6 | |
| 7 | MSCORE=../../../build.debug/mscore/mscore |
| 8 | |
| 9 | echoscip-shell system . . echo. "---------------------------------------------" |
| 10 | echoscip-shell system . . echo. "Regression Tests for MuseScore Capella import" |
| 11 | echoscip-shell system . . echo. "---------------------------------------------" |
| 12 | echoscip-shell system . . echo. |
| 13 | $MSCORE -v |
| 14 | echoscip-shell system . . echo. |
| 15 | |
| 16 | capfiles=`catscip-shell system . . cat. tst_capella_io.cpp | grepscip-shell system . . grep. "{ capReadTest" | awkscip-shell system . . awk. -F\" '{print $2}' | sortscip-shell system . . sort.` |
| 17 | capxfiles=`catscip-shell system . . cat. tst_capella_io.cpp | grepscip-shell system . . grep. "{ capxReadTest" | awkscip-shell system . . awk. -F\" '{print $2}' | sortscip-shell system . . sort.` |
| 18 | testcount=0 |
| 19 | failures=0 |
| 20 | |
| 21 | captestscip-shell shell shell-project 0.0.0 captest().() { |
| 22 | echoscip-shell system . . echo. -n "testing load/save $1$2"; |
| 23 | $MSCORE -t $1$2 -o mops.mscx &> /dev/nullscip-shell filesystem . . `/dev/null`. |
| 24 | if diffscip-shell system . . diff. -q $1$2-ref.mscx mops.mscx &> /dev/nullscip-shell filesystem . . `/dev/null`.; then |
| 25 | echoscip-shell system . . echo. -e "\r\t\t\t\t\t\t...OK"; |
| 26 | else |
| 27 | echoscip-shell system . . echo. -e "\r\t\t\t\t\t\t...FAILED"; |
| 28 | failures=$(($failures+1)); |
| 29 | echoscip-shell system . . echo. "+++++++++DIFF++++++++++++++" |
| 30 | diffscip-shell system . . diff. $1$2-ref.mscx mops.mscx |
| 31 | echoscip-shell system . . echo. "+++++++++++++++++++++++++++" |
| 32 | fi |
| 33 | rmscip-shell system . . rm. mops.mscx |
| 34 | testcount=$(($testcount+1)) |
| 35 | } |
| 36 | |
| 37 | echoscip-shell system . . echo. "Capella files ..." |
| 38 | for f in $capfiles; do |
| 39 | captestscip-shell shell shell-project 0.0.0 captest(). ${f} .cap |
| 40 | done |
| 41 | |
| 42 | echoscip-shell system . . echo. "CapellaXML files ..." |
| 43 | for f in $capxfiles; do |
| 44 | captestscip-shell shell shell-project 0.0.0 captest(). ${f} .capx |
| 45 | done |
| 46 | |
| 47 | echoscip-shell system . . echo. |
| 48 | echoscip-shell system . . echo. "$testcount test(s), $failures failure(s)" |