nareshkamboju

futex run.sh patch

May 15th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.24 KB | None | 0 0
  1. diff --git a/tools/testing/selftests/futex/functional/run.sh b/tools/testing/selftests/futex/functional/run.sh
  2. index 7ff002eed624..d76bbd77d1de 100755
  3. --- a/tools/testing/selftests/futex/functional/run.sh
  4. +++ b/tools/testing/selftests/futex/functional/run.sh
  5. @@ -22,6 +22,29 @@
  6.  #
  7.  ###############################################################################
  8.  
  9. +check_return() {
  10. +    exit_code="$?"
  11. +    test_case="$@"
  12. +
  13. +    if [ "${exit_code}" -ne 0 ]; then
  14. +        echo "selftests: ${test_case} fail"
  15. +        return "${exit_code}"
  16. +    else
  17. +        echo "selftests: ${test_case} pass"
  18. +        return 0
  19. +    fi
  20. +}
  21. +
  22. +run() {
  23. +    # shellcheck disable=SC2039
  24. +    local test="$@"
  25. +    echo
  26. +    echo "INFO Running ${test_case_id} test..."
  27. +    eval  "./${test}"
  28. +    test_case_id="$(echo "${test}" |  awk '{for (i=1; i<NF; i++) printf $i ; print $i}')"
  29. +    check_return "${test_case_id}"
  30. +}
  31. +
  32.  # Test for a color capable console
  33.  if [ -z "$USE_COLOR" ]; then
  34.      tput setf 7 || tput setaf 7
  35. @@ -38,42 +61,42 @@ fi
  36.  echo
  37.  # requeue pi testing
  38.  # without timeouts
  39. -./futex_requeue_pi $COLOR
  40. -./futex_requeue_pi $COLOR -b
  41. -./futex_requeue_pi $COLOR -b -l
  42. -./futex_requeue_pi $COLOR -b -o
  43. -./futex_requeue_pi $COLOR -l
  44. -./futex_requeue_pi $COLOR -o
  45. +run "futex_requeue_pi $COLOR"
  46. +run "futex_requeue_pi $COLOR -b"
  47. +run "futex_requeue_pi $COLOR -b -l"
  48. +run "futex_requeue_pi $COLOR -b -o"
  49. +run "futex_requeue_pi $COLOR -l"
  50. +run "futex_requeue_pi $COLOR -o"
  51.  # with timeouts
  52. -./futex_requeue_pi $COLOR -b -l -t 5000
  53. -./futex_requeue_pi $COLOR -l -t 5000
  54. -./futex_requeue_pi $COLOR -b -l -t 500000
  55. -./futex_requeue_pi $COLOR -l -t 500000
  56. -./futex_requeue_pi $COLOR -b -t 5000
  57. -./futex_requeue_pi $COLOR -t 5000
  58. -./futex_requeue_pi $COLOR -b -t 500000
  59. -./futex_requeue_pi $COLOR -t 500000
  60. -./futex_requeue_pi $COLOR -b -o -t 5000
  61. -./futex_requeue_pi $COLOR -l -t 5000
  62. -./futex_requeue_pi $COLOR -b -o -t 500000
  63. -./futex_requeue_pi $COLOR -l -t 500000
  64. +run "futex_requeue_pi $COLOR -b -l -t 5000"
  65. +run "futex_requeue_pi $COLOR -l -t 5000"
  66. +run "futex_requeue_pi $COLOR -b -l -t 500000"
  67. +run "futex_requeue_pi $COLOR -l -t 500000"
  68. +run "futex_requeue_pi $COLOR -b -t 5000"
  69. +run "futex_requeue_pi $COLOR -t 5000"
  70. +run "futex_requeue_pi $COLOR -b -t 500000"
  71. +run "futex_requeue_pi $COLOR -t 500000"
  72. +run "futex_requeue_pi $COLOR -b -o -t 5000"
  73. +run "futex_requeue_pi $COLOR -l -t 5000"
  74. +run "futex_requeue_pi $COLOR -b -o -t 500000"
  75. +run "futex_requeue_pi $COLOR -l -t 500000"
  76.  # with long timeout
  77. -./futex_requeue_pi $COLOR -b -l -t 2000000000
  78. -./futex_requeue_pi $COLOR -l -t 2000000000
  79. +run "futex_requeue_pi $COLOR -b -l -t 2000000000"
  80. +run "futex_requeue_pi $COLOR -l -t 2000000000"
  81.  
  82.  
  83.  echo
  84. -./futex_requeue_pi_mismatched_ops $COLOR
  85. +run "futex_requeue_pi_mismatched_ops $COLOR"
  86.  
  87.  echo
  88. -./futex_requeue_pi_signal_restart $COLOR
  89. +run "futex_requeue_pi_signal_restart $COLOR"
  90.  
  91.  echo
  92. -./futex_wait_timeout $COLOR
  93. +run "futex_wait_timeout $COLOR"
  94.  
  95.  echo
  96. -./futex_wait_wouldblock $COLOR
  97. +run "futex_wait_wouldblock $COLOR"
  98.  
  99.  echo
  100. -./futex_wait_uninitialized_heap $COLOR
  101. -./futex_wait_private_mapped_file $COLOR
  102. +run "futex_wait_uninitialized_heap $COLOR"
  103. +run "futex_wait_private_mapped_file $COLOR"
  104. --
  105. 2.11.0
Add Comment
Please, Sign In to add comment