subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r966204 - /subversion/trunk/win-tests.py
Date Wed, 21 Jul 2010 12:17:13 GMT
Author: rhuijben
Date: Wed Jul 21 12:17:13 2010
New Revision: 966204

URL: http://svn.apache.org/viewvc?rev=966204&view=rev
Log:
Allow using win-tests.py's test setup framework to run the javahl tests. The
reason to use the same script on Windows is that the test framework already
moves all required DLLs in place to run the tests and knows where to find
junit and other required components. (Which is handled by the make scripts
on the posix systems)

* win-tests.py
  (imports): Import subprocess.
  (_usage_exit): Document --javahl option
  (global):
     Parse --javahl to test_javahl.
     Run javahl tests instead of normal tests if --javahl is passed.

Modified:
    subversion/trunk/win-tests.py

Modified: subversion/trunk/win-tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/win-tests.py?rev=966204&r1=966203&r2=966204&view=diff
==============================================================================
--- subversion/trunk/win-tests.py (original)
+++ subversion/trunk/win-tests.py Wed Jul 21 12:17:13 2010
@@ -27,7 +27,7 @@ For a list of options, run this script w
 # $HeadURL$
 # $LastChangedRevision$
 
-import os, sys
+import os, sys, subprocess
 import filecmp
 import shutil
 import traceback
@@ -76,6 +76,7 @@ def _usage_exit():
   print("  --httpd-daemon         : Run Apache httpd as daemon")
   print("  --httpd-service        : Run Apache httpd as Windows service (default)")
   print("  --http-library         : dav library to use, neon (default) or serf")
+  print("  --javahl               : Run the javahl tests instead of the normal tests")
   print("  --list                 : print test doc strings only")
   print("  --enable-sasl          : enable Cyrus SASL authentication for")
   print("                           svnserve")
@@ -115,7 +116,7 @@ opts, args = my_getopt(sys.argv[1:], 'hr
                         'url=', 'svnserve-args=', 'fs-type=', 'asp.net-hack',
                         'httpd-dir=', 'httpd-port=', 'httpd-daemon',
                         'httpd-server', 'http-library=', 'help',
-                        'fsfs-packing', 'fsfs-sharding=',
+                        'fsfs-packing', 'fsfs-sharding=', 'javahl',
                         'list', 'enable-sasl', 'bin=', 'parallel',
                         'config-file=', 'server-minor-version='])
 if len(args) > 1:
@@ -134,6 +135,7 @@ httpd_port = None
 httpd_service = None
 http_library = 'neon'
 list_tests = None
+test_javahl = None
 enable_sasl = None
 svn_bin = None
 parallel = None
@@ -180,6 +182,8 @@ for opt, val in opts:
     fsfs_sharding = int(val)
   elif opt == '--fsfs-packing':
     fsfs_packing = 1
+  elif opt == '--javahl':
+    test_javahl = 1
   elif opt == '--list':
     list_tests = 1
   elif opt == '--enable-sasl':
@@ -642,25 +646,61 @@ else:
 
 print('Testing %s configuration on %s' % (objdir, repo_loc))
 sys.path.insert(0, os.path.join(abs_srcdir, 'build'))
-import run_tests
-th = run_tests.TestHarness(abs_srcdir, abs_builddir,
-                           os.path.join(abs_builddir, log),
-                           os.path.join(abs_builddir, faillog),
-                           base_url, fs_type, http_library,
-                           server_minor_version, 1, cleanup,
-                           enable_sasl, parallel, config_file,
-                           fsfs_sharding, fsfs_packing,
-                           list_tests, svn_bin)
-old_cwd = os.getcwd()
-try:
-  os.chdir(abs_builddir)
-  failed = th.run(tests_to_run)
-except:
-  os.chdir(old_cwd)
-  raise
-else:
-  os.chdir(old_cwd)
 
+if not test_javahl:
+  import run_tests
+  th = run_tests.TestHarness(abs_srcdir, abs_builddir,
+                             os.path.join(abs_builddir, log),
+                             os.path.join(abs_builddir, faillog),
+                             base_url, fs_type, http_library,
+                             server_minor_version, 1, cleanup,
+                             enable_sasl, parallel, config_file,
+                             fsfs_sharding, fsfs_packing,
+                             list_tests, svn_bin)
+  old_cwd = os.getcwd()
+  try:
+    os.chdir(abs_builddir)
+    failed = th.run(tests_to_run)
+  except:
+    os.chdir(old_cwd)
+    raise
+  else:
+    os.chdir(old_cwd)
+else:
+  failed = False
+  args = (
+          'java.exe',
+          '-Dtest.rootdir=' + os.path.join(abs_builddir, 'javahl'),
+          '-Dtest.srcdir=' + os.path.join(abs_srcdir,
+                                          'subversion/bindings/javahl'),
+          '-Dtest.rooturl=',
+          '-Dtest.fstype=' + fs_type ,
+          '-Dtest.tests=',
+          
+          '-Djava.library.path=' 
+                    + os.path.join(abs_objdir,
+                                   'subversion/bindings/javahl/native'),
+          '-classpath', 
+          os.path.join(abs_srcdir, 'subversion/bindings/javahl/classes') +';' +
+            gen_obj.junit_path
+         )
+  
+  sys.stderr.flush()        
+  print('Running org.apache.subversion tests:')
+  sys.stdout.flush()
+  
+  r = subprocess.call(args + tuple(['org.apache.subversion.javahl.RunTests']))
+  sys.stdout.flush()
+  if (r != 0):
+    failed = True
+  
+  print('Running org.tigris.subversion tests:')
+  sys.stdout.flush()
+  r = subprocess.call(args + tuple(['org.tigris.subversion.javahl.RunTests']))
+  sys.stdout.flush()
+  if (r != 0):
+    failed = True
+  
 # Stop service daemon, if any
 if daemon:
   del daemon



Mime
View raw message