[asterisk-commits] run-local: Enable reading of setup variables from run-local.... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 12 13:54:15 CST 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

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(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved
  George Joseph: Looks good to me, but someone else must approve



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: merged
Gerrit-Change-Id: I1e2be35889fde93fae3f31189001a7ceba3a6e25
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-commits mailing list