patch-config_test-driver 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --- util-linux-2.25.2.orig/config/test-driver 2013-08-05 05:10:38.000000000 -0500
  2. +++ util-linux-2.25.2/config/test-driver 2014-12-27 12:19:32.871521679 -0600
  3. @@ -1,7 +1,7 @@
  4. #! /bin/sh
  5. # test-driver - basic testsuite driver script.
  6. -scriptversion=2012-06-27.10; # UTC
  7. +scriptversion=2013-07-13.22; # UTC
  8. # Copyright (C) 2011-2013 Free Software Foundation, Inc.
  9. #
  10. @@ -44,13 +44,12 @@ print_usage ()
  11. Usage:
  12. test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
  13. [--expect-failure={yes|no}] [--color-tests={yes|no}]
  14. - [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
  15. + [--enable-hard-errors={yes|no}] [--]
  16. + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
  17. The '--test-name', '--log-file' and '--trs-file' options are mandatory.
  18. END
  19. }
  20. -# TODO: better error handling in option parsing (in particular, ensure
  21. -# TODO: $log_file, $trs_file and $test_name are defined).
  22. test_name= # Used for reporting.
  23. log_file= # Where to save the output of the test script.
  24. trs_file= # Where to save the metadata of the test run.
  25. @@ -69,10 +68,23 @@ while test $# -gt 0; do
  26. --enable-hard-errors) enable_hard_errors=$2; shift;;
  27. --) shift; break;;
  28. -*) usage_error "invalid option: '$1'";;
  29. + *) break;;
  30. esac
  31. shift
  32. done
  33. +missing_opts=
  34. +test x"$test_name" = x && missing_opts="$missing_opts --test-name"
  35. +test x"$log_file" = x && missing_opts="$missing_opts --log-file"
  36. +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
  37. +if test x"$missing_opts" != x; then
  38. + usage_error "the following mandatory options are missing:$missing_opts"
  39. +fi
  40. +
  41. +if test $# -eq 0; then
  42. + usage_error "missing argument"
  43. +fi
  44. +
  45. if test $color_tests = yes; then
  46. # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
  47. red='' # Red.