Skip to content

Commit a9a2be7

Browse files
committed
issues mhagger#20: Make run-test.py possible to run on environments nowadays.
* svntest/__init__.py, svntest/actions.py, svntest/factory.py, svntest/main.py, svntest/objects.py, svntest/sandbox.py, svntest/testcase.py, svntest/tree.py, svntest/verify.py, svntest/wc.py: Update the svntest subdirectory from http://svn.apache.org/repos/asf/subversion/trunk/subversion/tests/cmdline/svntest using svntest/update.sh. Adjust run-tests.py for changes in svntest. * runtest.py: - Adjust required version of Python 2. - Get the minor version of installed svn program and set it to svntest.main.SVN_VER_MINOR. This allows at least Subversion >= 1.9 to run the test suites.
1 parent 3e9e057 commit a9a2be7

11 files changed

+3111
-2097
lines changed

run-tests.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,17 @@
4646
import textwrap
4747
import calendar
4848
import types
49+
import subprocess
4950
try:
5051
from hashlib import md5
5152
except ImportError:
5253
from md5 import md5
5354
from difflib import Differ
5455

5556
# Make sure that a supported version of Python is being used:
56-
if not (0x02040000 <= sys.hexversion < 0x03000000):
57+
if not (0x02070000 <= sys.hexversion < 0x03000000):
5758
sys.stderr.write(
58-
'error: Python 2, version 2.4 or higher required.\n'
59+
'error: Python 2, version 2.7 or higher required.\n'
5960
)
6061
sys.exit(1)
6162

@@ -4310,6 +4311,10 @@ def vendor_1_1_not_root():
43104311
svntest.main.svnadmin_binary = svnadmin_binary
43114312
svntest.main.svnversion_binary = svnversion_binary
43124313

4314+
# check version of svn_binary
4315+
svn_version = subprocess.check_output([svn_binary, '--version', '-q'])
4316+
svntest.main.SVN_VER_MINOR = int(svn_version.split('.')[1])
4317+
43134318
svntest.main.run_tests(test_list)
43144319
# NOTREACHED
43154320

svntest/__init__.py

+13-16
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,20 @@
2323
__all__ = [ ]
2424

2525
import sys
26-
if sys.hexversion < 0x2050000:
27-
sys.stderr.write('[SKIPPED] at least Python 2.5 is required\n')
26+
if sys.hexversion < 0x2070000:
27+
sys.stderr.write('[SKIPPED] at least Python 2.7 is required\n')
2828

2929
# note: exiting is a bit harsh for a library module, but we really do
30-
# require Python 2.5. this package isn't going to work otherwise.
30+
# require Python 2.7. this package isn't going to work otherwise.
3131

3232
# we're skipping this test, not failing, so exit with 0
3333
sys.exit(0)
3434

3535
try:
3636
import sqlite3
3737
except ImportError:
38-
try:
39-
from pysqlite2 import dbapi2 as sqlite3
40-
except ImportError:
41-
sys.stderr.write('[SKIPPED] Python sqlite3 module required\n')
42-
sys.exit(0)
38+
sys.stderr.write('[SKIPPED] Python sqlite3 module required\n')
39+
sys.exit(0)
4340

4441
# don't export this name
4542
del sys
@@ -53,11 +50,11 @@ class Skip(Exception):
5350
pass
5451

5552
# import in a specific order: things with the fewest circular imports first.
56-
import testcase
57-
import wc
58-
import verify
59-
import tree
60-
import sandbox
61-
import main
62-
import actions
63-
import factory
53+
from . import testcase
54+
from . import wc
55+
from . import verify
56+
from . import tree
57+
from . import sandbox
58+
from . import main
59+
from . import actions
60+
from . import factory

0 commit comments

Comments
 (0)