[Asterisk-code-review] run-local: Enable reading of setup variables from run-local.... (testsuite[master])

Corey Farrell asteriskteam at digium.com
Sat Jan 9 13:00:13 CST 2016


Corey Farrell has uploaded a new change for review.

  https://gerrit.asterisk.org/1966

Change subject: run-local: Enable reading of setup variables from run-local.conf.
......................................................................

run-local: Enable reading of setup variables from run-local.conf.

run-local uses environmental variables to control the Asterisk build.
This allows the script to read variables from run-local.conf.  This file
is ignored by git, an example is included as run-local.conf.example.
This change required switching the script from /bin/sh to /bin/bash to
allow variables to be sourced.

Additionally add CONFIGURE_OPTIONS to allow any option to be appended to
the Asterisk ./configure.

Change-Id: I1e2be35889fde93fae3f31189001a7ceba3a6e25
---
M .gitignore
M run-local
A run-local.conf.example
3 files changed, 22 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/66/1966/1

diff --git a/.gitignore b/.gitignore
index fdbbcf0..6a73616 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@
 /logs
 /tests/custom
 /fastagi
+/run-local.conf
diff --git a/run-local b/run-local
index 5371c1e..026a063 100755
--- a/run-local
+++ b/run-local
@@ -1,10 +1,15 @@
-#!/bin/sh
+#!/bin/bash
 
 # run_local: run the test suite without changing the system
 
 set -e
 HERE="`(cd "\`dirname "$0"\`" >/dev/null; pwd; cd - >/dev/null)`"
 cd "$HERE"
+
+if [ -r run-local.conf ]; then
+  # Read environment from run-local.conf
+  source run-local.conf
+fi
 
 usage() {
 	echo >&2 "$0: Run the test suite locally:"
@@ -26,7 +31,7 @@
 		cd $ASTSRCDIR
 		# The user may have already run ./configure and make
 		if [ ! -f config.status ]; then
-			./configure --enable-dev-mode
+			./configure --enable-dev-mode $CONFIGURE_OPTIONS
 			make menuselect.makeopts
 			menuselect/menuselect --enable DONT_OPTIMIZE --enable TEST_FRAMEWORK $MENUSELECT_OPTIONS
 		fi
diff --git a/run-local.conf.example b/run-local.conf.example
new file mode 100644
index 0000000..5a2bfbb
--- /dev/null
+++ b/run-local.conf.example
@@ -0,0 +1,14 @@
+# This file shows the default settings.  If local.conf exists it is sourced
+# by run-local.  Currently these settings only apply to ./run-local setup,
+# though the file is sourced for all runs of run-local.
+
+# Specify additional options to use on ./configure for Asterisk.
+# Do not set --prefix or other installation directories, the testsuite expects
+# things to be installed a certain way.
+CONFIGURE_OPTIONS=""
+
+# Specify additional --enable/--disable options.
+MENUSELECT_OPTIONS=""
+
+# By default the parent directory is used to find the Asterisk source to build.
+ASTSRCDIR=".."

-- 
To view, visit https://gerrit.asterisk.org/1966
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e2be35889fde93fae3f31189001a7ceba3a6e25
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>



More information about the asterisk-code-review mailing list