#!/usr/bin/env  bash
### dot2ct-tests.sh  runs tests of dot2ct utility
### see https://gitlab.oit.duke.edu/-/snippets/179
### TODO:  push dir before running and popdir when done.
export HOMEBREW_PREFIX=$(brew --prefix)
RNAJARFILE=$(realpath $HOMEBREW_PREFIX/bin/RNAstructure.jar)
# export DATAPATH="$(dirname $RNAJARFILE)//../data_tables"
RNAstructureHOME="$(dirname $RNAJARFILE)//../"
echo "RNAstructureHOME =$RNAstructureHOME"
echo "doing cd './tests/' subdir before running ./scripts/test-runner.sh"
cd $RNAstructureHOME/tests/
./scripts/test-runner.sh --serial dot2ct 
echo "For list of passed tests do:  tail  './!PASSED_TESTS.log' "
cat << EOF
If all tests passed then above file ends with lines similar to these:
2021-03-24 13:12:40     dot2ct_without_options
2021-03-24 13:12:40     dot2ct_all_structures
2021-03-24 13:12:40     dot2ct_single_structure
2021-03-24 13:12:40     dot2ct_format_multi
2021-03-24 13:12:40     dot2ct_format_simple
2021-03-24 13:12:40     dot2ct_format_side
2021-03-24 13:12:40     dot2ct_pseudoknot
EOF