smoke-python3 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #! /bin/bash
  2. #
  3. # debian/tests/smoke-python3
  4. # Part of Debian ‘python-lockfile’ package.
  5. #
  6. # Copyright © 2016 Ben Finney <bignose@debian.org>
  7. # This is free software; you may copy, modify, and/or distribute this work
  8. # under the terms of the GNU General Public License, version 3 or later.
  9. # No warranty expressed or implied.
  10. # See the file ‘/usr/share/common-licenses/GPL-3’ for details.
  11. #
  12. # Smoke test for package in Python 3 environments.
  13. set -o errexit
  14. set -o errtrace
  15. set -o nounset
  16. DISTRIBUTION_NAME=lockfile
  17. MODULE_NAMES=(
  18. lockfile
  19. )
  20. program_dir="$(dirname "$(realpath --strip "$0")")"
  21. # Use a working directory away from the source package root,
  22. # so that Python imports will not find the local source package.
  23. working_dir="$program_dir"
  24. cd "$working_dir"
  25. test_opts="--distribution=$DISTRIBUTION_NAME"
  26. for mod in ${MODULE_NAMES[@]} ; do
  27. # Accumulate the module names.
  28. test_opts="$test_opts --module=$mod"
  29. done
  30. for py in $(py3versions -i) ; do
  31. printf "Python command: %s\n" $py
  32. $py "$program_dir"/smoke_test.py $test_opts
  33. printf "\n"
  34. done
  35. # Local variables:
  36. # coding: utf-8
  37. # mode: shell-script
  38. # End:
  39. # vim: fileencoding=utf-8 filetype=sh :