Skip to content

Commit

Permalink
Added new tests for new velveth -interleaved and -separate options
Browse files Browse the repository at this point in the history
  • Loading branch information
Torsten Seemann committed May 23, 2012
1 parent 115dd97 commit 1d82bc9
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 8 deletions.
2 changes: 0 additions & 2 deletions tests/fasta_eq_fastq_ascii.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

# load shared functions and variables
. `dirname $0`/run-tests.functions

Expand Down
2 changes: 0 additions & 2 deletions tests/fasta_eq_fastq_binary.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

# load shared functions and variables
. `dirname $0`/run-tests.functions

Expand Down
22 changes: 22 additions & 0 deletions tests/interleaved_eq_separate.t
Original file line number Diff line number Diff line change
@@ -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

19 changes: 19 additions & 0 deletions tests/mismatched_separates.t
Original file line number Diff line number Diff line change
@@ -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

9 changes: 5 additions & 4 deletions tests/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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!"

0 comments on commit 1d82bc9

Please sign in to comment.