From 6a7a2fdacd73ffe494dfc4518f8b3eb65a6ceb16 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Wed, 12 Oct 2011 14:20:55 +0000 Subject: [PATCH] fortified assert_no_diff_dir function git-svn-id: http://biopieces.googlecode.com/svn/trunk@1545 74ccb610-7750-0410-82ae-013aeee3265d --- bp_test/lib/test.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bp_test/lib/test.sh b/bp_test/lib/test.sh index 530c7a4..68e3825 100755 --- a/bp_test/lib/test.sh +++ b/bp_test/lib/test.sh @@ -64,8 +64,20 @@ function assert_no_diff_dir local src_dir=$1 local dst_dir=$2 - src_cksum=`find $src_dir -type f | xargs cat | cksum` - dst_cksum=`find $dst_dir -type f | xargs cat | cksum` + if [ ! -d $src_dir ]; then + echo_red "FAIL" + log "FAIL" + return + fi + + if [ ! -d $dst_dir ]; then + echo_red "FAIL" + log "FAIL" + return + fi + + local src_cksum=`find $src_dir -type f | xargs cat | cksum` + local dst_cksum=`find $dst_dir -type f | xargs cat | cksum` if [ "$src_cksum" == "$dst_cksum" ]; then echo_green "OK" -- 2.39.2