From 67bfc771c66863ba0c7bef7d05bd0c98f6dca074 Mon Sep 17 00:00:00 2001 From: Chai Feng Date: Sun, 20 Oct 2019 17:18:35 +0200 Subject: [PATCH] Update travis ci --- .travis.yml | 3 +-- test.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 test.sh diff --git a/.travis.yml b/.travis.yml index cecec77..b608c33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,7 @@ language: bash os: linux dist: trusty script: -- bash test/ufw-docker.test.sh -- bash test/ufw-docker-service.test.sh +- bash test.sh notifications: slack: secure: pbbwN/dxrXXvQnJM5YhLt3A7t7ptvm5G3yQOimqBJVlLY7dJdPcUy6agntyLQ5cf+CHKVgMreu5m7qdTlSUeypNSi5+gbfNQD70l5TPG/ClqN/GnaNlrv4Y9ugL7kUWBqtMZSCwHHCy3Omv+oYjBixonJBfDMr0mn6ShkHRpgmjjUtByHhGy5gyNlKjoxB+04AnLkuIiz9mRUIkgGeeIcIkS8pE4E69Mh/K78h0oCZbQF1H4Eu22nOCdQhWH5StT0G+/pDqHGP4J8mDo3NVNMyySFRY0lSwUj2OUnX+VVK9RWUicaozCgob4Oi3Pf+5bNcxTdo2ntI/e0fEcpIqiSHOy/iLBrQMGmZY7aoVNG7IWQwM2Zt6wXORcYl6l2XMOVuFx+h9PQd+nol9Eh9JxGsQjrfdQ8rNK8DkdNat0axpex3w3PWpbFRtQJ3A21ixqINsKCZC0y5vO0LF0ttsJEf9QEJrYRlA8VOw79NnCE3PimACnb0UU2cy91HmLcR2OvXqNiS0TZWS0kEajpW9BuqszNPnMrpLi9t7kHTSFjGx1Nb6XXUBG2lmoiXVNqutq+0zCEa8otObjZ0igQ6Kb2joJfbwSSWXNzDtp+jRmxQacqmXwvByz2BI37xnCs4KP0VYM37r0BmVxpBQlyFreoB7PRyezYbQSkaq2bahMLjA= diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..5fb3711 --- /dev/null +++ b/test.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -uo pipefail + +function out() { + printf "\n\e[1;37;497;m%s\e[0;m\n" "$@" +} >&2 + +function err() { + printf "\n\e[1;37;41;m%s\e[0;m\n\n" "$@" +} >&2 + +retval=0 +cd "$(dirname "${BASH_SOURCE}")" +for file in test/*.test.sh; do + out "Running $file" + if grep -E "^[[:blank:]]*BACH_TESTS=.+" "$file"; then + err "Found defination of BACH_TESTS in $file" + retval=1 + fi + bash "$file" || retval=1 +done + +if [[ "$retval" -ne 0 ]]; then + err "Test failed!" +fi + +exit "$retval"