3 # Licensed to the Apache Software Foundation (ASF) under one
4 # or more contributor license agreements. See the NOTICE file
5 # distributed with this work for additional information
6 # regarding copyright ownership. The ASF licenses this file
7 # to you under the Apache License, Version 2.0 (the
8 # "License"); you may not use this file except in compliance
9 # with the License. You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing,
14 # software distributed under the License is distributed on an
15 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 # KIND, either express or implied. See the License for the
17 # specific language governing permissions and limitations
22 Driver for running the tests on Windows.
24 For a list of options, run this script with the --help option.
27 # $HeadURL: http://svn.apache.org/repos/asf/subversion/branches/1.8.x/win-tests.py $
28 # $LastChangedRevision: 1492044 $
30 import os, sys, subprocess
39 import ConfigParser as configparser
45 my_getopt = getopt.gnu_getopt
46 except AttributeError:
47 my_getopt = getopt.getopt
50 "print usage, exit the script"
52 print("Driver for running the tests on Windows.")
53 print("Usage: python win-tests.py [option] [test-path]")
55 print("Valid options:")
56 print(" -r, --release : test the Release configuration")
57 print(" -d, --debug : test the Debug configuration (default)")
58 print(" --bin=PATH : use the svn binaries installed in PATH")
59 print(" -u URL, --url=URL : run ra_dav or ra_svn tests against URL;")
60 print(" will start svnserve for ra_svn tests")
61 print(" -v, --verbose : talk more")
62 print(" -q, --quiet : talk less")
63 print(" -f, --fs-type=type : filesystem type to use (fsfs is default)")
64 print(" -c, --cleanup : cleanup after running a test")
65 print(" -t, --test=TEST : Run the TEST test (all is default); use")
66 print(" TEST#n to run a particular test number,")
67 print(" multiples also accepted e.g. '2,4-7'")
68 print(" --log-level=LEVEL : Set log level to LEVEL (E.g. DEBUG)")
69 print(" --log-to-stdout : Write log results to stdout")
71 print(" --svnserve-args=list : comma-separated list of arguments for")
73 print(" default is '-d,-r,<test-path-root>'")
74 print(" --asp.net-hack : use '_svn' instead of '.svn' for the admin")
76 print(" --httpd-dir : location where Apache HTTPD is installed")
77 print(" --httpd-port : port for Apache HTTPD; random port number")
78 print(" will be used, if not specified")
79 print(" --httpd-daemon : Run Apache httpd as daemon")
80 print(" --httpd-service : Run Apache httpd as Windows service (default)")
81 print(" --httpd-no-log : Disable httpd logging")
82 print(" --http-short-circuit : Use SVNPathAuthz short_circuit on HTTP server")
83 print(" --disable-http-v2 : Do not advertise support for HTTPv2 on server")
84 print(" --disable-bulk-updates : Disable bulk updates on HTTP server")
85 print(" --ssl-cert : Path to SSL server certificate to trust.")
86 print(" --javahl : Run the javahl tests instead of the normal tests")
87 print(" --list : print test doc strings only")
88 print(" --milestone-filter=RE : RE is a regular expression pattern that (when")
89 print(" used with --list) limits the tests listed to")
90 print(" those with an associated issue in the tracker")
91 print(" which has a target milestone that matches RE.")
92 print(" --mode-filter=TYPE : limit tests to expected TYPE = XFAIL, SKIP, PASS,")
93 print(" or 'ALL' (default)")
94 print(" --enable-sasl : enable Cyrus SASL authentication for")
96 print(" -p, --parallel : run multiple tests in parallel")
97 print(" --server-minor-version : the minor version of the server being")
99 print(" --config-file : Configuration file for tests")
100 print(" --fsfs-sharding : Specify shard size (for fsfs)")
101 print(" --fsfs-packing : Run 'svnadmin pack' automatically")
105 CMDLINE_TEST_SCRIPT_PATH = 'subversion/tests/cmdline/'
106 CMDLINE_TEST_SCRIPT_NATIVE_PATH = CMDLINE_TEST_SCRIPT_PATH.replace('/', os.sep)
108 sys.path.insert(0, os.path.join('build', 'generator'))
109 sys.path.insert(1, 'build')
112 version_header = os.path.join('subversion', 'include', 'svn_version.h')
113 cp = configparser.ConfigParser()
114 cp.read('gen-make.opts')
115 gen_obj = gen_win.GeneratorBase('build.conf', version_header,
117 all_tests = gen_obj.test_progs + gen_obj.bdb_test_progs \
118 + gen_obj.scripts + gen_obj.bdb_scripts
119 client_tests = [x for x in all_tests if x.startswith(CMDLINE_TEST_SCRIPT_PATH)]
122 for section in gen_obj.sections.values():
123 if section.options.get("msvc-export"):
124 dll_basename = section.name + "-" + str(gen_obj.version) + ".dll"
125 svn_dlls.append(os.path.join("subversion", section.name, dll_basename))
127 opts, args = my_getopt(sys.argv[1:], 'hrdvqct:pu:f:',
128 ['release', 'debug', 'verbose', 'quiet', 'cleanup',
129 'test=', 'url=', 'svnserve-args=', 'fs-type=', 'asp.net-hack',
130 'httpd-dir=', 'httpd-port=', 'httpd-daemon',
131 'httpd-server', 'http-short-circuit', 'httpd-no-log',
132 'disable-http-v2', 'disable-bulk-updates', 'help',
133 'fsfs-packing', 'fsfs-sharding=', 'javahl',
134 'list', 'enable-sasl', 'bin=', 'parallel',
135 'config-file=', 'server-minor-version=', 'log-level=',
136 'log-to-stdout', 'mode-filter=', 'milestone-filter=',
139 print('Warning: non-option arguments after the first one will be ignored')
141 # Interpret the options and set parameters
142 base_url, fs_type, verbose, quiet, cleanup = None, None, None, None, None
143 repo_loc = 'local repository.'
146 faillog = 'fails.log'
153 http_short_circuit = False
154 advertise_httpv2 = True
155 http_bulk_updates = True
157 milestone_filter = None
164 server_minor_version = None
172 for opt, val in opts:
173 if opt in ('-h', '--help'):
175 elif opt in ('-u', '--url'):
177 elif opt in ('-f', '--fs-type'):
179 elif opt in ('-v', '--verbose'):
181 elif opt in ('-q', '--quiet'):
183 elif opt in ('-c', '--cleanup'):
185 elif opt in ('-t', '--test'):
186 tests_to_run.append(val)
187 elif opt in ['-r', '--release']:
189 elif opt in ['-d', '--debug']:
191 elif opt == '--svnserve-args':
192 svnserve_args = val.split(',')
194 elif opt == '--asp.net-hack':
195 os.environ['SVN_ASP_DOT_NET_HACK'] = opt
196 elif opt == '--httpd-dir':
197 abs_httpd_dir = os.path.abspath(val)
199 elif opt == '--httpd-port':
200 httpd_port = int(val)
201 elif opt == '--httpd-daemon':
203 elif opt == '--httpd-service':
205 elif opt == '--httpd-no-log':
207 elif opt == '--http-short-circuit':
208 http_short_circuit = True
209 elif opt == '--disable-http-v2':
210 advertise_httpv2 = False
211 elif opt == '--disable-bulk-updates':
212 http_bulk_updates = False
213 elif opt == '--fsfs-sharding':
214 fsfs_sharding = int(val)
215 elif opt == '--fsfs-packing':
217 elif opt == '--javahl':
219 elif opt == '--list':
221 elif opt == '--milestone-filter':
222 milestone_filter = val
223 elif opt == '--mode-filter':
225 elif opt == '--enable-sasl':
227 base_url = "svn://localhost/"
228 elif opt == '--server-minor-version':
229 server_minor_version = val
232 elif opt in ('-p', '--parallel'):
234 elif opt in ('--config-file'):
236 elif opt == '--log-to-stdout':
238 elif opt == '--log-level':
240 elif opt == '--ssl-cert':
243 # Calculate the source and test directory names
244 abs_srcdir = os.path.abspath("")
245 abs_objdir = os.path.join(abs_srcdir, objdir)
247 abs_builddir = abs_objdir
250 abs_builddir = os.path.abspath(args[0])
253 # Default to fsfs explicitly
257 # Don't run bdb tests if they want to test fsfs
258 if fs_type == 'fsfs':
259 all_tests = gen_obj.test_progs + gen_obj.scripts
263 httpd_port = random.randrange(1024, 30000)
265 base_url = 'http://localhost:' + str(httpd_port)
268 repo_loc = 'remote repository ' + base_url + '.'
269 if base_url[:4] == 'http':
270 log = 'dav-tests.log'
271 faillog = 'dav-fails.log'
272 elif base_url[:3] == 'svn':
273 log = 'svn-tests.log'
274 faillog = 'svn-fails.log'
277 # Don't know this scheme, but who're we to judge whether it's
279 log = 'url-tests.log'
280 faillog = 'url-fails.log'
282 # Have to move the executables where the tests expect them to be
283 copied_execs = [] # Store copied exec files to avoid the final dir scan
285 def create_target_dir(dirname):
286 tgt_dir = os.path.join(abs_builddir, dirname)
287 if not os.path.exists(tgt_dir):
289 print("mkdir: %s" % tgt_dir)
292 def copy_changed_file(src, tgt):
293 if not os.path.isfile(src):
294 print('Could not find ' + src)
296 if os.path.isdir(tgt):
297 tgt = os.path.join(tgt, os.path.basename(src))
298 if os.path.exists(tgt):
299 assert os.path.isfile(tgt)
300 if filecmp.cmp(src, tgt):
302 print("same: %s" % src)
303 print(" and: %s" % tgt)
306 print("copy: %s" % src)
307 print(" to: %s" % tgt)
308 shutil.copy(src, tgt)
311 def copy_execs(baton, dirname, names):
314 if not name.endswith('.exe'):
316 src = os.path.join(dirname, name)
317 tgt = os.path.join(abs_builddir, dirname, name)
318 create_target_dir(dirname)
319 if copy_changed_file(src, tgt):
320 copied_execs.append(tgt)
323 "Move DLLs to a known location and set env vars"
327 # look for APR 1.x dll's and use those if found
328 apr_test_path = os.path.join(gen_obj.apr_path, objdir, 'libapr-1.dll')
329 if os.path.exists(apr_test_path):
334 if cp.has_option('options', '--with-static-apr'):
335 dlls.append(os.path.join(gen_obj.apr_path, objdir,
336 'libapr%s.dll' % (suffix)))
337 dlls.append(os.path.join(gen_obj.apr_util_path, objdir,
338 'libaprutil%s.dll' % (suffix)))
340 if gen_obj.libintl_path is not None:
341 dlls.append(os.path.join(gen_obj.libintl_path, 'bin', 'intl3_svn.dll'))
343 if gen_obj.bdb_lib is not None:
344 partial_path = os.path.join(gen_obj.bdb_path, 'bin', gen_obj.bdb_lib)
345 if objdir == 'Debug':
346 dlls.append(partial_path + 'd.dll')
348 dlls.append(partial_path + '.dll')
350 if gen_obj.sasl_path is not None:
351 dlls.append(os.path.join(gen_obj.sasl_path, 'lib', 'libsasl.dll'))
354 copy_changed_file(dll, abs_objdir)
356 # Copy the Subversion library DLLs
357 if not cp.has_option('options', '--disable-shared'):
358 for svn_dll in svn_dlls:
359 copy_changed_file(os.path.join(abs_objdir, svn_dll), abs_objdir)
361 # Copy the Apache modules
362 if run_httpd and cp.has_option('options', '--with-httpd'):
363 mod_dav_svn_path = os.path.join(abs_objdir, 'subversion',
364 'mod_dav_svn', 'mod_dav_svn.so')
365 mod_authz_svn_path = os.path.join(abs_objdir, 'subversion',
366 'mod_authz_svn', 'mod_authz_svn.so')
367 mod_dontdothat_path = os.path.join(abs_objdir, 'tools', 'server-side',
368 'mod_dontdothat', 'mod_dontdothat.so')
370 copy_changed_file(mod_dav_svn_path, abs_objdir)
371 copy_changed_file(mod_authz_svn_path, abs_objdir)
372 copy_changed_file(mod_dontdothat_path, abs_objdir)
374 os.environ['PATH'] = abs_objdir + os.pathsep + os.environ['PATH']
377 path = os.path.normpath(path)
378 parts = path.split(os.path.sep)
379 drive = parts[0].upper()
381 path = drive + os.path.sep
383 dirs = os.listdir(path)
385 if dir.lower() == part.lower():
386 path = os.path.join(path, dir)
391 "Run svnserve for ra_svn tests"
392 def __init__(self, svnserve_args, objdir, abs_objdir, abs_builddir):
393 self.args = svnserve_args
394 self.name = 'svnserve.exe'
396 self.path = os.path.join(abs_objdir,
397 'subversion', 'svnserve', self.name)
398 self.root = os.path.join(abs_builddir, CMDLINE_TEST_SCRIPT_NATIVE_PATH)
399 self.proc_handle = None
402 "Stop svnserve when the object is deleted"
405 def _quote(self, arg):
407 return '"' + arg + '"'
413 args = [self.name, '-d', '-r', self.root]
415 args = [self.name] + self.args
416 print('Starting %s %s' % (self.kind, self.name))
420 args = ' '.join([self._quote(x) for x in args])
422 win32process.CreateProcess(self._quote(self.path), args,
424 win32con.CREATE_NEW_CONSOLE,
425 None, None, win32process.STARTUPINFO()))[0]
427 os.spawnv(os.P_NOWAIT, self.path, args)
430 if self.proc_handle is not None:
433 print('Stopping %s' % self.name)
434 win32process.TerminateProcess(self.proc_handle, 0)
438 print('Svnserve.stop not implemented')
441 "Run httpd for DAV tests"
442 def __init__(self, abs_httpd_dir, abs_objdir, abs_builddir, httpd_port,
443 service, no_log, httpv2, short_circuit, bulk_updates):
444 self.name = 'apache.exe'
445 self.httpd_port = httpd_port
446 self.httpd_dir = abs_httpd_dir
449 self.httpv2_option = 'on'
451 self.httpv2_option = 'off'
454 self.bulkupdates_option = 'on'
456 self.bulkupdates_option = 'off'
458 self.service = service
459 self.proc_handle = None
460 self.path = os.path.join(self.httpd_dir, 'bin', self.name)
463 self.path_authz_option = 'short_circuit'
465 self.path_authz_option = 'on'
467 if not os.path.exists(self.path):
468 self.name = 'httpd.exe'
469 self.path = os.path.join(self.httpd_dir, 'bin', self.name)
470 if not os.path.exists(self.path):
471 raise RuntimeError("Could not find a valid httpd binary!")
473 self.root_dir = os.path.join(CMDLINE_TEST_SCRIPT_NATIVE_PATH, 'httpd')
474 self.root = os.path.join(abs_builddir, self.root_dir)
475 self.authz_file = os.path.join(abs_builddir,
476 CMDLINE_TEST_SCRIPT_NATIVE_PATH,
477 'svn-test-work', 'authz')
478 self.dontdothat_file = os.path.join(abs_builddir,
479 CMDLINE_TEST_SCRIPT_NATIVE_PATH,
480 'svn-test-work', 'dontdothat')
481 self.httpd_config = os.path.join(self.root, 'httpd.conf')
482 self.httpd_users = os.path.join(self.root, 'users')
483 self.httpd_mime_types = os.path.join(self.root, 'mime.types')
484 self.abs_builddir = abs_builddir
485 self.abs_objdir = abs_objdir
486 self.service_name = 'svn-test-httpd-' + str(httpd_port)
489 self.httpd_args = [self.name, '-n', self._quote(self.service_name),
490 '-f', self._quote(self.httpd_config)]
492 self.httpd_args = [self.name, '-f', self._quote(self.httpd_config)]
494 create_target_dir(self.root_dir)
496 self._create_users_file()
497 self._create_mime_types_file()
498 self._create_dontdothat_file()
501 if os.path.exists(os.path.join(self.httpd_dir,
502 'modules', 'mod_access_compat.so')):
504 elif os.path.exists(os.path.join(self.httpd_dir,
505 'modules', 'mod_auth_basic.so')):
510 # Create httpd config file
511 fp = open(self.httpd_config, 'w')
513 # Limit the number of threads (default = 64)
514 fp.write('<IfModule mpm_winnt.c>\n')
515 fp.write('ThreadsPerChild 16\n')
516 fp.write('</IfModule>\n')
519 fp.write('ServerRoot ' + self._quote(self.root) + '\n')
520 fp.write('DocumentRoot ' + self._quote(self.root) + '\n')
521 fp.write('ServerName localhost\n')
522 fp.write('PidFile pid\n')
523 fp.write('ErrorLog log\n')
524 fp.write('Listen ' + str(self.httpd_port) + '\n')
527 fp.write('LogFormat "%h %l %u %t \\"%r\\" %>s %b" common\n')
528 fp.write('Customlog log common\n')
529 fp.write('LogLevel Debug\n')
531 fp.write('LogLevel Crit\n')
533 # Write LoadModule for minimal system module
534 fp.write(self._sys_module('dav_module', 'mod_dav.so'))
535 if self.httpd_ver >= 2.3:
536 fp.write(self._sys_module('access_compat_module', 'mod_access_compat.so'))
537 fp.write(self._sys_module('authz_core_module', 'mod_authz_core.so'))
538 fp.write(self._sys_module('authz_user_module', 'mod_authz_user.so'))
539 fp.write(self._sys_module('authn_core_module', 'mod_authn_core.so'))
540 if self.httpd_ver >= 2.2:
541 fp.write(self._sys_module('auth_basic_module', 'mod_auth_basic.so'))
542 fp.write(self._sys_module('authn_file_module', 'mod_authn_file.so'))
544 fp.write(self._sys_module('auth_module', 'mod_auth.so'))
545 fp.write(self._sys_module('alias_module', 'mod_alias.so'))
546 fp.write(self._sys_module('mime_module', 'mod_mime.so'))
547 fp.write(self._sys_module('log_config_module', 'mod_log_config.so'))
549 # Write LoadModule for Subversion modules
550 fp.write(self._svn_module('dav_svn_module', 'mod_dav_svn.so'))
551 fp.write(self._svn_module('authz_svn_module', 'mod_authz_svn.so'))
553 # And for mod_dontdothat
554 fp.write(self._svn_module('dontdothat_module', 'mod_dontdothat.so'))
556 # Don't handle .htaccess, symlinks, etc.
557 fp.write('<Directory />\n')
558 fp.write('AllowOverride None\n')
559 fp.write('Options None\n')
560 fp.write('</Directory>\n\n')
562 # Define two locations for repositories
563 fp.write(self._svn_repo('repositories'))
564 fp.write(self._svn_repo('local_tmp'))
566 # And two redirects for the redirect tests
567 fp.write('RedirectMatch permanent ^/svn-test-work/repositories/'
568 'REDIRECT-PERM-(.*)$ /svn-test-work/repositories/$1\n')
569 fp.write('RedirectMatch ^/svn-test-work/repositories/'
570 'REDIRECT-TEMP-(.*)$ /svn-test-work/repositories/$1\n')
572 fp.write('TypesConfig ' + self._quote(self.httpd_mime_types) + '\n')
573 fp.write('HostNameLookups Off\n')
578 "Stop httpd when the object is deleted"
581 def _quote(self, arg):
583 return '"' + arg + '"'
587 def _create_users_file(self):
589 htpasswd = os.path.join(self.httpd_dir, 'bin', 'htpasswd.exe')
590 # Create the cheapest to compare password form for our testsuite
591 os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-bcp', self.httpd_users,
592 'jrandom', 'rayjandom'])
593 os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-bp', self.httpd_users,
594 'jconstant', 'rayjandom'])
596 def _create_mime_types_file(self):
597 "Create empty mime.types file"
598 fp = open(self.httpd_mime_types, 'w')
601 def _create_dontdothat_file(self):
602 "Create empty mime.types file"
603 # If the tests have not previously been run or were cleaned
604 # up, then 'svn-test-work' does not exist yet.
605 parent_dir = os.path.dirname(self.dontdothat_file)
606 if not os.path.exists(parent_dir):
607 os.makedirs(parent_dir)
609 fp = open(self.dontdothat_file, 'w')
610 fp.write('[recursive-actions]\n')
611 fp.write('/ = deny\n')
614 def _sys_module(self, name, path):
615 full_path = os.path.join(self.httpd_dir, 'modules', path)
616 return 'LoadModule ' + name + " " + self._quote(full_path) + '\n'
618 def _svn_module(self, name, path):
619 full_path = os.path.join(self.abs_objdir, path)
620 return 'LoadModule ' + name + ' ' + self._quote(full_path) + '\n'
622 def _svn_repo(self, name):
623 path = os.path.join(self.abs_builddir,
624 CMDLINE_TEST_SCRIPT_NATIVE_PATH,
625 'svn-test-work', name)
626 location = '/svn-test-work/' + name
627 ddt_location = '/ddt-test-work/' + name
629 '<Location ' + location + '>\n' \
631 ' SVNParentPath ' + self._quote(path) + '\n' \
632 ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
633 ' SVNPathAuthz ' + self.path_authz_option + '\n' \
634 ' SVNAllowBulkUpdates ' + self.bulkupdates_option + '\n' \
635 ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
636 ' AuthType Basic\n' \
637 ' AuthName "Subversion Repository"\n' \
638 ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
639 ' Require valid-user\n' \
641 '<Location ' + ddt_location + '>\n' \
643 ' SVNParentPath ' + self._quote(path) + '\n' \
644 ' SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
645 ' SVNPathAuthz ' + self.path_authz_option + '\n' \
646 ' SVNAllowBulkUpdates ' + self.bulkupdates_option + '\n' \
647 ' AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
648 ' AuthType Basic\n' \
649 ' AuthName "Subversion Repository"\n' \
650 ' AuthUserFile ' + self._quote(self.httpd_users) + '\n' \
651 ' Require valid-user\n' \
652 ' DontDoThatConfigFile ' + self._quote(self.dontdothat_file) + '\n' \
657 self._start_service()
667 def _start_service(self):
668 "Install and start HTTPD service"
669 print('Installing service %s' % self.service_name)
670 os.spawnv(os.P_WAIT, self.path, self.httpd_args + ['-k', 'install'])
671 print('Starting service %s' % self.service_name)
672 os.spawnv(os.P_WAIT, self.path, self.httpd_args + ['-k', 'start'])
674 def _stop_service(self):
675 "Stop and uninstall HTTPD service"
676 os.spawnv(os.P_WAIT, self.path, self.httpd_args + ['-k', 'stop'])
677 os.spawnv(os.P_WAIT, self.path, self.httpd_args + ['-k', 'uninstall'])
679 def _start_daemon(self):
680 "Start HTTPD as daemon"
681 print('Starting httpd as daemon')
682 print(self.httpd_args)
686 args = ' '.join([self._quote(x) for x in self.httpd_args])
688 win32process.CreateProcess(self._quote(self.path), args,
690 win32con.CREATE_NEW_CONSOLE,
691 None, None, win32process.STARTUPINFO()))[0]
693 os.spawnv(os.P_NOWAIT, self.path, self.httpd_args)
695 def _stop_daemon(self):
696 "Stop the HTTPD daemon"
697 if self.proc_handle is not None:
700 print('Stopping %s' % self.name)
701 win32process.TerminateProcess(self.proc_handle, 0)
705 print('Httpd.stop_daemon not implemented')
707 # Move the binaries to the test directory
710 old_cwd = os.getcwd()
714 for dirpath, dirs, files in os.walk('subversion'):
715 copy_execs(baton, dirpath, files)
716 for dirpath, dirs, files in os.walk('tools/server-side'):
717 copy_execs(baton, dirpath, files)
724 # Create the base directory for Python tests
725 create_target_dir(CMDLINE_TEST_SCRIPT_NATIVE_PATH)
727 # Ensure the tests directory is correctly cased
728 abs_builddir = fix_case(abs_builddir)
733 # No need to start any servers if we are only listing the tests.
736 daemon = Svnserve(svnserve_args, objdir, abs_objdir, abs_builddir)
739 daemon = Httpd(abs_httpd_dir, abs_objdir, abs_builddir, httpd_port,
740 httpd_service, httpd_no_log,
741 advertise_httpv2, http_short_circuit,
744 # Start service daemon, if any
748 # Find the full path and filename of any test that is specified just by
750 if len(tests_to_run) != 0:
752 for t in tests_to_run:
755 t, tns = t.split('#')
757 test = [x for x in all_tests if x.split('/')[-1] == t]
758 if not test and not (t.endswith('-test.exe') or t.endswith('_tests.py')):
759 # The lengths of '-test.exe' and of '_tests.py' are both 9.
760 test = [x for x in all_tests if x.split('/')[-1][:-9] == t]
763 print("Skipping test '%s', test not found." % t)
765 tests.append('%s#%s' % (test[0], tns))
771 tests_to_run = all_tests
775 print('Listing %s configuration on %s' % (objdir, repo_loc))
777 print('Testing %s configuration on %s' % (objdir, repo_loc))
778 sys.path.insert(0, os.path.join(abs_srcdir, 'build'))
786 log_file = os.path.join(abs_builddir, log)
787 fail_log_file = os.path.join(abs_builddir, faillog)
789 th = run_tests.TestHarness(abs_srcdir, abs_builddir,
792 base_url, fs_type, 'serf',
793 server_minor_version, not quiet,
794 cleanup, enable_sasl, parallel, config_file,
795 fsfs_sharding, fsfs_packing,
796 list_tests, svn_bin, mode_filter,
798 set_log_level=log_level, ssl_cert=ssl_cert)
799 old_cwd = os.getcwd()
801 os.chdir(abs_builddir)
802 failed = th.run(tests_to_run)
812 '-Dtest.rootdir=' + os.path.join(abs_builddir, 'javahl'),
813 '-Dtest.srcdir=' + os.path.join(abs_srcdir,
814 'subversion/bindings/javahl'),
816 '-Dtest.fstype=' + fs_type ,
819 '-Djava.library.path='
820 + os.path.join(abs_objdir,
821 'subversion/bindings/javahl/native'),
823 os.path.join(abs_srcdir, 'subversion/bindings/javahl/classes') +';' +
828 print('Running org.apache.subversion tests:')
831 r = subprocess.call(args + tuple(['org.apache.subversion.javahl.RunTests']))
835 print('[Test runner reported failure]')
838 print('Running org.tigris.subversion tests:')
840 r = subprocess.call(args + tuple(['org.tigris.subversion.javahl.RunTests']))
844 print('[Test runner reported failure]')
847 # Stop service daemon, if any
851 # Remove the execs again
852 for tgt in copied_execs:
854 if os.path.isfile(tgt):
856 print("kill: %s" % tgt)
859 traceback.print_exc(file=sys.stdout)