[med-svn] [Git][med-team/staden][master] add autopkgtest
harish chavre (@Harish1)
gitlab at salsa.debian.org
Sat Jul 5 21:42:28 BST 2025
harish chavre pushed to branch master at Debian Med / staden
Commits:
d540fd92 by Harish chavre at 2025-07-05T20:41:44+00:00
add autopkgtest
- - - - -
3 changed files:
- + debian/tests/control
- + debian/tests/data/input.fa
- + debian/tests/run-unit-test
Changes:
=====================================
debian/tests/control
=====================================
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @, staden, xvfb ,xauth
+Restrictions: allow-stderr
=====================================
debian/tests/data/input.fa
=====================================
@@ -0,0 +1,6 @@
+>seq1
+ATGCGTACGTAGCTAGCGTAGCTAGCTAG
+>seq2
+CGTAGCTAGGCTAGCTAGCTGATCGATGC
+>seq3
+TTGACGTAGCTAGCTAGCATCGATCGTAC
=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,58 @@
+#!/bin/sh
+set -e
+
+pkg=staden
+CUR_DIR=$(pwd)
+
+export PATH="/usr/share/staden/scripts:/usr/lib/staden/bin:$PATH"
+if [ -z "$AUTOPKGTEST_TMP" ]; then
+ AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+ trap "rm -rf ${AUTOPKGTEST_TMP}" EXIT INT QUIT ABRT PIPE TERM
+fi
+
+cp -a "$(dirname "$0")/data/"* "${AUTOPKGTEST_TMP}/"
+cd "${AUTOPKGTEST_TMP}"
+
+#CLI Test
+fasta-split input.fa
+split_count=$(ls -1 seq* 2>/dev/null | wc -l)
+if [ "$split_count" -ge 3 ]; then
+ echo "fasta-split created "
+else
+ exit 1
+fi
+
+#GUI Test
+bin1="gap4"
+bin2="pregap4"
+
+check_n_cleanup () {
+ local gap_pids="$(
+ ps aux | awk "/^$USER"'.*'"$bin1"'/ {print $2}' | xargs
+ )"
+ [ -n "$gap_pids" ] && kill $gap_pids || true
+
+ local pregap_pids="$(
+ ps aux | awk "/^$USER"'.*'"$bin2"'/ {print $2}' | xargs
+ )"
+ [ -n "$pregap_pids" ] && kill $pregap_pids || true
+
+ local xvfb_pids="$(
+ ps aux | awk -vORS=' ' "/^$USER"'.*[X]vfb/ {print $2}' | xargs
+ )"
+ [ -n "$xvfb_pids" ] && kill $xvfb_pids || true
+}
+
+cd "$AUTOPKGTEST_TMP"
+
+set -v
+
+echo "Launching gap4..."
+xvfb-run --auto-servernum "$bin1" &
+sleep 10
+
+echo "Launching pregap4..."
+xvfb-run --auto-servernum "$bin2" &
+sleep 10
+
+check_n_cleanup
View it on GitLab: https://salsa.debian.org/med-team/staden/-/commit/d540fd92b916d478c0c6e7b75d1db97f823c3ada
--
View it on GitLab: https://salsa.debian.org/med-team/staden/-/commit/d540fd92b916d478c0c6e7b75d1db97f823c3ada
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/20250705/2856308f/attachment-0001.htm>
More information about the debian-med-commit
mailing list