From 2dbf0c220fc971c9493392a70c71954001fee7fd Mon Sep 17 00:00:00 2001 From: Claudio Bandera Date: Sun, 30 Aug 2015 23:04:16 +0200 Subject: Fixed unittests for Ubuntu --- test-directories.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test-directories.sh') diff --git a/test-directories.sh b/test-directories.sh index 86a441e..83c408f 100755 --- a/test-directories.sh +++ b/test-directories.sh @@ -1,3 +1,4 @@ +#!/bin/bash scriptDir="$(cd "$(dirname "$0")"; pwd)" source "$scriptDir/radar-base.sh" @@ -63,7 +64,8 @@ test_record_timestamp_in_repo() { test_time_to_update_when_timestamp_is_old() { cd $scriptDir - touch -A "-010000" "$(dot_git)/lastupdatetime" + newtimestamp=$(date -d "now -1 hour" +%Y%m%d%H%M) + touch -t $newtimestamp "$(dot_git)/lastupdatetime" assertTrue time_to_update } -- cgit v1.2.3 From e692cbc483f8ee4b4666143fe1b3cfbd86e7681f Mon Sep 17 00:00:00 2001 From: Claudio Bandera Date: Thu, 17 Sep 2015 20:35:34 +0200 Subject: Added switch case for OS type in tests --- test-directories.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test-directories.sh') diff --git a/test-directories.sh b/test-directories.sh index 83c408f..1777e69 100755 --- a/test-directories.sh +++ b/test-directories.sh @@ -64,8 +64,12 @@ test_record_timestamp_in_repo() { test_time_to_update_when_timestamp_is_old() { cd $scriptDir - newtimestamp=$(date -d "now -1 hour" +%Y%m%d%H%M) - touch -t $newtimestamp "$(dot_git)/lastupdatetime" + if [[ $OSTYPE == darwin* ]];then + touch -A "-010000" "$(dot_git)/lastupdatetime" + else + newtimestamp=$(date -d "now -1 hour" +%Y%m%d%H%M) + touch -t $newtimestamp "$(dot_git)/lastupdatetime" + fi; assertTrue time_to_update } -- cgit v1.2.3 From d4a487f1fa4cc048f9ca50a3d47c4aa8d6dee8bd Mon Sep 17 00:00:00 2001 From: Claudio Bandera Date: Sun, 24 Apr 2016 17:09:59 +0200 Subject: Merge remote-tracking branch 'upstream/master' into hotfix/unittests --- test-directories.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test-directories.sh') diff --git a/test-directories.sh b/test-directories.sh index 1777e69..219a9f3 100755 --- a/test-directories.sh +++ b/test-directories.sh @@ -64,7 +64,8 @@ test_record_timestamp_in_repo() { test_time_to_update_when_timestamp_is_old() { cd $scriptDir - if [[ $OSTYPE == darwin* ]];then + FETCH_TIME="$((5 * 60))" # Fetch every 5 mins + if [[ $OSTYPE == darwin* ]];then touch -A "-010000" "$(dot_git)/lastupdatetime" else newtimestamp=$(date -d "now -1 hour" +%Y%m%d%H%M) @@ -75,6 +76,7 @@ test_time_to_update_when_timestamp_is_old() { test_not_time_to_update_when_just_recorded() { cd $scriptDir + FETCH_TIME="$((5 * 60))" # Fetch every 5 mins record_timestamp assertFalse time_to_update } @@ -83,6 +85,7 @@ test_time_to_update_when_no_timestamp() { cd_to_tmp git init --quiet + FETCH_TIME="$((5 * 60))" # Fetch every 5 mins time_to_update assertTrue time_to_update -- cgit v1.2.3