Files
asciinema/tests/distros.sh

39 lines
680 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
readonly DISTROS=(
'arch'
'alpine'
'centos'
'debian'
'fedora'
'ubuntu'
)
readonly DOCKER='docker'
2021-10-29 23:04:09 -04:00
# do not redefine builtin `test`
test_() {
local -r tag="${1}"
2017-12-02 19:00:53 +01:00
local -ra docker_opts=(
"--tag=asciinema/asciinema:${tag}"
"--file=tests/distros/Dockerfile.${tag}"
)
2021-10-29 23:04:09 -04:00
printf "\e[1;32mTesting on %s...\e[0m\n\n" "${tag}"
# shellcheck disable=SC2068
"${DOCKER}" build ${docker_opts[@]} .
2021-10-29 23:04:09 -04:00
"${DOCKER}" run --rm -it "asciinema/asciinema:${tag}" tests/integration.sh
}
2017-12-02 19:00:53 +01:00
for distro in "${DISTROS[@]}"; do
test_ "${distro}"
done
2021-10-29 23:04:09 -04:00
printf "\n\e[1;32mAll tests passed.\e[0m\n"