#!/bin/bash
set -e
debug=${debug:-0}
options=${options:-}
export PS4='
>>>>>>> '
trap "echo TEST FAILED" EXIT
set -x
export seed=0.222
scons -s -c; rm -f ./*.o ./*.a
scons -j 4 gpu=0 debug="$debug" options="$options" clstmocrtrain clstmfiltertrain clstmfilter clstmocr test-lstm
time ./test-lstm
time ./test-filter.sh
time ./test-ocr.sh
scons -s -c; rm -f ./*.o ./*.a
scons -j 4 gpu=0 double=1 debug="$debug" options="$options" test-cderiv test-deriv test-ctc
./test-cderiv
./test-deriv
./test-ctc
rm -f ./*.pb.h ./*.pb.cc
scons -c all
#scons -s -c pyswig
#scons pyswig
#python test-lstm.py
#set +x
#scons -s -c all pyswig
trap "echo ALL TESTS PASS" EXIT
