Skip to content

Commit

Permalink
issues mhagger#20: Make run-test.py possible to run on environments n…
Browse files Browse the repository at this point in the history
…owadays.

* 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.
  • Loading branch information
futatuki committed Dec 16, 2021
1 parent 3e9e057 commit a9a2be7
Show file tree
Hide file tree
Showing 11 changed files with 3,111 additions and 2,097 deletions.
9 changes: 7 additions & 2 deletions run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@
import textwrap
import calendar
import types
import subprocess
try:
from hashlib import md5
except ImportError:
from md5 import md5
from difflib import Differ

# Make sure that a supported version of Python is being used:
if not (0x02040000 <= sys.hexversion < 0x03000000):
if not (0x02070000 <= sys.hexversion < 0x03000000):
sys.stderr.write(
'error: Python 2, version 2.4 or higher required.\n'
'error: Python 2, version 2.7 or higher required.\n'
)
sys.exit(1)

Expand Down Expand Up @@ -4310,6 +4311,10 @@ def vendor_1_1_not_root():
svntest.main.svnadmin_binary = svnadmin_binary
svntest.main.svnversion_binary = svnversion_binary

# check version of svn_binary
svn_version = subprocess.check_output([svn_binary, '--version', '-q'])
svntest.main.SVN_VER_MINOR = int(svn_version.split('.')[1])

svntest.main.run_tests(test_list)
# NOTREACHED

Expand Down
29 changes: 13 additions & 16 deletions svntest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,20 @@
__all__ = [ ]

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

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

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

try:
import sqlite3
except ImportError:
try:
from pysqlite2 import dbapi2 as sqlite3
except ImportError:
sys.stderr.write('[SKIPPED] Python sqlite3 module required\n')
sys.exit(0)
sys.stderr.write('[SKIPPED] Python sqlite3 module required\n')
sys.exit(0)

# don't export this name
del sys
Expand All @@ -53,11 +50,11 @@ class Skip(Exception):
pass

# import in a specific order: things with the fewest circular imports first.
import testcase
import wc
import verify
import tree
import sandbox
import main
import actions
import factory
from . import testcase
from . import wc
from . import verify
from . import tree
from . import sandbox
from . import main
from . import actions
from . import factory
Loading

0 comments on commit a9a2be7

Please sign in to comment.