Chris@191: #!/bin/bash Chris@191: Chris@191: . ../include.sh Chris@191: Chris@191: tmpjson=$mypath/tmp_1_$$.json Chris@191: Chris@191: silentfile=$audiopath/20sec-silence.wav Chris@204: infile=$audiopath/3clicks8.wav Chris@191: Chris@191: trap "rm -f $tmpjson" 0 Chris@191: Chris@191: transformdir=$mypath/transforms Chris@191: Chris@200: mandatory="-w jams" Chris@197: Chris@204: # First check that the JSON is valid for all outputs Chris@191: Chris@191: for output in instants curve-oss curve-fsr curve-fsr-timed curve-vsr grid-oss grid-fsr notes-regions; do Chris@191: Chris@200: $r -d "$testplug:$output" $mandatory --jams-one-file "$tmpjson" --jams-force "$silentfile" 2>/dev/null || \ Chris@191: fail "Failed to run for plugin $testplug with output $output" Chris@191: Chris@191: check_json "$tmpjson" "test plugin output $output" Chris@204: Chris@191: done Chris@191: Chris@204: # Now check for valid results, for a subset Chris@204: Chris@204: for output in instants curve-fsr grid-oss notes-regions; do Chris@204: Chris@204: $r -d "$testplug:$output" $mandatory --jams-one-file "$tmpjson" --jams-force "$silentfile" 2>/dev/null || \ Chris@204: fail "Failed to run for plugin $testplug with output $output" Chris@204: Chris@204: expected="$mypath/expected/$output.json" Chris@204: jsoncompare "$tmpjson" "$expected" || \ Chris@204: faildiff "Output differs from expected for $output" "$tmpjson" "$expected" Chris@204: Chris@204: done Chris@204: Chris@204: # Test digits option, with an output that has lots of digits to round Chris@204: Chris@204: for digits in 0 6 2; do Chris@204: Chris@204: $r -t "$transformdir/af.n3" $mandatory --jams-digits "$digits" --jams-one-file "$tmpjson" --jams-force "$infile" 2>/dev/null || \ Chris@204: fail "Failed to run for af with digits = $digits" Chris@204: Chris@204: expected="$mypath/expected/af-$digits.json" Chris@204: jsoncompare "$tmpjson" "$expected" || \ Chris@204: faildiff "Output differs from expected for af with digits = $digits" "$tmpjson" "$expected" Chris@204: Chris@204: done Chris@204: