[med-svn] [Git][med-team/python-dnaio][master] Add an autopkgtest
Liubov Chuprikova
gitlab at salsa.debian.org
Mon Jun 24 22:37:22 BST 2019
Liubov Chuprikova pushed to branch master at Debian Med / python-dnaio
Commits:
e1c180ad by Liubov Chuprikova at 2019-06-24T21:36:53Z
Add an autopkgtest
- - - - -
2 changed files:
- debian/tests/control
- debian/tests/run-unit-test
Changes:
=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
Tests: run-unit-test
-Depends: @
+Depends: @, unicycler-data
Restrictions: allow-stderr
=====================================
debian/tests/run-unit-test
=====================================
@@ -1,18 +1,40 @@
#!/bin/bash
set -e
-pkg=#PACKAGENAME#
+test_pkg=dnaio
+# using these data for testing
+source_pkg=unicycler-data
if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
- AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
- # Double quote below to expand the temporary directory variable now versus
- # later is on purpose.
- # shellcheck disable=SC2064
+ AUTOPKGTEST_TMP=$(mktemp -d /tmp/${test_pkg}-test.XXXXXX)
trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi
-cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
+if [ -d /usr/share/${source_pkg}/sample_data ] ; then
+ cp -a /usr/share/${source_pkg}/sample_data/ ${AUTOPKGTEST_TMP}
+else
+ echo "Please install package unicycler-data to run this script"
+ exit 1
+fi
+
+cd ${AUTOPKGTEST_TMP}
+
+cat > simple_test.py << EOL
+import os
+import dnaio
+
+dir = 'sample_data'
+
+for filename in os.listdir(dir):
+ print(filename)
+ with dnaio.open(dir + '/' + filename) as inf:
+ bp = 0
+ for record in inf:
+ bp += len(record)
+ print(f'The input file contains {bp/1E6:.1f} Mbp')
+EOL
-cd "${AUTOPKGTEST_TMP}"
+# run test
+python3 ./simple_test.py
-#do_stuff_to_test_package#
+echo "PASS"
View it on GitLab: https://salsa.debian.org/med-team/python-dnaio/commit/e1c180adebc4f5d9a8fa682d81b0f627ec78a7b2
--
View it on GitLab: https://salsa.debian.org/med-team/python-dnaio/commit/e1c180adebc4f5d9a8fa682d81b0f627ec78a7b2
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190624/8349163e/attachment-0001.html>
More information about the debian-med-commit
mailing list