harish chavre pushed to branch master at Debian Med / dicomscope


Commits:
b36716c3 by Harish Chavre at 2026-02-12T09:00:55+05:30
add autopkgtest for dicomscope

- - - - -


2 changed files:

- + debian/tests/control
- + debian/tests/run-unit-test


Changes:

=====================================
debian/tests/control
=====================================
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends:@, dicomscope, dcmtk, xvfb, xauth
+Restrictions: allow-stderr 


=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,35 @@
+#!/bin/bash
+set -e
+
+bin="dicomscope"
+TESTFILE="/usr/share/dicomscope/reports/reportsi.dcm"
+
+if [ -z "$AUTOPKGTEST_TMP" ]; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${bin}-test.XXXXXX)
+  trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
+fi
+
+check_n_cleanup () {
+    local program_pids="$(
+        ps aux \
+        | awk "/^$USER"'.*dicomscope/ {print $2}' \
+        | xargs
+    )"
+
+    local xvfb_pids="$(
+        ps aux \
+        | awk -vORS=' ' "/^$USER"'.*[X]vfb/ {print $2}' \
+        | xargs
+    )"
+
+    [ -n "$program_pids" ] && kill $program_pids || true
+    [ -n "$xvfb_pids" ] && kill $xvfb_pids || true
+}
+
+cd "$AUTOPKGTEST_TMP"
+
+set -v
+xvfb-run --auto-servernum /usr/bin/dicomscope "$TESTFILE" 2>&1 &
+sleep  30
+check_n_cleanup
+



View it on GitLab: 
https://salsa.debian.org/med-team/dicomscope/-/commit/b36716c358ace8af2b63ae9e4bf91b23afa10949

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/dicomscope/-/commit/b36716c358ace8af2b63ae9e4bf91b23afa10949
You're receiving this email because of your account on salsa.debian.org.


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to