diff --git a/.travis.yml b/.travis.yml index ecd40fd2ba0..37786df404b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,9 @@ compiler: - clang before_install: - sudo apt-get update -qq - - sudo apt-get install -y gdebi-core + - sudo apt-get install -y gdebi-core sip-tester sipsak - sudo pkg/kamailio/deb/build_deps.sh precise $TRAVIS_BUILD_DIR + - ./pkg/kamailio/deb/databases_travis.sh script: ./pkg/kamailio/deb/build_travis.sh branches: only: diff --git a/pkg/kamailio/deb/build_travis.sh b/pkg/kamailio/deb/build_travis.sh index a18b2e73c8b..05540eb8e67 100755 --- a/pkg/kamailio/deb/build_travis.sh +++ b/pkg/kamailio/deb/build_travis.sh @@ -10,6 +10,7 @@ PACKAGE_GROUPS="mysql postgres berkeley unixodbc radius presence ldap xml perl u snmpstats carrierroute xmpp cpl redis python geoip\ sqlite json mono ims sctp java \ purple tls outbound websocket autheph" +export TESTS_EXCLUDE="3 12 17 19 20 23 25 26 30 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 50" echo "make cfg" make FLAVOUR=kamailio cfg \ skip_modules="${EXCLUDED_MODULES} ${EXTRA_EXCLUDED_MODULES}" \ @@ -20,3 +21,5 @@ echo "make groups" for grp in ${PACKAGE_GROUPS}; do make every-module group_include="k${grp}" done +echo "unit tests" +make -C test/unit diff --git a/pkg/kamailio/deb/databases_travis.sh b/pkg/kamailio/deb/databases_travis.sh new file mode 100755 index 00000000000..0ee721333cd --- /dev/null +++ b/pkg/kamailio/deb/databases_travis.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# create MySQL and PostgreSQL kamailio databases + +cd utils/kamctl +PWSKIP=yes CHARSET=latin1 DBENGINE=MYSQL DBNAME=kamailio INSTALL_EXTRA_TABLES=yes \ + INSTALL_PRESENCE_TABLES=yes INSTALL_DBUID_TABLES=yes \ + ./kamdbctl create +touch ~/.pgpass; chmod 600 ~/.pgpass +PWSKIP=yes DBENGINE=PGSQL DBNAME=kamailio INSTALL_EXTRA_TABLES=yes \ + INSTALL_PRESENCE_TABLES=yes INSTALL_DBUID_TABLES=yes \ + ./kamdbctl create diff --git a/test/unit/Makefile b/test/unit/Makefile index e9140310a50..83b3dba9995 100644 --- a/test/unit/Makefile +++ b/test/unit/Makefile @@ -1,19 +1,23 @@ # Makefile for running test unit # +TESTS_FILES ?= $(wildcard *.sh) +TESTS_EXCLUDE ?= +TESTS ?= $(filter-out $(patsubst %,%.sh,$(TESTS_EXCLUDE)), $(TESTS_FILES)) all: - -@for FILE in $(wildcard *.sh) ; do \ + @for FILE in $(TESTS) ; do \ if [ -f $$FILE ] ; then \ if [ -x $$FILE ] ; then \ echo "run test `basename $$FILE .sh`:" `head -n 2 "$$FILE" | tail -n 1 | cut -c 3-` ; \ ./$$FILE ; \ ret=$$? ; \ if [ ! "$$ret" -eq 0 ] ; then \ - echo "failed" ; \ + echo "failed" ; RES=1;\ fi ; \ fi ; \ fi ; \ - done ; + done ; \ + exit $$RES; run: -@if [ -f $(UNIT) ] ; then \ @@ -30,4 +34,3 @@ run: else \ echo "Test unit file $(UNIT): not found" ; \ fi ; -