01-trivial.sh 961 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. ### Constants
  3. c_valgrind_min=1
  4. version_stdout=${s_basename}-version.stdout
  5. help_stdout=${s_basename}-help.stdout
  6. no_args_stderr=${s_basename}-no-args.stderr
  7. scenario_cmd() {
  8. # Check --help.
  9. setup_check "check --help"
  10. ${c_valgrind_cmd} ./tarsnap --no-default-config \
  11. --help > "${help_stdout}"
  12. echo $? > "${c_exitfile}"
  13. # Check --version.
  14. setup_check "check --version"
  15. ${c_valgrind_cmd} ./tarsnap --no-default-config \
  16. --version > "${version_stdout}"
  17. echo $? > "${c_exitfile}"
  18. setup_check "check --version output"
  19. grep -q "tarsnap" "${version_stdout}"
  20. echo $? > "${c_exitfile}"
  21. # Check no arguments (expect exit code 1, error message).
  22. setup_check "check no arguments"
  23. ${c_valgrind_cmd} ./tarsnap --no-default-config \
  24. 2> "${no_args_stderr}"
  25. expected_exitcode 1 $? > "${c_exitfile}"
  26. setup_check "check no arguments output"
  27. grep -q "tarsnap: Must specify one of" "${no_args_stderr}"
  28. echo $? > "${c_exitfile}"
  29. }