subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From artag...@apache.org
Subject svn commit: r979390 - in /subversion/trunk/subversion/tests/cmdline: svnrdump_tests.py svntest/actions.py
Date Mon, 26 Jul 2010 18:03:21 GMT
Author: artagnon
Date: Mon Jul 26 18:03:20 2010
New Revision: 979390

URL: http://svn.apache.org/viewvc?rev=979390&view=rev
Log:
* subversion/tests/cmdline/svntest/actions.py
  (run_and_verify_svnrdump): Make it more extensible by adding extra
  arguments to check expected vales. Design it like
  run_and_verify_svnadmin2.

* subversion/tests/cmdline/svnrdump_tests.py
  (run_test, basic_svnrdump): Track the above change.

Suggested by: rhuijben
Approved by: rhuijben

Modified:
    subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py
    subversion/trunk/subversion/tests/cmdline/svntest/actions.py

Modified: subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py?rev=979390&r1=979389&r2=979390&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnrdump_tests.py Mon Jul 26 18:03:20 2010
@@ -73,7 +73,9 @@ def run_test(sbox, dumpfile_name):
   svntest.actions.run_and_verify_load(sbox.repo_dir, svnadmin_dumpfile)
 
   # Create a dump file using svnrdump
-  svnrdump_dumpfile = svntest.actions.run_and_verify_svnrdump('dump', sbox.repo_url)
+  svnrdump_dumpfile = \
+      svntest.actions.run_and_verify_svnrdump(svntest.verify.AnyOutput, [], 0,
+                                              'dump', '-q', sbox.repo_url)
 
   # Compare the output from stdout
   svntest.verify.compare_and_display_lines(
@@ -86,15 +88,25 @@ def basic_svnrdump(sbox):
   "dump the standard sbox repos"
   sbox.build(read_only = True, create_wc = False)
 
-  out = svntest.actions.run_and_verify_svnrdump('dump', sbox.repo_url)
+  out = \
+      svntest.actions.run_and_verify_svnrdump(svntest.verify.AnyOutput, [], 0,
+                                              'dump', '-q', sbox.repo_url)
 
   if not out[0].startswith('SVN-fs-dump-format-version:'):
     raise svntest.Failure('No valid output')
 
-def revision0(sbox):
+def revision_0(sbox):
   "dump revision zero"
-  run_test(sbox, dumpfile_name = "revision0.dump")
+  run_test(sbox, dumpfile_name = "revision-0.dump")
 
+def copy_and_modify(sbox):
+  "copy and modify"
+  run_test(sbox, "copy-and-modify.dump")
+
+def copy_from_previous_version_and_modify(sbox):
+  "copy from previous version and modify"
+  run_test(sbox, "copy-from-previous-version-and-modify.dump")
+  
 ########################################################################
 # Run the tests
 
@@ -102,7 +114,9 @@ def revision0(sbox):
 # list all tests here, starting with None:
 test_list = [ None,
               basic_svnrdump,
-              revision0,
+              revision_0,
+              XFail(copy_and_modify),
+              XFail(copy_from_previous_version_and_modify),
              ]
 
 if __name__ == '__main__':

Modified: subversion/trunk/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/actions.py?rev=979390&r1=979389&r2=979390&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/actions.py Mon Jul 26 18:03:20 2010
@@ -284,18 +284,17 @@ def run_and_verify_dump(repo_dir):
   return output
 
 
-def run_and_verify_svnrdump(*varargs):
-  "Runs 'svnadmin dump' and reports any errors, returning the dump content."
-  exit_code, output, errput = main.run_svnrdump('-q', *varargs)
-
-  if exit_code != 0:
-    raise svntest.Failure("Exit code not 0")
-
-  verify.verify_outputs("Missing expected output(s)", output, errput,
-                        verify.AnyOutput, [])
+def run_and_verify_svnrdump(expected_stdout, expected_stderr,
+                            expected_exit, *varargs):
+  """Runs 'svnrdump' checking output and exit code, and returns output
+  on stdout"""
+
+  exit_code, output, err = main.run_svnrdump(*varargs)
+  verify.verify_outputs("Unexpected output", output, err,
+                        expected_stdout, expected_stderr)
+  verify.verify_exit_code("Unexpected return code", exit_code, expected_exit)
   return output
 
-
 def load_repo(sbox, dumpfile_path = None, dump_str = None):
   "Loads the dumpfile into sbox"
   if not dump_str:



Mime
View raw message