diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..15a0c39 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +sudo: required +language: c +compiler: +- clang +- gcc +script: make && make test diff --git a/Makefile b/Makefile index 0d5b9ec..6b1977b 100644 --- a/Makefile +++ b/Makefile @@ -71,3 +71,7 @@ dist:clean tar -vcf dwgsim-${PACKAGE_VERSION}.tar dwgsim-${PACKAGE_VERSION}; \ gzip -9 dwgsim-${PACKAGE_VERSION}.tar; \ rm -rv dwgsim-${PACKAGE_VERSION}; + +test: + if [ -d tmp ]; then rm -r tmp; fi + /bin/bash testdata/test.sh diff --git a/testdata/ex1.test.bfast.fastq.gz b/testdata/ex1.test.bfast.fastq.gz new file mode 100644 index 0000000..85bfb18 Binary files /dev/null and b/testdata/ex1.test.bfast.fastq.gz differ diff --git a/testdata/ex1.test.bwa.read1.fastq.gz b/testdata/ex1.test.bwa.read1.fastq.gz new file mode 100644 index 0000000..7c76e0c Binary files /dev/null and b/testdata/ex1.test.bwa.read1.fastq.gz differ diff --git a/testdata/ex1.test.bwa.read2.fastq.gz b/testdata/ex1.test.bwa.read2.fastq.gz new file mode 100644 index 0000000..af52b17 Binary files /dev/null and b/testdata/ex1.test.bwa.read2.fastq.gz differ diff --git a/testdata/ex1.test.mutations.txt.gz b/testdata/ex1.test.mutations.txt.gz new file mode 100644 index 0000000..52a4a65 Binary files /dev/null and b/testdata/ex1.test.mutations.txt.gz differ diff --git a/testdata/ex1.test.mutations.vcf.gz b/testdata/ex1.test.mutations.vcf.gz new file mode 100644 index 0000000..5f97c79 Binary files /dev/null and b/testdata/ex1.test.mutations.vcf.gz differ diff --git a/testdata/test.sh b/testdata/test.sh new file mode 100644 index 0000000..b3283aa --- /dev/null +++ b/testdata/test.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e + +TESTDATADIR=$(dirname ${0}); + +# Decompress the test data +pushd $TESTDATADIR; +for FILE in $(ls -1 *gz) +do + gunzip -c ${FILE} > $(basename ${FILE} .gz); +done +popd + +mkdir tmp + +# Generate the new test data +./dwgsim -z 13 -N 10000 samtools/examples/ex1.fa ex1.test + +# Test the differences +for FILE in $(ls -1 ex1.test*) +do + diff -q ${FILE} ${TESTDATADIR}/${FILE} +done + +# Clean up the testdata +find ${TESTDATADIR} \! -name "*gz" -type f | grep -v sh$ | xargs rm; +rm -r tmp;