From 4376def121e2005815cb9182d2644a528aa051c2 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 7 Nov 2019 18:58:25 +0100 Subject: [PATCH] Allow running tests stand-alone Signed-off-by: Joachim Nilsson --- test/api.sh | 5 ++++- test/local.sh | 3 +++ test/remote.sh | 3 +++ test/start.sh | 3 +-- test/stop.sh | 3 +++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/test/api.sh b/test/api.sh index c94e4c5..17b141d 100755 --- a/test/api.sh +++ b/test/api.sh @@ -1,6 +1,9 @@ #!/bin/sh set -ex -. ${srcdir}/test.rc +if [ x"${srcdir}" = x ]; then + srcdir=. +fi +g. ${srcdir}/test.rc export MSG="no-openlog-apitest" diff --git a/test/local.sh b/test/local.sh index dea1e2b..af5888e 100755 --- a/test/local.sh +++ b/test/local.sh @@ -1,4 +1,7 @@ #!/bin/sh +if [ x"${srcdir}" = x ]; then + srcdir=. +fi . ${srcdir}/test.rc MSG="foobar" diff --git a/test/remote.sh b/test/remote.sh index 2b8f78a..7496aa8 100755 --- a/test/remote.sh +++ b/test/remote.sh @@ -1,5 +1,8 @@ #!/bin/sh set -ex +if [ x"${srcdir}" = x ]; then + srcdir=. +fi . ${srcdir}/test.rc MSG="kilroy" diff --git a/test/start.sh b/test/start.sh index dee0a61..368b5b3 100755 --- a/test/start.sh +++ b/test/start.sh @@ -1,9 +1,8 @@ #!/bin/sh -. ${srcdir}/test.rc - if [ x"${srcdir}" = x ]; then srcdir=. fi +. ${srcdir}/test.rc mkdir -p ${CONFD} cat < ${CONF} diff --git a/test/stop.sh b/test/stop.sh index e26e3a8..efd23bf 100755 --- a/test/stop.sh +++ b/test/stop.sh @@ -1,4 +1,7 @@ #!/bin/sh +if [ x"${srcdir}" = x ]; then + srcdir=. +fi . ${srcdir}/test.rc if [ -e ${PID} ]; then