From e316e90d1f3124e1ddb7f33f77b91af178b963bd Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 17 Mar 2022 21:06:23 -0400 Subject: Add installed package smoke tests in pkg-test directory --- pkg-test/run-all | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 pkg-test/run-all (limited to 'pkg-test/run-all') diff --git a/pkg-test/run-all b/pkg-test/run-all new file mode 100755 index 00000000..e68044d6 --- /dev/null +++ b/pkg-test/run-all @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -e + +cd $(dirname $0)/.. + +CUR_TEMP= +function clean_temp() { + if [[ $CUR_TEMP =~ .*\.qpdf-test$ && -d $CUR_TEMP ]]; then + rm -rf $CUR_TEMP + fi +} + +trap clean_temp EXIT + +declare -a any_failed +for i in pkg-test/test-*; do + if [[ $i =~ .*~ ]]; then + continue + fi + CUR_TEMP=$(mktemp --suffix=.qpdf-test -d) + printf "\n\n\e[40m\e[1;35m*** RUNNING $i ***\e[0m\n\n\n" + if ! $i $CUR_TEMP; then + any_failed=(${any_failed[*]} $i) + fi + clean_temp +done + +if [[ ${#any_failed} != 0 ]]; then + for i in ${any_failed[*]}; do + echo 1>&2 "FAILED: $i" + done + exit 2 +fi +printf "\n\n\e[40m\e[1;35m*** ALL TESTS PASSED ***\e[0m\n" -- cgit v1.2.3-70-g09d2