2019-06-11 04:53:28 -04:00
|
|
|
#!/usr/bin/env bash
|
2016-05-10 16:00:13 -04:00
|
|
|
|
2016-11-20 17:16:10 -05:00
|
|
|
# Test Stow across multiple Perl versions, by executing the
|
|
|
|
# Docker image built via build-docker.sh.
|
2019-06-28 15:10:45 -04:00
|
|
|
#
|
|
|
|
# Usage: ./test-docker.sh [list | PERL_VERSION]
|
|
|
|
#
|
|
|
|
# If the first argument is 'list', list available Perl versions.
|
|
|
|
# If the first argument is a Perl version, test just that version interactively.
|
|
|
|
# If no arguments are given test all available Perl versions non-interactively.
|
2016-11-20 17:16:10 -05:00
|
|
|
|
2019-06-28 12:08:48 -04:00
|
|
|
version=$( tools/get-version )
|
2016-11-20 17:16:10 -05:00
|
|
|
|
2019-06-28 15:10:45 -04:00
|
|
|
if [ -z "$1" ]; then
|
|
|
|
# Normal non-interactive run
|
|
|
|
docker run --rm -it \
|
|
|
|
-v $(pwd):$(pwd) \
|
|
|
|
-w $(pwd) \
|
|
|
|
stowtest:$version
|
|
|
|
elif [ "$1" == list ]; then
|
|
|
|
# List available Perl versions
|
|
|
|
docker run --rm -it \
|
|
|
|
-v $(pwd):$(pwd) \
|
|
|
|
-v $(pwd)/docker/run-stow-tests.sh:/run-stow-tests.sh \
|
|
|
|
-w $(pwd) \
|
|
|
|
-e LIST_PERL_VERSIONS=1 \
|
|
|
|
stowtest:$version
|
|
|
|
else
|
|
|
|
# Interactive run for testing / debugging a particular version
|
|
|
|
perl_version="$1"
|
|
|
|
docker run --rm -it \
|
|
|
|
-v $(pwd):$(pwd) \
|
|
|
|
-v $(pwd)/docker/run-stow-tests.sh:/run-stow-tests.sh \
|
|
|
|
-w $(pwd) \
|
|
|
|
-e PERL_VERSION=$perl_version \
|
|
|
|
stowtest:$version
|
|
|
|
fi
|