From 0d92ff5fd34d79b54c30c38ac41bc600acf7b7c4 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 27 Oct 2013 15:14:18 +0100 Subject: o Dropping the CSV file for using a native app config file instead. o Using apache as an example app. o Adding appstore-add-app as a utility to register appliations. --- test/utils.bash | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'test/utils.bash') diff --git a/test/utils.bash b/test/utils.bash index cd6fcf0..4c7e2c8 100644 --- a/test/utils.bash +++ b/test/utils.bash @@ -8,10 +8,18 @@ exit_usage_wrong=0 setup() { ORIG_PATH=$PATH - APPSTORE_HOME=$(cd $BATS_TEST_DIRNAME/..; echo `pwd`) + APPSTORE_HOME=$(cd $BATS_TEST_DIRNAME/.. && echo `pwd`) PATH=/bin:/usr/bin PATH=$PATH:$APPSTORE_HOME + APPSH_HOME=$(cd $BATS_TEST_DIRNAME/../../app.sh && echo `pwd`) + if [[ ! -x $APPSH_HOME/app ]] + then + echo "app.sh has to be available as ../app.sh" + exit 1 + fi + PATH=$PATH:$APPSH_HOME + rm -rf $BATS_TMPDIR/appstore mkdir $BATS_TMPDIR/appstore @@ -23,6 +31,9 @@ setup() { REPO_URL="file://$REPO" FIXED_REPO_URL="file://`fix_path $REPO`" + cd $BATS_TEST_DIRNAME/data + make + if [ "`declare -f setup_inner >/dev/null; echo $?`" = 0 ] then setup_inner @@ -35,14 +46,6 @@ echo_lines() { echo status=$status } -mkzip() { -( - cd $BATS_TEST_DIRNAME/data/$1 - rm -f ../$1.zip - zip -qr ../$1.zip * -) -} - install_artifact() { local artifactId=${1}; shift local version=${1-1.0-SNAPSHOT} @@ -56,7 +59,7 @@ check_status=yes app() { echo app $@ - run $APPSTORE_HOME/app $@ + run $APPSH_HOME/app $@ echo_lines if [ "$check_status" = yes ] @@ -68,7 +71,7 @@ app() { } app_libexec() { - local x=`PATH=$APPSTORE_HOME/libexec:/bin:/usr/bin which $1` + local x=`PATH=$APPSH_HOME/libexec:/bin:/usr/bin which $1` echo libexec/$@ shift -- cgit v1.2.3