diff --git a/.gitignore b/.gitignore index eccc7e0..4988333 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/libqb-1.0.3.tar.xz -/libqb-1.0.3.tar.xz +/libqb-*.tar.* diff --git a/tests/run-tests.sh b/tests/run-tests.sh new file mode 100644 index 0000000..58938c5 --- /dev/null +++ b/tests/run-tests.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +TESTS="array.test map.test rb.test log.test blackbox-segfault.sh loop.test ipc.test" +TESTDIR=/usr/lib64/libqb/tests + +TESTS_RUN=0 +TESTS_FAILED=0 + +export PATH=$TESTDIR:$PATH + +for i in ${TESTS} +do + echo + echo "---- running $i" + + # Cope with non-executable scripts + if [ -z "`echo $i|grep \\.sh`" ] + then + ${TESTDIR}/${i} + else + sh ${TESTDIR}/${i} + fi + + # Did it succeed? + if [ $? != 0 ] + then + TESTS_FAILED=$((TESTS_FAILED + 1)) + echo "FAILED: $i" + fi + TESTS_RUN=$((TESTS_RUN + 1)) +done +echo +echo "Tests run: $TESTS_RUN" +echo "Tests failed: $TESTS_FAILED" + +if [ $TESTS_FAILED -gt 0 ] +then + exit 1 +else + exit 0 +fi diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..ad37569 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,20 @@ +- hosts: localhost + roles: + - role: standard-test-source # Fetch source tarball and unpack it into the test environment + tags: + - always + + - role: standard-test-basic + tags: + - atomic + - classic + required_packages: + - bash + - libqb-tests + - check + - words + + tests: + - check: # Run tests + dir: . + run: ./run-tests.sh