From f43bac8efabc8f21a711526c1d6a5c0b97f96813 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 16 Jan 2017 11:46:32 +0100 Subject: [PATCH] some cosmetic updates - remove whitespace at eol - add function parameter documentation --- tests/update_helper.sh | 13 ++++++++----- tests/update_reference_data.sh | 5 +++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/update_helper.sh b/tests/update_helper.sh index 771f21107..ca579cd90 100755 --- a/tests/update_helper.sh +++ b/tests/update_helper.sh @@ -7,15 +7,18 @@ set -e #set -x +# Get the absolute path from a (potentially) relative path +# $1 = relative path +# Prints the absolute path to stdout for capture getAbsPath() { local MY_PATH=$1 local ORIG_PATH=`pwd` - MY_PATH="`( cd \"$MY_PATH\" && pwd )`" + MY_PATH="`( cd \"$MY_PATH\" && pwd )`" cd "$ORIG_PATH" if [ -z "$MY_PATH" ] ; then - echo "Script path became something strange: '$SCRIPT_PATH'" + echo "Script path became something strange: '$SCRIPT_PATH'" exit 1 # fail fi echo "$MY_PATH" @@ -49,7 +52,7 @@ while getopts "d:w:p:t:h" arg; do echo "OPM_DATA ${OPTARG}" OPM_DATA=${OPTARG} ;; - w) # Workspace directory to use for opm-simultors + w) # Workspace directory to use for opm-simulators echo "WORKSPACE ${OPTARG}" WORKSPACE=${OPTARG} ;; @@ -69,8 +72,8 @@ while getopts "d:w:p:t:h" arg; do done -if [ -z "$OPM_DATA" ]; then - echo "No OPM_DATA dir, will clone using network (slow)"; +if [ -z "$OPM_DATA" ]; then + echo "No OPM_DATA dir, will clone using network (slow)"; fi WORKSPACE=`getAbsPath "$WORKSPACE"` diff --git a/tests/update_reference_data.sh b/tests/update_reference_data.sh index ad486f973..97c546367 100755 --- a/tests/update_reference_data.sh +++ b/tests/update_reference_data.sh @@ -2,6 +2,11 @@ OPM_DATA_ROOT=$1 +# Copy results from a test run to refence dir +# $1 = source directory to copy data from +# $2 = destination directory to copy data to +# $3 = base file name for files to copy +# $4...$@ = file types to copy copyToReferenceDir () { SRC_DIR=$1 DST_DIR=$2;