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