# # 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" set test "killall using -ve" spawn $killall -ve ${fake_proc_name} expect_pass "$test" "${fake_proc_name}: no process found" set signals [regexp -all -inline {\w+} [exec $killall -l]] foreach signame $signals { set test "killall using signal $signame" spawn $killall -$signame ${fake_proc_name} expect_pass "$test" "${fake_proc_name}: no process found" set test "killall using signal SIG$signame" spawn $killall -SIG$signame ${fake_proc_name} expect_pass "$test" "${fake_proc_name}: no process found" }