summaryrefslogtreecommitdiffstats
path: root/tests/distros.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtests/distros.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/distros.sh b/tests/distros.sh
new file mode 100755
index 0000000..c34d272
--- /dev/null
+++ b/tests/distros.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+readonly DISTROS=(
+ 'arch'
+ 'alpine'
+ 'centos'
+ 'debian'
+ 'fedora'
+ 'ubuntu'
+)
+
+readonly DOCKER='docker'
+
+# do not redefine builtin `test`
+test_() {
+ local -r tag="${1}"
+
+ local -ra docker_opts=(
+ "--tag=asciinema/asciinema:${tag}"
+ "--file=tests/distros/Dockerfile.${tag}"
+ )
+
+ printf "\e[1;32mTesting on %s...\e[0m\n\n" "${tag}"
+
+ # shellcheck disable=SC2068
+ "${DOCKER}" build ${docker_opts[@]} .
+
+ "${DOCKER}" run --rm -it "asciinema/asciinema:${tag}" tests/integration.sh
+}
+
+
+for distro in "${DISTROS[@]}"; do
+ test_ "${distro}"
+done
+
+printf "\n\e[1;32mAll tests passed.\e[0m\n"