| #!/bin/bash |
| |
| [ -f testing.sh ] && . testing.sh |
| |
| #testing "name" "command" "result" "infile" "stdin" |
| |
| echo "#!$(which sh) |
| while true; do |
| sleep 0.1 |
| done" > toybox.killall.test.script |
| chmod a+x toybox.killall.test.script |
| cp toybox.killall.test.script toybox.test |
| |
| ./toybox.test & |
| testing "short name" "killall toybox.test && echo killed ; pgrep -l toybox.test || echo really" "killed\nreally\n" "" "" |
| |
| ./toybox.killall.test.script & |
| testing "long name" "killall toybox.killall.test.script && echo killed ; pgrep -l toybox.killall.test.script || echo really" "killed\nreally\n" "" "" |
| |
| rm -f toybox.killall.test.script toybox.test |