From 1d82bc9f86431772718831a7b6f99726aa1524ea Mon Sep 17 00:00:00 2001 From: Torsten Seemann Date: Wed, 23 May 2012 16:18:24 +1000 Subject: [PATCH] Added new tests for new velveth -interleaved and -separate options --- tests/fasta_eq_fastq_ascii.t | 2 -- tests/fasta_eq_fastq_binary.t | 2 -- tests/interleaved_eq_separate.t | 22 ++++++++++++++++++++++ tests/mismatched_separates.t | 19 +++++++++++++++++++ tests/run-tests.sh | 9 +++++---- 5 files changed, 46 insertions(+), 8 deletions(-) create mode 100755 tests/interleaved_eq_separate.t create mode 100755 tests/mismatched_separates.t diff --git a/tests/fasta_eq_fastq_ascii.t b/tests/fasta_eq_fastq_ascii.t index 79333b7..ad509fe 100755 --- a/tests/fasta_eq_fastq_ascii.t +++ b/tests/fasta_eq_fastq_ascii.t @@ -1,5 +1,3 @@ -#!/bin/bash - # load shared functions and variables . `dirname $0`/run-tests.functions diff --git a/tests/fasta_eq_fastq_binary.t b/tests/fasta_eq_fastq_binary.t index 47273e8..656d7b8 100755 --- a/tests/fasta_eq_fastq_binary.t +++ b/tests/fasta_eq_fastq_binary.t @@ -1,5 +1,3 @@ -#!/bin/bash - # load shared functions and variables . `dirname $0`/run-tests.functions diff --git a/tests/interleaved_eq_separate.t b/tests/interleaved_eq_separate.t new file mode 100755 index 0000000..215baa9 --- /dev/null +++ b/tests/interleaved_eq_separate.t @@ -0,0 +1,22 @@ +# load shared functions and variables +. `dirname $0`/run-tests.functions + +$VH $DIR/fai $K -shortPaired -fasta.gz $FAI > /dev/null +$VH $DIR/fas $K -shortPaired -fasta.gz -separate $FAL $FAR > /dev/null +$VH $DIR/fqi $K -shortPaired -fastq.gz $FQI > /dev/null +$VH $DIR/fqs $K -shortPaired -fastq.gz -separate $FQL $FQR > /dev/null + +cmp --quiet $DIR/fai/Sequences $DIR/fas/Sequences +if [ $? -ne 0 ]; then + problem "$FAI and $FAL+$FAR produced different Sequences file" +else + inform "ok" +fi + +cmp --quiet $DIR/fai/Sequences $DIR/fqs/Sequences +if [ $? -ne 0 ]; then + problem "$FAI and $FQL+$FQR produced different Sequences file" +else + inform "ok" +fi + diff --git a/tests/mismatched_separates.t b/tests/mismatched_separates.t new file mode 100755 index 0000000..b255646 --- /dev/null +++ b/tests/mismatched_separates.t @@ -0,0 +1,19 @@ +# load shared functions and variables +. `dirname $0`/run-tests.functions + +# forget to give 2 files +$VH $DIR/fas $K -shortPaired -fasta.gz -separate $FAL 1> /dev/null 2> /dev/null +if [ $? -eq 0 ]; then + problem "$VH did not fail when given only one file for -shortPaired -separate" +else + inform "ok" +fi + +# files have diff number of seqs in them +$VH $DIR/fas $K -shortPaired -fasta.gz -separate $FAL /dev/zero 1> /dev/null 2> /dev/null +if [ $? -eq 0 ]; then + problem "$VH did not fail when given mis-matched reads files in -shortPaired -separate" +else + inform "ok" +fi + diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 09e5321..2c4f8e8 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -3,12 +3,14 @@ # load shared functions and variables . `dirname $0`/run-tests.functions +inform "Running Velvet Test Suite" + # check we have our binaries and test files for FILE in $VH $VG $SEQ $ROADMAP $FQL $FQR $FQI $FAL $FAR $FAI ; do if [ ! -r $FILE ]; then problem "required testing file '$FILE' not found" else - inform "ok, found $FILE" + inform "Found $FILE, ok" fi done @@ -31,6 +33,5 @@ inform "removing test folder: $DIR" rm -fr ./$DIR # all done -inform "passed all $NUMTESTS tests!" - - +inform "passed all $NUMTESTS tests" +inform "hooray!"