# This script is not intended to be executed directly.  It is sourced by test-runner.sh and most functions you see here are defined in test-tools.sh
# The variables EXENAME, EXEBASE, OKDIR, and EXEDIR are defined externally.

# Note: The C-libraries on Linux, Mac, and Windows do not format exponents the same way.
# For example  `std::cout << 1e-7;`   // Outputs 1e-007 on Windows/Mac and 1e-07 on Linux
# To correct for this, the function `fixExponents` (defined in test-tools.sh) converts
# 3-digit exponents with leading zeros into 2-digit exponents. e.g.:  3.4e-006 ==> 3.4e-06

beginTestBlock  # Begin a group of tests.
runMake -r $EXE ProbabilityPlot # run `make` for the main exe and any other listed programs
EXT=.ps  # set extension for @OKFILE and @OUTFILE placeholders (defaults for runDiff)
FIX_DESC='--desc @TBASE_output.pfs'  # the output ps files contain the name of the input file, which changes (e.g. partition vs partition-smp) to correct for this, we specify a description to use.

SEQ_ALN1=testFiles/testFile_rnasep_alignment.fasta

# Test partition_without_options.
initTest 'without_options'  
runTest $EXE $SEQ_ALN1  $OUT.pfs 
runSubTest 'plot' ProbabilityPlot   $OUT.pfs $OUT.ps  $FIX_DESC
fixExponents $OUT.ps; runDiff; endTest

# Test partition_without_options.
initTest 'with_options'  
runTest $EXE $SEQ_ALN1 -b 0.5 -l 60 $OUT.pfs 
runSubTest 'plot' ProbabilityPlot $OUT.pfs $OUT.ps  $FIX_DESC
fixExponents $OUT.ps; runDiff; endTest


endTestBlock # End a group of tests. Also cleans up orphaned files etc.
