From ef3904423d3301d87b4b499b7e5feb359d622405 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 04:20:21 +0200 Subject: Adding debian version 4.6.2-3+deb10u1. Signed-off-by: Daniel Baumann --- debian/tests/control | 2 ++ debian/tests/t/boilerplate.sh | 49 +++++++++++++++++++++++++++++++++++++++ debian/tests/t/command.t | 17 ++++++++++++++ debian/tests/t/create-list-quit.t | 9 +++++++ debian/tests/t/dash-Dm.t | 20 ++++++++++++++++ debian/tests/t/dash-U.t | 9 +++++++ debian/tests/t/version-help.t | 11 +++++++++ 7 files changed, 117 insertions(+) create mode 100644 debian/tests/control create mode 100644 debian/tests/t/boilerplate.sh create mode 100755 debian/tests/t/command.t create mode 100755 debian/tests/t/create-list-quit.t create mode 100755 debian/tests/t/dash-Dm.t create mode 100755 debian/tests/t/dash-U.t create mode 100755 debian/tests/t/version-help.t (limited to 'debian/tests') diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..bf2a801 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,2 @@ +Test-Command: prove -v debian/tests/t +Depends: @, perl diff --git a/debian/tests/t/boilerplate.sh b/debian/tests/t/boilerplate.sh new file mode 100644 index 0000000..8b28d59 --- /dev/null +++ b/debian/tests/t/boilerplate.sh @@ -0,0 +1,49 @@ +# -*- sh -*- + +TESTNAME=`basename $0`.`mktemp -u XXXXXXXX` +SCREEN="screen -S $TESTNAME" +SCREENRC=/dev/null +export SCREENRC +count=0 + +check_exit_code_true() { + if [ "$?" != 0 ]; then echo -n 'not '; fi; echo ok $(( count+=1 )) - "$@" +} + +check_exit_code_false() { + if [ "$?" = 0 ]; then echo -n 'not '; fi; echo ok $(( count+=1 )) - "$@" +} + +has_session_with_testname() { + screen -ls | fgrep -q "$TESTNAME" +} + +session_exists_2_tests() { + screen -ls | fgrep -q '(Detached)' + check_exit_code_true Detached session found + + has_session_with_testname + check_exit_code_true Session has expected session name +} + +create_session_3_tests() { + $SCREEN -d -m "$@" + check_exit_code_true Create session + + sleep 1 + + session_exists_2_tests +} + +kill_session_2_tests() { + $SCREEN -X quit + check_exit_code_true Quit command sent to session + + has_session_with_testname + check_exit_code_false Session is gone +} + +has_window_number_zero() { + $SCREEN -Q windows | egrep -q '^0 ' + check_exit_code_true Session has a window with id 0 +} diff --git a/debian/tests/t/command.t b/debian/tests/t/command.t new file mode 100755 index 0000000..c59bafb --- /dev/null +++ b/debian/tests/t/command.t @@ -0,0 +1,17 @@ +#!/bin/sh + +echo 1..4 + +. `dirname $0`/boilerplate.sh + +$SCREEN -D -m -s /bin/true sleep 2 & +check_exit_code_true Create session + +sleep 1 + +session_exists_2_tests + +sleep 2 + +has_session_with_testname +check_exit_code_false Session is gone diff --git a/debian/tests/t/create-list-quit.t b/debian/tests/t/create-list-quit.t new file mode 100755 index 0000000..d792578 --- /dev/null +++ b/debian/tests/t/create-list-quit.t @@ -0,0 +1,9 @@ +#!/bin/sh + +echo 1..6 + +. `dirname $0`/boilerplate.sh + +create_session_3_tests +has_window_number_zero +kill_session_2_tests diff --git a/debian/tests/t/dash-Dm.t b/debian/tests/t/dash-Dm.t new file mode 100755 index 0000000..1f2b391 --- /dev/null +++ b/debian/tests/t/dash-Dm.t @@ -0,0 +1,20 @@ +#!/bin/sh + +echo 1..5 + +. `dirname $0`/boilerplate.sh + +$SCREEN -D -m & +check_exit_code_true Create session + +sleep 1 + +session_exists_2_tests + +$SCREEN -X quit +check_exit_code_true Quit command sent to session + +sleep 1; + +has_session_with_testname +check_exit_code_false Session is gone diff --git a/debian/tests/t/dash-U.t b/debian/tests/t/dash-U.t new file mode 100755 index 0000000..d8ef84c --- /dev/null +++ b/debian/tests/t/dash-U.t @@ -0,0 +1,9 @@ +#!/bin/sh + +echo 1..6 + +. `dirname $0`/boilerplate.sh + +create_session_3_tests -U +has_window_number_zero +kill_session_2_tests diff --git a/debian/tests/t/version-help.t b/debian/tests/t/version-help.t new file mode 100755 index 0000000..f6496c0 --- /dev/null +++ b/debian/tests/t/version-help.t @@ -0,0 +1,11 @@ +#!/bin/sh + +echo 1..2 + +. `dirname $0`/boilerplate.sh + +screen -v | fgrep -q 'Screen version ' +check_exit_code_true Outputs version + +screen -h | fgrep -q 'Options:' +check_exit_code_true Outputs help -- cgit v1.2.3