test-docker.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env bash
  2. # Test Stow across multiple Perl versions, by executing the
  3. # Docker image built via build-docker.sh.
  4. #
  5. # Usage: ./test-docker.sh [list | PERL_VERSION]
  6. #
  7. # If the first argument is 'list', list available Perl versions.
  8. # If the first argument is a Perl version, test just that version interactively.
  9. # If no arguments are given test all available Perl versions non-interactively.
  10. version=$( tools/get-version )
  11. if [ -z "$1" ]; then
  12. # Normal non-interactive run
  13. docker run --rm -it \
  14. -v $(pwd):$(pwd) \
  15. -w $(pwd) \
  16. stowtest:$version
  17. elif [ "$1" == list ]; then
  18. # List available Perl versions
  19. docker run --rm -it \
  20. -v $(pwd):$(pwd) \
  21. -v $(pwd)/docker/run-stow-tests.sh:/run-stow-tests.sh \
  22. -w $(pwd) \
  23. -e LIST_PERL_VERSIONS=1 \
  24. stowtest:$version
  25. else
  26. # Interactive run for testing / debugging a particular version
  27. perl_version="$1"
  28. docker run --rm -it \
  29. -v $(pwd):$(pwd) \
  30. -v $(pwd)/docker/run-stow-tests.sh:/run-stow-tests.sh \
  31. -w $(pwd) \
  32. -e PERL_VERSION=$perl_version \
  33. stowtest:$version
  34. fi