[asterisk-commits] pabelanger: branch pabelanger/issue17165 r280053 - /team/pabelanger/issue1716...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 27 22:10:26 CDT 2010


Author: pabelanger
Date: Tue Jul 27 22:10:22 2010
New Revision: 280053

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=280053
Log:
Import _some_ of the bamboo build script. First round of updates using live_ast

Added:
    team/pabelanger/issue17165/contrib/testsuite/
    team/pabelanger/issue17165/contrib/testsuite/build-asterisk   (with props)

Added: team/pabelanger/issue17165/contrib/testsuite/build-asterisk
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17165/contrib/testsuite/build-asterisk?view=auto&rev=280053
==============================================================================
--- team/pabelanger/issue17165/contrib/testsuite/build-asterisk (added)
+++ team/pabelanger/issue17165/contrib/testsuite/build-asterisk Tue Jul 27 22:10:22 2010
@@ -1,0 +1,142 @@
+#!/bin/sh
+
+AST_CONFIGURE_PARAMS=--enable-dev-mode
+AST_LIVE=./live/
+TEST_RESULTS_DIR=${PWD}/test-reports
+
+start_asterisk() {
+	echo "*** Starting Asterisk ***"
+
+	if [ -d /Library/LaunchDaemons ] ; then
+		# Mac OSX
+		launchctl load -w /Library/LaunchDaemons/com.asterisk.org.asterisk
+	else
+		${AST_LIVE}asterisk -gn
+	fi
+
+	sleep 5
+}
+
+stop_asterisk() {
+	echo "*** Stopping Asterisk ***"
+	${AST_LIVE}asterisk -rx "core stop now"
+	sleep 5
+
+	if [ -d /Library/LaunchDaemons ] ; then
+		# Mac OSX
+		launchctl unload -w /Library/LaunchDaemons/com.asterisk.org.asterisk
+	fi
+
+	(killall -9 asterisk || :) > /dev/null 2>&1
+}
+
+killall_asterisk() {
+	echo "*** Killing all running Asterisk processes ***"
+	(killall -9 asterisk || :) > /dev/null 2>&1
+}
+
+run_unit_tests() {
+	echo "*** Executing Unit Tests (Results: ${TEST_RESULTS_DIR}/unit-test-results.xml) ***"
+	${AST_LIVE}asterisk -rx "test execute all"
+
+	${AST_LIVE}asterisk -rx "test generate results xml ${TEST_RESULTS_DIR}/unit-test-results.xml"
+
+	# https://issues.asterisk.org/view.php?id=17049
+
+	LOOPCOUNT=0
+	while [ ! -s "${TEST_RESULTS_DIR}/unit-test-results.xml" ] ; do
+		sleep 1
+		LOOPCOUNT=$[${LOOPCOUNT} + 1]
+		if [ ${LOOPCOUNT} == 30 ] ; then
+			echo "*** ERROR: Waited 30 seconds and never got unit test results! ***"
+			stop_asterisk
+			exit 1
+			break
+		fi
+	done
+
+	if [ -f core* ] ; then
+		echo "*** Found a core file after running unit tests ***"
+		gdb asterisk core* -x /usr/local/bin/bamboo/bt.txt
+	fi
+}
+
+if which gmake ; then
+	MAKE=gmake
+else
+	MAKE=make
+fi
+
+if [ -f "main/test.c" ] ; then
+	UNIT_TESTS=yes
+else
+	UNIT_TESTS=no
+fi
+
+set -e
+
+rm -rf live
+${MAKE} distclean
+
+if [ -f "contrib/scripts/live_ast" ] ; then
+	./contrib/scripts/live_ast configure $AST_CONFIGURE_PARAMS
+else
+	./configure $AST_CONFIGURE_PARAMS
+fi
+
+${MAKE} menuselect.makeopts
+menuselect/menuselect --enable DONT_OPTIMIZE menuselect.makeopts
+menuselect/menuselect --enable DEBUG_THREADS menuselect.makeopts
+if [ "${UNIT_TESTS}" = "yes" ] ; then
+	menuselect/menuselect --enable TEST_FRAMEWORK menuselect.makeopts
+	menuselect/menuselect --enable-category MENUSELECT_TESTS menuselect.makeopts
+fi
+if [ -d addons ] ; then
+	menuselect/menuselect --enable-category MENUSELECT_ADDONS menuselect.makeopts
+fi
+if [ -d bridges ] ; then
+	menuselect/menuselect --enable-category MENUSELECT_BRIDGES menuselect.makeopts
+fi
+if [ -d cel ] ; then
+	menuselect/menuselect --enable-category MENUSELECT_CEL menuselect.makeopts
+fi
+menuselect/menuselect --enable-category MENUSELECT_CDR menuselect.makeopts
+menuselect/menuselect --enable-category MENUSELECT_CHANNELS menuselect.makeopts
+menuselect/menuselect --enable-category MENUSELECT_CODECS menuselect.makeopts
+if [ -f codecs/codec_ilbc.c ] ; then
+	menuselect/menuselect --disable codec_ilbc menuselect.makeopts
+fi
+menuselect/menuselect --enable-category MENUSELECT_FORMATS menuselect.makeopts
+menuselect/menuselect --enable-category MENUSELECT_FUNCS menuselect.makeopts
+menuselect/menuselect --enable-category MENUSELECT_PBX menuselect.makeopts
+menuselect/menuselect --enable-category MENUSELECT_RES menuselect.makeopts
+if grep -q MENUSELECT_UTILS menuselect.makeopts ; then
+	menuselect/menuselect --enable-category MENUSELECT_UTILS menuselect.makeopts
+fi
+
+${MAKE} ASTCFLAGS=${ASTCFLAGS}
+
+if [ -f doc/core-en_US.xml ] ; then
+	echo "*** Validating XML documentation ***"
+	${MAKE} validate-docs
+fi
+
+if [ -d doc/tex ] ; then
+	${MAKE} asterisk.pdf
+fi
+
+if [ -f "contrib/scripts/live_ast" ] ; then
+	./contrib/scripts/live_ast install 
+	./contrib/scripts/live_ast samples
+else
+	${MAKE} install 
+	${MAKE} samples
+fi
+
+if [ "${UNIT_TESTS}" = "yes" ] ; then
+	killall_asterisk
+	start_asterisk
+	run_unit_tests
+	stop_asterisk
+fi
+

Propchange: team/pabelanger/issue17165/contrib/testsuite/build-asterisk
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/pabelanger/issue17165/contrib/testsuite/build-asterisk
------------------------------------------------------------------------------
    svn:executable = *

Propchange: team/pabelanger/issue17165/contrib/testsuite/build-asterisk
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/pabelanger/issue17165/contrib/testsuite/build-asterisk
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list