summaryrefslogtreecommitdiff
path: root/test/utils.bash
diff options
context:
space:
mode:
Diffstat (limited to 'test/utils.bash')
-rw-r--r--test/utils.bash25
1 files changed, 14 insertions, 11 deletions
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