diff mbox

[Cbuildb2/get_source,11/17] New variable ${sources_conf} to replace hardcoded config/sources.conf.

Message ID 1382129579-5777-12-git-send-email-ryan.arnold@linaro.org
State New
Headers show

Commit Message

Ryan S. Arnold Oct. 18, 2013, 8:52 p.m. UTC
From: "Ryan S. Arnold" <ryan.arnold@linaro.org>

This is necessary so that the testsuite can use it's own version that
doesn't change, so we can cover all bases.
---
 configure                   |  4 ++++
 configure.ac                |  3 +++
 host.conf.in                |  4 +++-
 lib/common.sh               |  4 ++--
 testsuite/test.sh           | 10 ++++++++--
 testsuite/test_sources.conf | 43 +++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 63 insertions(+), 5 deletions(-)
 create mode 100644 testsuite/test_sources.conf
diff mbox

Patch

diff --git a/configure b/configure
index 2c8d95c..8173896 100755
--- a/configure
+++ b/configure
@@ -604,6 +604,7 @@  REMOTE_SNAPSHOTS
 LOCAL_BUILDS
 LOCAL_SNAPSHOTS
 SYSROOTS
+SOURCES_CONF
 CBUILD_TOP
 BUILDDATE
 AUTOGEN
@@ -3743,6 +3744,9 @@  $as_echo "$as_me: WARNING: ${CBUILD_TOP} does not exist so creating directory!"
    mkdir -p ${CBUILD_TOP}
 fi
 
+SOURCES_CONF="${srcdir}/config/sources.conf"
+
+
 
 # Check whether --with-sysroot was given.
 if test "${with_sysroot+set}" = set; then :
diff --git a/configure.ac b/configure.ac
index 90a8151..d973031 100644
--- a/configure.ac
+++ b/configure.ac
@@ -139,6 +139,9 @@  if test ! -d ${CBUILD_TOP}; then
    mkdir -p ${CBUILD_TOP}
 fi
 
+SOURCES_CONF="${srcdir}/config/sources.conf"
+AC_SUBST(SOURCES_CONF)
+
 dnl The top of the cbuild tree
 AC_ARG_WITH(sysroot,
   AC_HELP_STRING([--with-sysroot], []),
diff --git a/host.conf.in b/host.conf.in
index 55f89e5..26f42a2 100644
--- a/host.conf.in
+++ b/host.conf.in
@@ -10,6 +10,8 @@  local_snapshots=@LOCAL_SNAPSHOTS@
 remote_snapshots=@REMOTE_SNAPSHOTS@
 cbuild_top=@CBUILD_TOP@
 
+sources_conf=@SOURCES_CONF@
+
 # This is where the components we build go, ie... make install
 local_builds=@LOCAL_BUILDS@
 
@@ -31,4 +33,4 @@  wget_bin=@WGET@
 scp_bin=@SCP@
 rsync_bin=@RSYNC@
 
-bash_shell=@BASH@
\ No newline at end of file
+bash_shell=@BASH@
diff --git a/lib/common.sh b/lib/common.sh
index ff07d62..f681d28 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -103,7 +103,7 @@  get_URL()
 {
 #    trace "$*"
 
-    local srcs="${topdir}/config/sources.conf"
+    local srcs="${sources_conf}"
     local node="`echo $1 | cut -d '/' -f 1`"
     local branch="`echo $1 | cut -d '/' -f 2 | cut -d '@' -f 1`"
     if test x"${branch}" = x"${node}"; then
@@ -140,7 +140,7 @@  list_URL()
 {
 #    trace "$*"
 
-    local srcs="${topdir}/config/sources.conf"    
+    local srcs="${sources_conf}"    
     if test -e ${srcs}; then
 	notice "Supported source repositories for $1 are:"
 #	sed -e 's:\t.*::' -e 's: .*::' -e 's:^:\t:' ${srcs} | grep $1
diff --git a/testsuite/test.sh b/testsuite/test.sh
index 9121f92..f8189e7 100755
--- a/testsuite/test.sh
+++ b/testsuite/test.sh
@@ -17,7 +17,9 @@  else
     warning "no host.conf file!"
     remote_snapshots=http://cbuild.validation.linaro.org/snapshots
     wget_bin=/usr/bin/wget
+    sources_conf=${cbuild}testsuite/test_sources.conf
 fi
+echo "Testsuite using ${sources_conf}"
 
 # Use wget -q in the testsuite
 wget_quiet=yes
@@ -307,6 +309,10 @@  fi
 # dryrun=no
 
 echo "============= get_source() tests ================"
+# TODO Test ${sources_conf} for ${in} for relevant tests.
+#      Mark tests as untested if the expected match isn't in sources_conf.
+#      This might be due to running testsuite in a builddir rather than a
+#      source dir.
 
 # Test get_source with a variety of inputs
 in="asdfasdf"
@@ -430,9 +436,9 @@  fi
 in="gcc-4.6"
 out="`get_source ${in} 2>/dev/null`"
 if test x"${out}" = x"svn://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch"; then
-    pass "get_source: tag matching an svn repo in sources.conf"
+    pass "get_source: tag matching an svn repo in ${sources_conf}"
 else
-    fail "get_source: tag matching an svn repo in sources.conf"
+    fail "get_source: tag matching an svn repo in ${sources_conf}"
     fixme "get_source returned ${out}"
 fi
 
diff --git a/testsuite/test_sources.conf b/testsuite/test_sources.conf
new file mode 100644
index 0000000..5bde540
--- /dev/null
+++ b/testsuite/test_sources.conf
@@ -0,0 +1,43 @@ 
+#
+# This is a table of URLs for checking out development sources.
+# NOTE: use spaces instead of TABs
+#
+
+# GCC
+gcc-4.7         svn://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch
+gcc-git         git://git.linaro.org/toolchain/gcc.git
+gcc-linaro-4.8  git://git.linaro.org/toolchain/gcc.git/linaro-4.8-branch
+gcc-linaro-4.7  git://git.linaro.org/toolchain/gcc.git/linaro-4.7-branch
+#gcc-linaro-4.7  lp:gcc-linaro/4.7
+gcc-linaro-4.6  lp:gcc-linaro/4.6
+gdb-linaro-7.6  lp:gdb-linaro/7.6
+gdb-linaro-7.5  lp:gdb-linaro/7.5
+clang           http://llvm.org/svn/llvm-project/cfe/trunk
+cfe             http://llvm.org/svn/llvm-project/cfe/trunk
+
+# Binutils
+binutils.git    git://git.linaro.org/toolchain/binutils.git
+gdb             git://git.linaro.org/toolchain/gdb.git
+
+# Libraries
+llvm            http://llvm.org/svn/llvm-project/llvm/trunk
+eglibc.git      git://git.linaro.org/toolchain/eglibc.git
+glibc.git       git://git.linaro.org/toolchain/glibc.git
+newlib.git      git://git.linaro.org/toolchain/newlib.git
+libgloss.git    git://git.linaro.org/toolchain/newlib.git
+cortex-strings  lp:cortex-strings
+libav           git://git.libav.org/libav.git
+libffi          git://github.com/atgreen/libffi.git
+
+crosstool-ng-linaro lp:~linaro-toolchain-dev/crosstool-ng/linaro
+
+boot-wrapper    git://git.linaro.org/arm/models/boot-wrapper.git
+
+bitbake         git://git.openembedded.org/bitbake
+llvm-test-suite http://llvm.org/svn/llvm-project/test-suite/trunk
+
+meta-linaro     git://git.linaro.org/openembedded/meta-linaro.git
+openembedded-core git://git.openembedded.org/openembedded-core
+valgrind        svn://svn.valgrind.org/valgrind/trunk
+qemu            git://git.qemu.org/qemu.git
+qemu-linaro     git://git.linaro.org/qemu/qemu-linaro.git