source: drbl_ui/backup/test_busybox/busybox-1.7.2/testsuite/pidof.tests @ 29

Last change on this file since 29 was 20, checked in by chris, 17 years ago
File size: 869 bytes
Line 
1#!/bin/sh
2
3# pidof tests.
4# Copyright 2005 by Bernhard Fischer
5# Licensed under GPL v2, see file LICENSE for details.
6
7# AUDIT:
8
9. testing.sh
10
11# testing "test name" "options" "expected result" "file input" "stdin"
12
13testing "pidof (exit with error)" \
14  "pidof veryunlikelyoccuringbinaryname ; echo \$?" "1\n" "" ""
15testing "pidof (exit with success)" "pidof pidof > /dev/null; echo \$?" \
16  "0\n" "" ""
17# We can get away with this because it says #!/bin/sh up top.
18
19testing "pidof this" "pidof pidof.tests | grep -o -w $$" "$$\n" "" ""
20
21optional FEATURE_PIDOF_SINGLE
22testing "pidof -s" "pidof -s init" "1\n" "" ""
23
24optional FEATURE_PIDOF_OMIT
25testing "pidof -o %PPID" "pidof -o %PPID pidof.tests | grep -o -w $$" "" "" ""
26testing "pidof -o %PPID NOP" "pidof -o %PPID -s init" "1\n" "" ""
27testing "pidof -o init" "pidof -o 1 init | grep -o -w 1" "" "" ""
28
29exit $FAILCOUNT
Note: See TracBrowser for help on using the repository browser.