From 9869c2ff14f83cb1e35afd2405930d10a1cd72e2 Mon Sep 17 00:00:00 2001 From: Tomas Halman Date: Tue, 14 Mar 2023 11:57:27 +0100 Subject: [PATCH] Re-add gating tests Related: rhbz#2092160 --- tests/jqtests.sh | 30 ++++++++++++++++++++++++++++++ tests/tests.yml | 18 ++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 tests/jqtests.sh create mode 100644 tests/tests.yml diff --git a/tests/jqtests.sh b/tests/jqtests.sh new file mode 100755 index 0000000..525e19d --- /dev/null +++ b/tests/jqtests.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +die () { + echo "$1" >&2 + exit 1 +} + +# link jq binary. This make the tests to use +# installed binary instead of compiled one +cd source || die "missing source directory" +rm -f jq tests/*.log 2>/dev/null +ln -s /usr/bin/jq || die "failed to link jq binary" + +# run the tests +# List of tests is taken from Makefile +TESTS="tests/optionaltest tests/mantest tests/jqtest tests/onigtest tests/shtest tests/utf8test tests/base64test" + +for t in $TESTS; do + echo -n "Test $t ... " + ./${t} >"${t}.log" 2>&1 + RET=$? + if [ $RET = 0 ]; then + echo "ok" + else + echo "failed" + cat "${t}.log" + die "Test ${t} failed" + fi +done +exit 0 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..c729600 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,18 @@ +--- +- hosts: localhost + roles: + - role: standard-test-source + tags: + - always + + - role: standard-test-basic + tags: + - classic + required_packages: + - jq + - valgrind + tests: + - jqtests: + dir: . + run: ./jqtests.sh + save-files: ["source/tests/*.log"]