comparison tests/include.sh @ 248:c8e5fcddf8be

Merge
author Chris Cannam
date Fri, 18 Mar 2016 15:15:55 +0000
parents 4941e8b167c0
children 46d3a6461b4a
comparison
equal deleted inserted replaced
247:5eadb3b687bb 248:c8e5fcddf8be
11 exit 1;; 11 exit 1;;
12 *) 12 *)
13 ;; 13 ;;
14 esac 14 esac
15 15
16 version=1.3 16 version=1.4
17 nextversion=1.4 17 nextversion=1.5
18 18
19 testdir=$mypath/.. 19 testdir=$mypath/..
20 r=$testdir/../sonic-annotator 20 r=$testdir/../sonic-annotator
21 21
22 audiopath=$testdir/audio 22 audiopath=$testdir/audio
58 rm "${a}__" "${b}__" 58 rm "${a}__" "${b}__"
59 return $rv 59 return $rv
60 } 60 }
61 61
62 jsoncompare() { 62 jsoncompare() {
63 # The Sonic Annotator version number appears in the JAMS output --
64 # filter that out, and also reformat to ignore whitespace differences
63 a="$1" 65 a="$1"
64 b="$2" 66 b="$2"
65 cat "$a" | json_reformat > "${a}__" 67 cat "$a" | sed 's/Sonic Annotator v[0-9.]*/Sonic Annotator vXXX/' | json_reformat > "${a}__"
66 cat "$b" | json_reformat > "${b}__" 68 cat "$b" | sed 's/Sonic Annotator v[0-9.]*/Sonic Annotator vXXX/' | json_reformat > "${b}__"
67 cmp -s "$a" "$b" 69 cmp -s "${a}__" "${b}__"
68 rv=$? 70 rv=$?
69 rm "${a}__" "${b}__" 71 rm "${a}__" "${b}__"
70 return $rv 72 return $rv
71 } 73 }
72 74
79 echo "--" 81 echo "--"
80 echo "Expected output follows:" 82 echo "Expected output follows:"
81 echo "--" 83 echo "--"
82 cat "$3" 84 cat "$3"
83 echo "--" 85 echo "--"
84 echo "Diff:" 86 echo "Diff (output on left, expected on right):"
85 echo "--" 87 echo "--"
86 sdiff -w78 "$2" "$3" 88 sdiff -w78 "$2" "$3"
87 echo "--" 89 echo "--"
88 fi 90 fi
89 exit 1 91 exit 1