aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author1138-4EB <1138-4EB@users.noreply.github.com>2017-02-12 08:20:40 +0100
committertgingold <tgingold@users.noreply.github.com>2017-02-12 08:20:40 +0100
commit87a4f74ad120774197d3e258a725d1b5a0d25a5b (patch)
tree9e9bb037895fdd60e855d9cd3e6ea70ee8dc6530
parent6adb5c80b1c74f44329173818d50fd65d5b94ae2 (diff)
downloadghdl-87a4f74ad120774197d3e258a725d1b5a0d25a5b.tar.gz
ghdl-87a4f74ad120774197d3e258a725d1b5a0d25a5b.tar.bz2
ghdl-87a4f74ad120774197d3e258a725d1b5a0d25a5b.zip
Extract tag declarations from <travis-ci.sh>. Rename it to <buildtest… (#277)
* Extract tag declarations from <travis-ci.sh>. Rename it to <buildtest.sh> and allow to pass -b (BLD) and -f (PKG_FILE) as arguments. Save tag declarations in <travis-ci.sh>, with a different meaning now. Modify <.travis.yml> accordingly. * chmod +x ./dist/buildtest.sh. Can be removed bi changing permissions.
-rw-r--r--.travis.yml4
-rw-r--r--dist/buildtest.sh65
-rwxr-xr-xdist/travis-ci.sh59
3 files changed, 69 insertions, 59 deletions
diff --git a/.travis.yml b/.travis.yml
index 9be8f0625..fe11b6252 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -36,7 +36,9 @@ matrix:
apt:
packages:
- gnat
-script: ./dist/travis-ci.sh $BLD
+script:
+ - . ./dist/travis-ci.sh
+ - chmod +x ./dist/buildtest.sh && ./dist/buildtest.sh -b $BLD -f $PKG_FILE
deploy:
provider: releases
skip_cleanup: true
diff --git a/dist/buildtest.sh b/dist/buildtest.sh
new file mode 100644
index 000000000..5d011e50a
--- /dev/null
+++ b/dist/buildtest.sh
@@ -0,0 +1,65 @@
+#! /bin/sh
+# This script is executed in the travis-ci environment.
+
+# Stop in case of error
+set -e
+
+while getopts ":b:f:" opt; do
+ case $opt in
+ b) BLD=$OPTARG ;;
+ f) PKG_FILE=$OPTARG;;
+ \?) echo "Invalid option: -$OPTARG" >&2; exit 1 ;;
+ :) echo "Option -$OPTARG requires an argument." >&2; exit 1 ;;
+ esac
+done
+
+CDIR=$(pwd)
+
+# Display environment
+echo "Environment:"
+env
+
+# Prepare
+prefix="$CDIR/install-$BLD"
+mkdir "$prefix"
+mkdir "build-$BLD"
+cd "build-$BLD"
+
+# Configure
+case "$BLD" in
+ mcode)
+ ../configure --prefix="$prefix"
+ MAKEOPTS=""
+ ;;
+
+ llvm-3.5)
+ ../configure --prefix="$prefix" --with-llvm-config=llvm-config-3.5
+ MAKEOPTS="CXX=clang++"
+ ;;
+
+ llvm-3.8)
+ ../configure --prefix="$prefix" --with-llvm-config=llvm-config-3.8
+ MAKEOPTS="CXX=clang++-3.8"
+ ;;
+
+ *)
+ echo "unknown build $BLD"
+ exit 1
+ ;;
+esac
+
+# Build
+make $MAKEOPTS
+make install
+cd ..
+
+# Package
+echo "creating $PKG_FILE"
+tar -zcvf "$PKG_FILE" -C "$prefix" .
+
+# Test
+export GHDL="$CDIR/install-$BLD/bin/ghdl"
+cd testsuite
+gnatmake get_entities
+./testsuite.sh
+cd ..
diff --git a/dist/travis-ci.sh b/dist/travis-ci.sh
index 935f2894b..f3c34ae3d 100755
--- a/dist/travis-ci.sh
+++ b/dist/travis-ci.sh
@@ -1,52 +1,3 @@
-#! /bin/sh
-# This script is executed in the travis-ci environment.
-
-# Stop in case of error
-set -e
-
-CDIR=$(pwd)
-
-if [ $# -ne 0 ]; then BLD="$1"; fi
-
-# Display environment
-echo "Environment:"
-env
-
-# Prepare
-prefix="$CDIR/install-$BLD"
-mkdir "$prefix"
-mkdir "build-$BLD"
-cd "build-$BLD"
-
-# Configure
-case "$BLD" in
- mcode)
- ../configure --prefix="$prefix"
- MAKEOPTS=""
- ;;
-
- llvm-3.5)
- ../configure --prefix="$prefix" --with-llvm-config=llvm-config-3.5
- MAKEOPTS="CXX=clang++"
- ;;
-
- llvm-3.8)
- ../configure --prefix="$prefix" --with-llvm-config=llvm-config-3.8
- MAKEOPTS="CXX=clang++-3.8"
- ;;
-
- *)
- echo "unknown build $BLD"
- exit 1
- ;;
-esac
-
-# Build
-make $MAKEOPTS
-make install
-cd ..
-
-# Package
PKG_VER=`grep Ghdl_Ver src/version.in | sed -e 's/.*"\(.*\)";/\1/'`
if [ "$TRAVIS_TAG" = "" ]; then
@@ -54,13 +5,5 @@ if [ "$TRAVIS_TAG" = "" ]; then
else
PKG_TAG="$TRAVIS_TAG"
fi
-PKG_FILE="ghdl-$PKG_VER-$BLD-$PKG_TAG.tgz"
-echo "creating $PKG_FILE"
-tar -zcvf "$PKG_FILE" -C "$prefix" .
-# Test
-export GHDL="$CDIR/install-$BLD/bin/ghdl"
-cd testsuite
-gnatmake get_entities
-./testsuite.sh
-cd ..
+export PKG_FILE="ghdl-$PKG_VER-$BLD-$PKG_TAG.tgz"