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.
 
 
 
 
 
 

64 lines
1.6 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. # this test does double duty: The obvious is checking for --help and co,
  8. # but it also checks if the binary can find all methods in the library.
  9. # The later is quite handy for manual testing of non-abibreaking changes
  10. export LD_BIND_NOW=1
  11. checkversionmessage() {
  12. testsuccess grep '^apt .* (' ${1}-help.output
  13. }
  14. checkhelpmessage() {
  15. checkversionmessage "$1"
  16. testsuccess grep '^Usage:' ${1}-help.output
  17. }
  18. checkoptions() {
  19. testsuccess $1 --help
  20. cp -f rootdir/tmp/testsuccess.output ${1}-help.output
  21. checkhelpmessage "$1"
  22. testsuccess $1 --version
  23. cp -f rootdir/tmp/testsuccess.output ${1}-help.output
  24. checkversionmessage "$1"
  25. }
  26. for CMD in 'apt-cache' 'apt-cdrom' 'apt-config' \
  27. 'apt-extracttemplates' 'apt-get' 'apt-helper' \
  28. 'apt-mark' 'apt-sortpkgs' 'apt' 'apt-ftparchive'; do
  29. cmd="$(echo "$CMD" | tr -d '-')"
  30. msgtest 'Test for failure with no parameters calling' "$CMD"
  31. if $cmd > ${cmd}-help.output 2>&1; then
  32. echo
  33. cat ${cmd}-help.output
  34. msgfail 'zero exit'
  35. else
  36. msgpass
  37. fi
  38. checkhelpmessage "$cmd"
  39. checkoptions "$cmd"
  40. done
  41. for CMD in 'apt-dump-solver' 'apt-internal-solver'; do
  42. checkoptions "$(echo "$CMD" | tr -d '-')"
  43. done
  44. # in times of need, we all look for super cow to save the day
  45. testsuccess aptget moo
  46. testsuccess aptget moo -q=2
  47. testsuccess aptget moo moo
  48. testsuccess aptget moo moo -q=2
  49. testsuccess aptget moo moo --color
  50. testsuccess aptget moo moo moo
  51. testsuccess aptget moo moo moo -q=2
  52. testsuccess aptget moo moo moo moo
  53. testsuccess aptget moo moo moo moo -q=2