]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_test/lib/test.sh
fixing usearch upgrade
[biopieces.git] / bp_test / lib / test.sh
index 530c7a4dd1cae809e7f5bfaf1694649ebf8d00f6..7ce41900d12068649fdf92320f6110f779c17398 100755 (executable)
@@ -3,8 +3,8 @@
 bp=`basename $0 | sed s/^test_//`
 in="$BP_DIR/bp_test/in/$bp.in"
 out="$BP_DIR/bp_test/out/$bp.out"
-tmp="$BP_TMP/$bp.out"
-tmp_dir="$BP_TMP/test_tmp"
+tmp="$BP_TMP/$USER.$bp.out"
+tmp_dir="$BP_TMP/$USER.test_tmp"
 log_file="$BP_TMP/$USER.test.log"
 
 # Function to run a given command (verbose).
@@ -14,6 +14,7 @@ function run
 
     msg="${command/$BP_DIR/\$BP_DIR}"
     msg="${msg//$BP_TMP/\$BP_TMP}"
+    msg="${msg/$BP_DIR/\$BP_DIR}"
 
     echo -n "Testing $msg ... "
     eval $command > /dev/null 2>&1
@@ -64,8 +65,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 | grep -v "\.svn" | sort | xargs cat | cksum`
+    local dst_cksum=`find $dst_dir -type f | grep -v "\.svn" | sort | xargs cat | cksum`
 
     if [ "$src_cksum" == "$dst_cksum" ]; then
         echo_green "OK"