diff options
author | OBATA Akio <obache@wizdas.com> | 2019-08-15 17:02:19 +0900 |
---|---|---|
committer | OBATA Akio <obache@wizdas.com> | 2019-08-15 17:23:01 +0900 |
commit | 0009cb8171f141e113777e7f6557a0cfa1542d5a (patch) | |
tree | d1e7cb6a0ae3aba7d4b72ca4d475b276fe1f895d /karm/test | |
parent | c349db5d278566f8f129e8bd54751155fad49d9e (diff) | |
download | tdepim-0009cb8171f141e113777e7f6557a0cfa1542d5a.tar.gz tdepim-0009cb8171f141e113777e7f6557a0cfa1542d5a.zip |
fix some sh portability fixes
Replace bash specific way with POSIX one.
Signed-off-by: OBATA Akio <obache@wizdas.com>
Diffstat (limited to 'karm/test')
-rw-r--r-- | karm/test/__lib.sh | 8 | ||||
-rwxr-xr-x | karm/test/booktime-baddate.sh | 4 | ||||
-rwxr-xr-x | karm/test/booktime-badduration.sh | 4 | ||||
-rwxr-xr-x | karm/test/booktime-badtime.sh | 4 | ||||
-rwxr-xr-x | karm/test/booktime-baduid.sh | 4 | ||||
-rwxr-xr-x | karm/test/booktime-works.sh | 4 | ||||
-rwxr-xr-x | karm/test/bug94447.sh | 2 | ||||
-rwxr-xr-x | karm/test/delete.sh | 4 | ||||
-rwxr-xr-x | karm/test/refresh_on_change.sh | 4 | ||||
-rwxr-xr-x | karm/test/version.sh | 4 | ||||
-rwxr-xr-x | karm/test/webdav.sh | 2 |
11 files changed, 22 insertions, 22 deletions
diff --git a/karm/test/__lib.sh b/karm/test/__lib.sh index 06fd9df62..0f8be7bbd 100644 --- a/karm/test/__lib.sh +++ b/karm/test/__lib.sh @@ -1,7 +1,7 @@ # Expects karm test file in $TESTFILE # Returns dcop id in $DCOP_ID -function set_up() +set_up() { DCOPID=`dcop 2>/dev/null | grep karm` @@ -44,7 +44,7 @@ function set_up() then break else - let "idx += 1" + idx=$(( idx + 1 )) fi sleep 1 done @@ -64,12 +64,12 @@ function set_up() fi } -function test_func() +test_func() { echo "Yep, that works." } -function tear_down() +tear_down() { if [ -n "$DCOPID" ]; then dcop "$DCOPID" KarmDCOPIface quit; fi; diff --git a/karm/test/booktime-baddate.sh b/karm/test/booktime-baddate.sh index d89e54cb1..fa94a6c7a 100755 --- a/karm/test/booktime-baddate.sh +++ b/karm/test/booktime-baddate.sh @@ -2,7 +2,7 @@ TESTFILE="/tmp/testkarm1.ics" -source __lib.sh +. ./__lib.sh set_up @@ -13,7 +13,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface bookTime $TASKID notadate 360 2>/dev/null` tear_down EXPECTED=5 -if [ "$RVAL" == "$EXPECTED" ]; then +if [ "$RVAL" = "$EXPECTED" ]; then echo "PASS $0" exit 0; else diff --git a/karm/test/booktime-badduration.sh b/karm/test/booktime-badduration.sh index 2b1e8c96b..b18f59a89 100755 --- a/karm/test/booktime-badduration.sh +++ b/karm/test/booktime-badduration.sh @@ -2,7 +2,7 @@ TESTFILE="/tmp/testkarm1.ics" -source __lib.sh +. ./__lib.sh set_up @@ -13,7 +13,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface bookTime $TASKID 20050619 notanumber 2>/dev/nul tear_down EXPECTED=7 -if [ "$RVAL" == "$EXPECTED" ]; then +if [ "$RVAL" = "$EXPECTED" ]; then echo "PASS $0" exit 0; else diff --git a/karm/test/booktime-badtime.sh b/karm/test/booktime-badtime.sh index 1bbaa3d53..abc98c33b 100755 --- a/karm/test/booktime-badtime.sh +++ b/karm/test/booktime-badtime.sh @@ -2,7 +2,7 @@ TESTFILE="/tmp/testkarm1.ics" -source __lib.sh +. ./__lib.sh set_up @@ -13,7 +13,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface bookTime $TASKID 20050619Tabc 360 2>/dev/null` tear_down EXPECTED=5 -if [ "$RVAL" == "$EXPECTED" ]; then +if [ "$RVAL" = "$EXPECTED" ]; then echo "PASS $0" exit 0; else diff --git a/karm/test/booktime-baduid.sh b/karm/test/booktime-baduid.sh index 8cb064244..94364b3d2 100755 --- a/karm/test/booktime-baduid.sh +++ b/karm/test/booktime-baduid.sh @@ -4,7 +4,7 @@ TESTFILE="/tmp/testkarm1.ics" -source __lib.sh +. ./__lib.sh set_up @@ -13,7 +13,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface bookTime bad-uid 20050619 360 2>/dev/null` tear_down EXPECTED=4 -if [ "$RVAL" == "$EXPECTED" ]; then +if [ "$RVAL" = "$EXPECTED" ]; then echo "PASS $0" exit 0; else diff --git a/karm/test/booktime-works.sh b/karm/test/booktime-works.sh index 280e1231b..4f242163c 100755 --- a/karm/test/booktime-works.sh +++ b/karm/test/booktime-works.sh @@ -2,7 +2,7 @@ TESTFILE="/tmp/testkarm1.ics" -source __lib.sh +. ./__lib.sh set_up @@ -21,7 +21,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface totalMinutesForTaskId $TASKID 2>/dev/null` SKIP_TESTFILE_DELETE=true tear_down -if [ "x$RVAL" == "x$DURATION" ]; then +if [ "x$RVAL" = "x$DURATION" ]; then echo "PASS $0" exit 0; else diff --git a/karm/test/bug94447.sh b/karm/test/bug94447.sh index fa163735b..630d1ff97 100755 --- a/karm/test/bug94447.sh +++ b/karm/test/bug94447.sh @@ -8,7 +8,7 @@ exec >>check.log 2>&1 TESTFILE="testkarm.ics" TESTTODO="testtodo" -source __lib.sh +. ./__lib.sh set_up diff --git a/karm/test/delete.sh b/karm/test/delete.sh index 78f04a7de..b0ea38bf8 100755 --- a/karm/test/delete.sh +++ b/karm/test/delete.sh @@ -7,7 +7,7 @@ exec >> check.log 2>&1 TESTFILE="/tmp/testkarm1.ics" rm $TESTFILE -source __lib.sh +. ./__lib.sh set_up @@ -24,7 +24,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface version 2>/dev/null` tear_down -if [ "$RVAL" == "" ]; then +if [ "$RVAL" = "" ]; then echo "FAIL $0: got no version." exit 1; else diff --git a/karm/test/refresh_on_change.sh b/karm/test/refresh_on_change.sh index 6253c63b6..0f0200807 100755 --- a/karm/test/refresh_on_change.sh +++ b/karm/test/refresh_on_change.sh @@ -6,7 +6,7 @@ exec >>check.log 2>&1 -source __lib.sh +. /__lib.sh TESTFILE="/tmp/testkarm.ics" @@ -48,7 +48,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface taskIdFromName $TODO_NAME` tear_down # check that todo was found -if [ "$RVAL" == "$TODO_UID" ]; then +if [ "$RVAL" = "$TODO_UID" ]; then echo "PASS $0" exit 0; else diff --git a/karm/test/version.sh b/karm/test/version.sh index 64fbc8fb0..6350e73cb 100755 --- a/karm/test/version.sh +++ b/karm/test/version.sh @@ -7,7 +7,7 @@ exec >>check.log 2>&1 TESTFILE="/tmp/testkarm1.ics" VERSION="1.6.0" -source __lib.sh +. ./__lib.sh set_up @@ -15,7 +15,7 @@ RVAL=`dcop $DCOPID KarmDCOPIface version 2>/dev/null` tear_down -if [ "$RVAL" == "$VERSION" ]; then +if [ "$RVAL" = "$VERSION" ]; then echo "PASS $0" exit 0; else diff --git a/karm/test/webdav.sh b/karm/test/webdav.sh index 8d51db92c..39ca08131 100755 --- a/karm/test/webdav.sh +++ b/karm/test/webdav.sh @@ -4,7 +4,7 @@ exec >>check.log 2>&1 -source __lib.sh +. ./__lib.sh # check for required perl stuff perl -e "use Net::DAV::Server;" > /dev/null 2>&1 |