Skip to content

issues #20: Make run-test.py possible to run on environments nowadays. #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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