Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r1564 - trunk: . fsvs/tests

fsvs
Discussion topic

Back to topic list

svn commit: r1564 - trunk: . fsvs/tests

Author pmarek
Full name P.Marek
Date 2008-03-24 23:22:26 PDT
Message Author: pmarek
Date: 2008-03-24 23:22:26-0700
New Revision: 1564

Modified:
   trunk/ (props changed)
   trunk/fsvs/tests/047​_revert_details

Log:
Corrected test for reverting a directory


Modified: trunk/fsvs/tests/047​_revert_details
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/tests/0​47_revert_details?vi​ew=diff&rev=1564​&p1=trunk/fsvs/t​ests/047_revert_deta​ils&p2=trunk/fsv​s/tests/047_revert_d​etails&r1=1563​&r2=1564
====================​====================​====================​==================
--- trunk/fsvs/tests/047​_revert_details (original)
+++ trunk/fsvs/tests/047​_revert_details 2008-03-24 23:22:26-0700
@@ -21,6 +21,7 @@
 $BINq ci -m1 -o delay=yes
 
 
+failed=0
 function Check
 {
   name="$1"
@@ -33,6 +34,7 @@
     else
         $BINdflt st -C "$name"
         $ERROR "Expected $exp for $name - $msg"
+ failed=1
     fi
 }
 
@@ -40,9 +42,15 @@
 cp $src $dest
 cp -r $src_d $dest_d
 
-( echo $src $dest ;
- echo $src_d $dest_d ) | while read cur_src cur_dest
+# A while loop doesn't stop the shell for a failed command?
+# We have to remember whether everything's ok.
+set -- $src $dest $src_d $dest_d
+while [[ $# -ge 2 ]]
 do
+ cur_src="$1"
+ cur_dest="$2"
+ shift 2
+
   echo $cur_src $cur_dest
 # Revert shouldn't do anything.
     Check "$cur_dest" "N..." "unversioned"
@@ -60,6 +68,14 @@
     fi
     Check "$cur_dest" ".mC+" "changed copy"
     $BINq revert $cur_dest
+ # This revert won't delete the new file, so it would cause the directory
+ # to be "changed" again.
+ if test -d "$cur_dest"
+ then
+ rm "$cur_dest/sdfh"
+ # Now the mtime has changed again - do a revert once more.
+ $BINq revert $cur_dest
+ fi
     Check "$cur_dest" "...+" "revert on copied"
     $BINq revert $cur_dest
     Check "$cur_dest" "N..." "revert*2 on copied"
@@ -67,6 +83,11 @@
     Check "$cur_dest" "N..." "revert*3 on copied"
 done
 
+if [[ "$failed" == "1" ]]
+then
+ $ERROR "Tests failed."
+fi
+
 # Check for reverting a directory
 
 # TODO: test reverting a branch in a copied directory tree

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r1564 - trunk: . fsvs/tests pmarek P.Marek 2008-03-24 23:22:26 PDT
Messages per page: