From 6cf8042a36cc7a6412ae009096af25c267306be5 Mon Sep 17 00:00:00 2001 From: Michael Hiller Date: Sat, 1 Apr 2017 11:47:47 +0200 Subject: [PATCH] added tests.sh to run a few standardized tests --- extra/samples/sample4.out | 2 +- extra/samples/sample5.in | 2 +- extra/samples/sample5.out | 4 ++-- tests.sh | 25 +++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100755 tests.sh diff --git a/extra/samples/sample4.out b/extra/samples/sample4.out index 2a31299..def6d95 100644 --- a/extra/samples/sample4.out +++ b/extra/samples/sample4.out @@ -1,4 +1,4 @@ >referenceExon aaCCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCC >query -cttccccatttttatctcatagac------------------------------------------------------------------------------------------CCC------------ +cttccccatttttatctcatagac------------------------------------------------------------------------CCC------------------------------ diff --git a/extra/samples/sample5.in b/extra/samples/sample5.in index 88deb8c..7c53b0a 100644 --- a/extra/samples/sample5.in +++ b/extra/samples/sample5.in @@ -1,4 +1,4 @@ >referenceExon - aaCCTAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCC + aaCCTAAACCCAAACCCAAACCC >query cttccccatttttatctcatagacCCT diff --git a/extra/samples/sample5.out b/extra/samples/sample5.out index e8ff643..329acea 100644 --- a/extra/samples/sample5.out +++ b/extra/samples/sample5.out @@ -1,4 +1,4 @@ >referenceExon - aaCCTAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCCAAACCC + aaCCTAAACCCAAACCCAAACCC >query -cttccccatttttatctcatagacCCT------------------------------------------------------------------------------------------------------ +cttccccatttttatctcatagacCCT------------------ diff --git a/tests.sh b/tests.sh new file mode 100755 index 0000000..b4adb97 --- /dev/null +++ b/tests.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +if [ $# -ne 1 ]; then + echo "Usage: $0 ./cesar" + exit 1 +fi + +set -e + +HERE=$(dirname $0) +cesar=$1 + +# check if cesar successfully returns the test samples. + +echo "Checking for correct behaviour." +for f in $(find $HERE/extra/samples -name '*.in'); do + diff -q <($cesar $f) $HERE/extra/samples/$(basename $f .in).out + if [ $? -ne 0 ]; then + echo "$f... NOK" + exit 1 + else + echo "$f... OK" + fi +done +exit 0