config.h.in
config.log
config.status
-config/
configure
doc/Makefile
doc/Makefile.in
-SUBDIRS = doc src po icons
+SUBDIRS = doc src po icons testsuite
#EXTRA_DIST = config.rpath ABOUT-NLS mkinstalldirs
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_CONFIG_MACRO_DIR([m4])
-AC_INIT([psmisc],[22.19])
+AC_INIT([psmisc],[22.20])
AC_CONFIG_SRCDIR([src/comm.h])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR([config])
dnl Checks for Large File System
AC_SYS_LARGEFILE
+if test x"$DEJAGNU" = x
+then
+ DEJAGNU="\$(top_srcdir)/testsuite/global-conf.exp"
+fi
+AC_SUBST(DEJAGNU)
+
AC_CONFIG_FILES([Makefile
doc/Makefile
src/Makefile
icons/Makefile
- po/Makefile.in])
+ po/Makefile.in
+ testsuite/Makefile])
AC_OUTPUT
--- /dev/null
+*.log
+*.sum
+site.bak
+site.exp
--- /dev/null
+AUTOMAKE_OPTIONS = dejagnu
+export DEJAGNU
+
+# Programs that are expected across the board.
+DEJATOOL = killall
+
+if WANT_FUSER
+ DEJATOOL += fuser
+endif
+
+
+EXTRA_DIST =
--- /dev/null
+
+
+regexp "(.*\/)testsuite" $objdir objdir topdir
+
+
+proc expect_pass { testname reg } {
+ expect {
+ -re "$reg" { pass "$testname" }
+ default { fail "$testname" }
+ timeout { fail "$testname" }
+ }
+}
+
+proc expect_nothing { test } {
+ expect {
+ -re "\\S" { fail "$test" }
+ eof { pass "$test" }
+ }
+}
--- /dev/null
+#
+# Testsuite for fuser
+#
+proc cleanup { } {
+ global test_file
+ exec rm $test_file
+}
+
+set fuser "${topdir}src/fuser"
+set test_file [ exec mktemp ]
+
+set verbose_header "\\s+USER\\s+PID ACCESS COMMAND\\s*"
+
+set test "fuser with no arguments"
+spawn $fuser
+expect_pass "$test" "^No process specification given\\s*Usage: fuser"
+
+set test "fuser no args, no proc"
+spawn $fuser $test_file
+expect_nothing "$test"
+
+set test "fuser -a no proc"
+spawn $fuser -a $test_file
+expect_pass "$test" "^${test_file}:\\s*$"
+
+set test "fuser -v, no proc"
+spawn $fuser $test_file
+expect_nothing "$test"
+
+set test "fuser -av, no proc"
+spawn $fuser -av $test_file
+expect_pass "$test" "^${verbose_header}${test_file}:\\s*$"
+
+set test "fuser -va, no proc"
+spawn $fuser -av $test_file
+expect_pass "$test" "^${verbose_header}${test_file}:\\s*$"
+
+set test "fuser -l"
+spawn $fuser -l
+expect_pass "$test" "^(\[A-Z12\]+\\s*)+$"
+
+
--- /dev/null
+#
+# Testsuite for killall
+#
+
+set killall "${topdir}src/killall"
+set fake_proc_name "afakeprocname"
+
+set test "killall with no arguments"
+spawn $killall
+expect_pass "$test" "^Usage: killall \\\[OPTION\\\]\\.\\.\\. \\\[--\\\] NAME\\.\\.\\."
+
+set test "killall list signals"
+spawn $killall -l
+expect_pass "$test" "^(\[A-Z12\]+\\s*)+$"
+
+set test "killall process not found"
+spawn $killall ${fake_proc_name}
+expect_pass "$test" "${fake_proc_name}: no process found"
+