You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.5 KiB

  1. perl: Skip $0 test on busybox
  2. This test requires a ps which provides the -f option, as well as suitable output.
  3. We can't provide either with busybox. Just skip it for now.
  4. Signed-off-by: Marcel Denia <naoir@gmx.net>
  5. Index: perl-5.22.0/dist/threads/t/join.t
  6. ===================================================================
  7. --- perl-5.22.0.orig/dist/threads/t/join.t
  8. +++ perl-5.22.0/dist/threads/t/join.t
  9. @@ -110,36 +110,41 @@ sub skip {
  10. # We parse ps output so this is OS-dependent.
  11. if ($^O eq 'linux') {
  12. - # First modify $0 in a subthread.
  13. - #print "# mainthread: \$0 = $0\n";
  14. - threads->create(sub{ #print "# subthread: \$0 = $0\n";
  15. - $0 = "foobar";
  16. - #print "# subthread: \$0 = $0\n"
  17. - })->join;
  18. - #print "# mainthread: \$0 = $0\n";
  19. - #print "# pid = $$\n";
  20. - if (open PS, "ps -f |") { # Note: must work in (all) systems.
  21. - my ($sawpid, $sawexe);
  22. - while (<PS>) {
  23. - chomp;
  24. - #print "# [$_]\n";
  25. - if (/^\s*\S+\s+$$\s/) {
  26. - $sawpid++;
  27. - if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
  28. - $sawexe++;
  29. - }
  30. - last;
  31. - }
  32. - }
  33. - close PS or die;
  34. - if ($sawpid) {
  35. - ok($sawpid && $sawexe, 'altering $0 is effective');
  36. - } else {
  37. - skip("\$0 check: did not see pid $$ in 'ps -f |'");
  38. - }
  39. - } else {
  40. - skip("\$0 check: opening 'ps -f |' failed: $!");
  41. - }
  42. + if (readlink('/bin/ps') ne 'busybox') {
  43. + # First modify $0 in a subthread.
  44. + #print "# mainthread: \$0 = $0\n";
  45. + threads->create(sub{ #print "# subthread: \$0 = $0\n";
  46. + $0 = "foobar";
  47. + #print "# subthread: \$0 = $0\n"
  48. + })->join;
  49. + #print "# mainthread: \$0 = $0\n";
  50. + #print "# pid = $$\n";
  51. + if (open PS, "ps -f |") { # Note: must work in (all) systems.
  52. + my ($sawpid, $sawexe);
  53. + while (<PS>) {
  54. + chomp;
  55. + #print "# [$_]\n";
  56. + if (/^\s*\S+\s+$$\s/) {
  57. + $sawpid++;
  58. + if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
  59. + $sawexe++;
  60. + }
  61. + last;
  62. + }
  63. + }
  64. + close PS or die;
  65. + if ($sawpid) {
  66. + ok($sawpid && $sawexe, 'altering $0 is effective');
  67. + } else {
  68. + skip("\$0 check: did not see pid $$ in 'ps -f |'");
  69. + }
  70. + } else {
  71. + skip("\$0 check: opening 'ps -f |' failed: $!");
  72. + }
  73. + }
  74. + else {
  75. + skip("\$0 check: incompatible with busybox");
  76. + }
  77. } else {
  78. skip("\$0 check: only on Linux");
  79. }