Merge pull request #412 from michaeltryby/dev

Restores coverage
This commit is contained in:
Michael Tryby
2019-03-07 19:26:17 -05:00
committed by GitHub
2 changed files with 25 additions and 28 deletions

View File

@@ -31,8 +31,7 @@ before_install:
- sudo apt-get -qq update
- eval "${MATRIX_EVAL}"
install:
- sudo apt-get install jq
#install:
# - sudo apt-get install -y libboost-test-dev
# - sudo apt-get install -y libboost-thread-dev

View File

@@ -21,79 +21,77 @@
# GitHub and stages the files for nrtest to run. The script assumes that
# before-test.sh and gen-config.sh are located together in the same folder.
if [ -z $1 ]; then
if [ -z "$1" ]; then
unset PLATFORM;
else
PLATFORM=$1;
fi
if [ -z $2 ]; then
if [ -z "$2" ]; then
echo "ERROR: REF_BUILD_ID must be defined"; exit 1;
else
REF_BUILD_ID=$2;
fi
if [ -z $3 ]; then
if [ -z "$3" ]; then
SUT_BUILD_ID="local";
else
SUT_BUILD_ID=$3;
fi
if [ -z $4 ]; then
if [ -z "$4" ]; then
SUT_VERSION="unknown";
else
SUT_VERSION=$4; fi
if [ -z $5 ]; then
if [ -z "$5" ]; then
TEST_HOME="nrtestsuite";
else
TEST_HOME=$5; fi
echo INFO: Staging files for regression testing
SCRIPT_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BUILD_HOME="$(dirname "$SCRIPT_HOME")"
SUT_PATH=(`find $BUILD_HOME -name "bin" -type d`)
SUT_PATH=(`find "$BUILD_HOME" -name "bin" -type d`)
# TODO: determine platform
# determine latest tag from GitHub API
LATEST_URL="https://api.github.com/repos/openwateranalytics/epanet-example-networks/releases/latest"
LATEST_TAG=(`curl --silent ${LATEST_URL} | jq -r .tag_name`)
if [ -z $LATEST_TAG ]; then
echo "ERROR: curl | jq - ${LATEST_URL}"
exit 1
fi
# hack to determine latest tag from GitHub
LATEST_URL="https://github.com/OpenWaterAnalytics/epanet-example-networks/releases/latest"
LATEST_TAG="$(curl -sI "${LATEST_URL}" | grep -Po 'tag\/\K(v\S+)')"
TEST_URL="https://github.com/OpenWaterAnalytics/epanet-example-networks/archive/${LATEST_TAG}.tar.gz"
TEST_URL="https://codeload.github.com/OpenWaterAnalytics/epanet-example-networks/tar.gz/${LATEST_TAG}"
BENCH_URL="https://github.com/OpenWaterAnalytics/epanet-example-networks/releases/download/${LATEST_TAG}/benchmark-${PLATFORM}-${REF_BUILD_ID}.tar.gz"
echo INFO: Staging files for regression testing
# create a clean directory for staging regression tests
if [ -d ${TEST_HOME} ]; then
rm -rf ${TEST_HOME}
# create a clean directory for staging regression tests
if [ -d "${TEST_HOME}" ]; then
rm -rf "${TEST_HOME}"
fi
mkdir ${TEST_HOME}
cd ${TEST_HOME}
mkdir "${TEST_HOME}"
cd "${TEST_HOME}" || exit 1
# retrieve epanet-examples for regression testing
if ! curl -fsSL -o examples.tar.gz ${TEST_URL}; then
echo "ERROR: curl - ${TEST_URL}"
if ! curl -fsSL -o examples.tar.gz "${TEST_URL}"; then
echo "ERROR: curl - ${TEST_URL}" & exit 2
fi
# retrieve epanet benchmark results
if ! curl -fsSL -o benchmark.tar.gz ${BENCH_URL}; then
echo "ERROR: curl - ${BENCH_URL}"
if ! curl -fsSL -o benchmark.tar.gz "${BENCH_URL}"; then
echo "ERROR: curl - ${BENCH_URL}" & exit 3
fi
# extract tests, benchmarks, and manifest
tar xzf examples.tar.gz
ln -s epanet-example-networks-${LATEST_TAG:1}/epanet-tests tests
ln -s "epanet-example-networks-${LATEST_TAG:1}/epanet-tests" tests
mkdir benchmark
tar xzf benchmark.tar.gz -C benchmark