#!/usr/bin/env bash # Confirm writes look the same between libs # set -ex command -v whisper-create.py >/dev/null 2>&1 || { echo >&2 "I require whisper-create.py but it's not installed. Aborting."; exit 1; } rm -f test/whisper/compat_1_3.*.wsp PYFILE=test/whisper/compat_1_3.py.wsp RSFILE=test/whisper/compat_1_3.rust.wsp # TODO go back to 1:2 2:3 when I have downsampling whisper-create.py $PYFILE 1:10 RUST_BACKTRACE=1 cargo run create $RSFILE 1:10 # TODO COPY/PASTA -> FUNCTION CHECKDIFF=$(diff test/whisper/compat_1_3.py.wsp test/whisper/compat_1_3.rust.wsp) if [ $? -eq 0 ]; then echo "New files are compatible" else echo "New files do not match" >&2 exit 1 fi UNIX_TS=$(date +%s) POINTS=(0 1 2 3 4 5 6 7 8 9 10 11) for i in ${POINTS[@]}; do TS=`expr $UNIX_TS - $i` POINTS[$i]="$TS:10" echo "setting ${i} to `${POINT[$i]}`" done echo ${POINTS[@]} echo "whisper-update.py $PYFILE ${POINTS[@]}" whisper-update.py $PYFILE ${POINTS[@]} if [ ! $? -eq 0 ]; then echo "Failed to update file" exit 1 fi echo "cargo run update $RSFILE ${POINTS[@]}" cargo run update $RSFILE ${POINTS[@]} # TODO COPY/PASTA -> FUNCTION CHECKDIFF=$(diff test/whisper/compat_1_3.py.wsp test/whisper/compat_1_3.rust.wsp) if [ $? -eq 0 ] then echo "New files are compatible" else echo "New files do not match" >&2 echo "Rust:" whisper-dump.py $RSFILE # hexdump $RSFILE echo "Python:" whisper-dump.py $PYFILE # hexdump $PYFILE exit 1 fi