Regression tests for autopkgtest.
authorCharles Plessy <plessy@debian.org>
Fri, 22 Jun 2012 04:13:23 +0000 (13:13 +0900)
committerCharles Plessy <plessy@debian.org>
Fri, 22 Jun 2012 04:13:23 +0000 (13:13 +0900)
See: http://dep.debian.net/deps/dep8/

debian/README.test
debian/control
debian/tests/control [new file with mode: 0644]
debian/tests/with-example-data [new file with mode: 0755]

index a7b2e8606b1f9542d8276fde62fde2c8aee827ca..eb5aad29fc1c263cfb63b77bbd10e33ef42e2732 100644 (file)
@@ -30,7 +30,10 @@ diff $TABIXDATA.ref $TABIXDATA.out
 # Clean
 rm $TABIXDATA.gz $TABIXDATA.gz.tbi $TABIXDATA.out $TABIXDATA.ref
 
- -- Charles Plessy <plessy@debian.org>  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 <plessy@debian.org>  Fri, 22 Jun 2012 13:11:36 +0900
 
 
 
index 40d718171f6e261f847ead54b5294bbbc7a1ecff..5065ed5261ed78efbf78993ab2452196ad8caa75 100644 (file)
@@ -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 (file)
index 0000000..2da3ad9
--- /dev/null
@@ -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 (executable)
index 0000000..6af6ecf
--- /dev/null
@@ -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