summaryrefslogtreecommitdiff
path: root/tcwg-llvm-testsuite.sh
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2017-05-04 15:03:17 +0100
committerRenato Golin <renato.golin@linaro.org>2017-05-04 19:17:43 +0100
commita9d187520a5af7b67e607b9b1dbb7ab527a567e8 (patch)
tree14f3da8bd363b1b688c8bf1639768dfb9d5703b2 /tcwg-llvm-testsuite.sh
parentd044b6ce8fae1184e7b554ab39ef76601b569b95 (diff)
tcwg-llvm-*: Moving common stuff out
This is an NFC patch that just common things up. I'm making sure that we only handle URLs and toolchain downloads in a single place, which will later be very useful when we get Jenkins to ask these scripts to create the trigger files. This is the first part of TCWG-1117. Adding the trigger files will be the second. I have tested on my box by sourcing the common file and calling the functions with the right parameters as well as running the scripts (build/release/test) with the appropriate arguments but with the core logic actually commented out. I have some empty tar balls with the right names on dev-01. :) Change-Id: Ice435ad9d5e20152e295413075c32a396ffc5e2a
Diffstat (limited to 'tcwg-llvm-testsuite.sh')
-rwxr-xr-xtcwg-llvm-testsuite.sh35
1 files changed, 4 insertions, 31 deletions
diff --git a/tcwg-llvm-testsuite.sh b/tcwg-llvm-testsuite.sh
index 20b3c845..fe4d7a43 100755
--- a/tcwg-llvm-testsuite.sh
+++ b/tcwg-llvm-testsuite.sh
@@ -8,6 +8,8 @@ set -e
set -o pipefail
set -u
+. tcwg-llvm.common.sh
+
# Syntax
SYN_TOOLCHAIN="--toolchain=http://url/for/tarball"
SYN_WORKSPACE="--workspace=/full/path/to/workspace"
@@ -33,36 +35,7 @@ while [ "$#" -gt 0 ]; do
fi
shift ;;
--toolchain)
- if [ "$VAL" != "" ]; then
- file=$(basename "$VAL")
- dir=$(echo "$file" | sed 's/\.tar.*//g')
- # Download the toolchain
- if [ ! -d "$WORKSPACE/$dir" ]; then
- echo "No dir '$WORKSPACE/$dir'..."
- if [ ! -f "$WORKSPACE/$file" ]; then
- echo "No file '$WORKSPACE/$file'..."
- echo "Downloading from '$VAL'"
- wget -q "$VAL" -O "$WORKSPACE/$file"
- fi
- echo "Unpacking '$WORKSPACE/$file'"
- tar xf "$WORKSPACE/$file" -C "$WORKSPACE"
- fi
- # Clang or GCC?
- if [ -f "$WORKSPACE/$dir/bin/clang" ]; then
- export CC="$WORKSPACE/$dir/bin/clang"
- export CXX="$WORKSPACE/$dir/bin/clang++"
- elif [ -f "$WORKSPACE/$dir/bin/gcc" ]; then
- export CC="$WORKSPACE/$dir/bin/gcc"
- export CXX="$WORKSPACE/$dir/bin/g++"
- else
- echo "ERROR: Toolchain '$VAL' has no known compiler in $dir/bin"
- echo "Syntax: $SYN_TOOLCHAIN"
- exit 1
- fi
- else
- echo "ERROR: Toolchain '$VAL' not valid"
- echo "Syntax: $SYN_TOOLCHAIN",xit 1
- fi
+ download_toolchain "$VAL"
shift ;;
*)
echo "ERROR: Invalid argument '$1'"
@@ -95,7 +68,7 @@ LOGEXT="txt"
git clone --depth 1 http://llvm.org/git/lnt.git \
--reference "$REFDIR/lnt" \
"$WORKSPACE/lnt" |& tee -a "$LOGBASE-clone.$LOGEXT"
-} 9>$REFDIR.lock
+} 9>"$REFDIR.lock"
# Prepare
python=$(which python2)