[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[patch] Issue #601 - Regression tests for trans_tests.py

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2005-02-15 14:18:40 CET

  Fix issue #601: Added regression test cases as described in trans_tests.py
  * subversion/tests/clients/cmdline/trans_tests.py

    Changed comments: Request for regression test changed to reflect
    completion of regression tests

    (propset_commit_otherwc_checkout): Added this funcion for
    propset, commit, checkout into another wc

    (propset_revert): Added this function for propset, revert

Index: subversion/tests/clients/cmdline/trans_tests.py
===================================================================
--- subversion/tests/clients/cmdline/trans_tests.py (revision 13019)
+++ subversion/tests/clients/cmdline/trans_tests.py (working copy)
@@ -66,21 +66,24 @@
 #
 ####
 
-########### THINGS THAT HAVE FAILED DURING HAND-TESTING ##############
+######################## Regression Tests ##########################
 #
-# These have all been fixed, but we want regression tests for them.
+# Regression tests for the following cases have been completed.
 #
 # 1. Ben encountered this:
 # Create a greek tree, commit a keyword into one file,
 # then commit a keyword property (i.e., turn on keywords), then
 # try to check out head somewhere else. See seg fault.
+# Test : propset_commit_checkout_nocrash()
 #
 # 2. Mike encountered this:
 # Add the keyword property to a file, svn revert the file, see
 # error.
+# Test : propset_revert_noerror()
 #
 # 3. Another one from Ben:
 # Keywords not expanded on checkout.
+# Test : keyword_expanded_on_checkout()
 #
 ######################################################################
 
@@ -652,7 +655,73 @@
                                          None, None, None, None, None,
                                          wc_dir)
 
+#----------------------------------------------------------------------
+# Create a greek tree, commit a keyword into one file,
+# then commit a keyword property (i.e., turn on keywords), then
+# try to check out head somewhere else.
+# This should not cause seg fault
+def propset_commit_checkout_nocrash(sbox):
+ "propset, commit, checkout into another wc"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+ mu_path = os.path.join(wc_dir, 'A', 'mu')
+
+ # Set up A/mu to do $Rev$ keyword expansion
+ svntest.main.file_append (mu_path , "\n$Rev$")
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'propset', 'svn:keywords', 'Rev', mu_path)
+
+ expected_output = wc.State(wc_dir, {
+ 'A/mu' : Item(verb='Sending'),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_status.tweak(wc_rev=1)
+ expected_status.tweak('A/mu', wc_rev=2)
+ svntest.actions.run_and_verify_commit (wc_dir,
+ expected_output, expected_status,
+ None, None, None, None, None,
+ wc_dir)
+
+
+ # Checkout into another wc dir
+ other_wc_dir = sbox.add_wc_path('other')
+ mu_other_path = os.path.join(other_wc_dir, 'A', 'mu')
   
+ try:
+ svntest.actions.run_and_verify_svn (None, None, None, 'checkout',
+ '--username', svntest.main.wc_author,
+ '--password', svntest.main.wc_passwd,
+ svntest.main.current_repo_url,
+ other_wc_dir)
+ except OSError:
+ return 0
+
+
+ # Check the contents of the file
+ svntest.actions.run_and_verify_svn (None, [ "This is the file 'mu'.\n",
+ "$Rev: 2 $" ], None,
+ 'cat', '-r', 'HEAD', mu_other_path)
+
+#----------------------------------------------------------------------
+# Add the keyword property to a file, svn revert the file
+# This should not display any error message
+def propset_revert_noerror(sbox):
+ "propset, revert"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+ mu_path = os.path.join(wc_dir, 'A', 'mu')
+
+ # Set the Rev keyword for the mu file
+ # could use the keywords_on()/keywords_off() functions to
+ # set/del all svn:keywords
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'propset', 'svn:keywords', 'Rev', mu_path)
+
+ # Revert the propset
+ svntest.actions.run_and_verify_svn(None, None, [], 'revert', mu_path)
+
 ########################################################################
 # Run the tests
 
@@ -668,6 +737,8 @@
               keyword_expanded_on_checkout,
               cat_keyword_expansion,
               copy_propset_commit,
+ propset_commit_checkout_nocrash,
+ propset_revert_noerror,
              ]
 
 if __name__ == '__main__':

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Feb 15 14:13:18 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.