From 7677e4520ec9c535985331d2027045611a09523c Mon Sep 17 00:00:00 2001 From: Charles Plessy Date: Fri, 22 Jun 2012 13:13:23 +0900 Subject: [PATCH] Regression tests for autopkgtest. See: http://dep.debian.net/deps/dep8/ --- debian/README.test | 5 ++++- debian/control | 1 + debian/tests/control | 1 + debian/tests/with-example-data | 26 ++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 debian/tests/control create mode 100755 debian/tests/with-example-data diff --git a/debian/README.test b/debian/README.test index a7b2e86..eb5aad2 100644 --- a/debian/README.test +++ b/debian/README.test @@ -30,7 +30,10 @@ diff $TABIXDATA.ref $TABIXDATA.out # Clean rm $TABIXDATA.gz $TABIXDATA.gz.tbi $TABIXDATA.out $TABIXDATA.ref - -- Charles Plessy Tue, 10 May 2011 19:12:19 +0900 +This sequence of tests is also implemented debian/tests/with-example-data +in the source package. + + -- Charles Plessy Fri, 22 Jun 2012 13:11:36 +0900 diff --git a/debian/control b/debian/control index 40d7181..5065ed5 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ Standards-Version: 3.9.3 Homepage: http://samtools.sourceforge.net/tabix.shtml Vcs-Git: git://git.debian.org/debian-med/tabix.git Vcs-Browser: http://git.debian.org/?p=debian-med/tabix.git +XS-Testsuite: autopkgtest Package: tabix Architecture: any diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..2da3ad9 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1 @@ +Tests: with-example-data diff --git a/debian/tests/with-example-data b/debian/tests/with-example-data new file mode 100755 index 0000000..6af6ecf --- /dev/null +++ b/debian/tests/with-example-data @@ -0,0 +1,26 @@ +#!/bin/sh -e + +# Create a temporary file +TABIXDATA=$(mktemp) + +# Uncompress example data +zcat /usr/share/doc/tabix/examples/example.gtf.gz > $TABIXDATA + +# Compress example data with bgzip +bgzip $TABIXDATA + +# Index with tabix +tabix $TABIXDATA.gz + +# Extract with tabix the he features on chromosome 1 whose coordinates overlap +# the interval 150,309–150,309. +tabix $TABIXDATA.gz chr1:150309-150309 > $TABIXDATA.out + +# Reference result at the bottom of this file +grep H\AVANA /usr/share/doc/tabix/README.test > $TABIXDATA.ref + +# No difference ? +diff $TABIXDATA.ref $TABIXDATA.out + +# Clean +rm $TABIXDATA.gz $TABIXDATA.gz.tbi $TABIXDATA.out $TABIXDATA.ref -- 2.30.2