1 perl: Skip $0 test on busybox
3 This test requires a ps which provides the -f option, as well as suitable output.
4 We can't provide either with busybox. Just skip it for now.
6 Signed-off-by: Marcel Denia <naoir@gmx.net>
8 --- a/dist/threads/t/join.t
9 +++ b/dist/threads/t/join.t
10 @@ -110,36 +110,41 @@ sub skip {
12 # We parse ps output so this is OS-dependent.
14 - # First modify $0 in a subthread.
15 - #print "# mainthread: \$0 = $0\n";
16 - threads->create(sub{ #print "# subthread: \$0 = $0\n";
18 - #print "# subthread: \$0 = $0\n"
20 - #print "# mainthread: \$0 = $0\n";
21 - #print "# pid = $$\n";
22 - if (open PS, "ps -f |") { # Note: must work in (all) systems.
23 - my ($sawpid, $sawexe);
27 - if (/^\s*\S+\s+$$\s/) {
29 - if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
37 - ok($sawpid && $sawexe, 'altering $0 is effective');
39 - skip("\$0 check: did not see pid $$ in 'ps -f |'");
42 - skip("\$0 check: opening 'ps -f |' failed: $!");
44 + if (readlink('/bin/ps') ne 'busybox') {
45 + # First modify $0 in a subthread.
46 + #print "# mainthread: \$0 = $0\n";
47 + threads->create(sub{ #print "# subthread: \$0 = $0\n";
49 + #print "# subthread: \$0 = $0\n"
51 + #print "# mainthread: \$0 = $0\n";
52 + #print "# pid = $$\n";
53 + if (open PS, "ps -f |") { # Note: must work in (all) systems.
54 + my ($sawpid, $sawexe);
58 + if (/^\s*\S+\s+$$\s/) {
60 + if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
68 + ok($sawpid && $sawexe, 'altering $0 is effective');
70 + skip("\$0 check: did not see pid $$ in 'ps -f |'");
73 + skip("\$0 check: opening 'ps -f |' failed: $!");
77 + skip("\$0 check: incompatible with busybox");
80 skip("\$0 check: only on Linux");