Author: rleigh
Date: Wed Jun 14 21:45:17 2017
New Revision: 1798780

URL: http://svn.apache.org/viewvc?rev=1798780&view=rev
Log:
ci: Add travis support for Linux and MacOS X

Added:
    xerces/c/trunk/.travis.yml
    xerces/c/trunk/scripts/ci-travis   (with props)

Added: xerces/c/trunk/.travis.yml
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/.travis.yml?rev=1798780&view=auto
==============================================================================
--- xerces/c/trunk/.travis.yml (added)
+++ xerces/c/trunk/.travis.yml Wed Jun 14 21:45:17 2017
@@ -0,0 +1,59 @@
+# Possible test configurations for comprehensive feature coverage:
+#
+# Unix
+# ----
+# 1) -Dnetwork:BOOL=ON -Dnetwork-accessor=curl -Dmessage-loader=icu 
-Dtranscoder=iconv
+# 2) -Dnetwork:BOOL=ON -Dnetwork-accessor=socket -Dmessage-loader=inmemory 
-Dtranscoder=icu
+# 3) -Dnetwork:BOOL=ON -Dmessage-loader=iconv
+# 4) -Dnetwork:BOOL=OFF
+# 5) (none)
+
+language: c
+
+sudo: false
+dist: trusty
+
+cache:
+  directories:
+    - download
+
+addons:
+  apt_packages:
+    - libicu-dev
+    - libcurl4-openssl-dev
+    - autoconf
+    - automake
+    - libtool
+
+os:
+  - linux
+  - osx
+
+env:
+  matrix:
+    - BUILD=autoconf TYPE=Release NETWORK=ON NETACCESSOR=curl 
MSGLOADER=inmemory TRANSCODER=iconv
+    - BUILD=cmake TOOL="Unix Makefiles" TYPE=Debug NETWORK=ON NETACCESSOR=curl 
MSGLOADER=icu TRANSCODER=iconv
+    - BUILD=cmake TOOL="Ninja" TYPE=Release NETWORK=ON NETACCESSOR=socket 
MSGLOADER=inmemory TRANSCODER=icu
+    - BUILD=autoconf TYPE=Debug NETWORK=ON MSGLOADER=iconv
+    - BUILD=cmake TOOL="Unix Makefiles" TYPE=Release NETWORK=ON
+    - BUILD=cmake TOOL="Ninja" TYPE=Debug
+    - BUILD=cmake TOOL="Ninja" TYPE=Debug NETACCESSOR=cfurl 
TRANSCODER=macosunicodeconverter
+
+matrix:
+  fast_finish: true
+  exclude:
+    - os: linux
+      env: BUILD=cmake TOOL="Ninja" TYPE=Debug NETACCESSOR=cfurl 
TRANSCODER=macosunicodeconverter
+    - os: osx
+      env: BUILD=cmake TOOL="Unix Makefiles" TYPE=Debug NETWORK=ON 
NETACCESSOR=curl MSGLOADER=icu TRANSCODER=iconv
+    - os: osx
+      env: BUILD=cmake TOOL="Ninja" TYPE=Release NETWORK=ON NETACCESSOR=socket 
MSGLOADER=inmemory TRANSCODER=icu
+    - os: osx
+      env: BUILD=autoconf TYPE=Debug NETWORK=ON MSGLOADER=iconv
+    - os: osx
+      env: BUILD=cmake TOOL="Unix Makefiles" TYPE=Release NETWORK=ON
+    - os: osx
+      env: BUILD=cmake TOOL="Ninja" TYPE=Debug
+
+script:
+  - ./scripts/ci-travis "$BUILD" "$TOOL" "$TYPE" "$NETWORK" "$NETACCESSOR" 
"$MSGLOADER" "$TRANSCODER"

Added: xerces/c/trunk/scripts/ci-travis
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/scripts/ci-travis?rev=1798780&view=auto
==============================================================================
--- xerces/c/trunk/scripts/ci-travis (added)
+++ xerces/c/trunk/scripts/ci-travis Wed Jun 14 21:45:17 2017
@@ -0,0 +1,154 @@
+#!/bin/sh
+# This script is used for testing the build, primarily for use
+# with travis, but may be used by hand as well.
+
+set -e
+set -x
+
+# Test autoconf build
+autoconf_build()
+{
+    opts=""
+    # network
+    case "$3" in
+        ON) opts="$opts --enable-network" ;;
+        *)  opts="$opts --disable-network" ;;
+    esac
+
+    # netaccessor
+    case "$4" in
+        curl) opts="$opts --enable-netaccessor-curl" ;;
+        socket) opts="$opts --enable-netaccessor-socket" ;;
+        cfurl) opts="$opts --enable-netaccessor-cfurl" ;;
+        winsock) opts="$opts --enable-netaccessor-winsock" ;;
+    esac
+
+    # msgloader
+    case "$5" in
+        inmemory) opts="$opts --enable-msgloader-inmemory" ;;
+        icu) opts="$opts --enable-msgloader-icu" ;;
+        iconv) opts="$opts --enable-msgloader-iconv" ;;
+    esac
+
+    # transcoder
+    case "$6" in
+        # Testing on Linux, it's always GNU iconv
+        iconv) opts="$opts --enable-transcoder-gnuiconv" ;;
+        gnuiconv) opts="$opts --enable-transcoder-gnuiconv" ;;
+        icu) opts="$opts --enable-transcoder-icu" ;;
+        macosunicodeconverter) opts="$opts 
--enable-transcoder-macosunicodeconverter" ;;
+        windows) opts="$opts --enable-transcoder-windows" ;;
+    esac
+
+    autoreconf -ivf
+
+    mkdir autoconf-build
+    cd autoconf-build
+    echo "Running ../configure --prefix=$(pwd)/../autoconf-install) ${opts}"
+    ../configure --prefix=$(pwd)/../autoconf-install ${opts}
+    make
+    make install
+    make check
+}
+
+# Install needed tools
+cmake_deps()
+{
+    mkdir -p download
+    mkdir -p tools
+
+    if [ "$(uname -s)" = "Linux" ]; then
+        cmake_file="cmake-3.8.2-Linux-x86_64.tar.gz"
+        
cmake_hash="574673d3f37b0be6a0813b894a8bce9c4af08c13f1ec25c030a69f42e0e4b349e0192385ef20c8a9271055b7c3b24c5b20fb5009762131a3fba3d17576e641f1"
+    elif [ "$(uname -s)" = "Darwin" ]; then
+        cmake_file="cmake-3.8.2-Darwin-x86_64.tar.gz"
+        
cmake_hash="fd1c09dd73fe2b23fdc9ac915a90343d2e27409182dd1f2bf509ddf54ca926f97e1906fc18f119e8ea52797c05d4b919772f43500bffbcf2c3cdc86828d9067e"
+    fi
+    cmake_url="https://cmake.org/files/v3.8/${cmake_file}";
+
+    if [ "$(uname -s)" = "Linux" ]; then
+        ninja_file="ninja-linux.zip"
+        
ninja_hash="2dddc52750c5e6f841acd0d978b894c9a6562f12ddb4ba9e5118a213f54265f065682ffe1bc7bc2ac6146760145d17800a4b7373791cd1fbbaf0836faf050e19"
+    elif [ "$(uname -s)" = "Darwin" ]; then
+        ninja_file="ninja-mac.zip"
+        
ninja_hash="e008c9814447bbf356be7f2daf6d212657fb22b67e7de3885bd2f27766cd7c8a2ad61a4aace170674464ccf55813cbe2bf311485bc2058e89867f17b692642b9"
+    fi
+    
ninja_url="https://github.com/ninja-build/ninja/releases/download/v1.7.2/${ninja_file}";
+
+    (
+        cd download
+        if [ ! -f "$cmake_file" ] || [ "$(shasum -a 512 "$cmake_file")" != 
"$cmake_hash  $cmake_file" ]; then
+            wget "$cmake_url"
+            if [ "$(shasum -a 512 "$cmake_file")" != "$cmake_hash  
$cmake_file" ]; then
+                echo "Error: cmake download hash mismatch" >&2
+                exit 1
+            fi
+        fi
+        tar xf "$cmake_file"
+        cp -a ${cmake_file%.tar.gz}/* ../tools
+
+        if [ "$1" = "Ninja" ]; then
+            if [ ! -f "$ninja_file" ] || [ "$(shasum -a 512 "$ninja_file")" != 
"$ninja_hash  $ninja_file" ]; then
+                wget "$ninja_url"
+                if [ "$(shasum -a 512 "$ninja_file")" != "$ninja_hash  
$ninja_file" ]; then
+                    echo "Error: ninja download hash mismatch" >&2
+                    exit 1
+                fi
+            fi
+            unzip "$ninja_file"
+            mkdir -p ../tools/bin
+            mv ninja ../tools/bin
+        fi
+    )
+}
+
+# Test autoconf build
+cmake_build()
+{
+    opts=""
+    if [ -n "$3" ]; then
+        opts="$opts -Dnetwork:BOOL=$3"
+    fi
+    if [ -n "$4" ]; then
+        opts="$opts -Dnetwork-accessor=$4"
+    fi
+    if [ -n "$5" ]; then
+        opts="$opts -Dmessage-loader=$5"
+    fi
+    if [ -n "$6" ]; then
+        opts="$opts -Dtranscoder=$6"
+    fi
+
+    PATH="$(pwd)/tools/bin:$PATH"
+    if [ "$(uname -s)" = "Darwin" ]; then
+        PATH="$(pwd)/tools/CMake.app/Contents/bin:$PATH"
+    fi
+    mkdir cmake-build
+    cd cmake-build
+    echo "Running cmake -G "$1" -DCMAKE_BUILD_TYPE="$2" 
-DCMAKE_INSTALL_PREFIX=../autoconf-install ${opts} .."
+    cmake -G "$1" -DCMAKE_BUILD_TYPE="$2" 
-DCMAKE_INSTALL_PREFIX=../autoconf-install ${opts} ..
+    cmake --build .
+    cmake --build . --target install
+    ctest -V
+}
+
+build=$1
+shift
+
+case $build in
+    autoconf)
+        echo "Testing Autoconf build"
+        autoconf_build "$@"
+        ;;
+    cmake)
+        echo "Testing CMake build"
+        cmake_deps "$@"
+        cmake_build "$@"
+        ;;
+    *)
+        echo "Invalid argument: \"$arg\"" >&2
+        exit 1
+        ;;
+esac
+
+exit 0

Propchange: xerces/c/trunk/scripts/ci-travis
------------------------------------------------------------------------------
    svn:executable = *



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to