Alien-SVN
view release on metacpan or search on metacpan
src/subversion/build/run_tests.py view on Meta::CPAN
#!/usr/bin/env python
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
#
# run_tests.py - run the tests in the regression test suite.
#
'''usage: python run_tests.py
[--verbose] [--log-to-stdout] [--cleanup] [--parallel]
[--url=<base-url>] [--http-library=<http-library>] [--enable-sasl]
[--fs-type=<fs-type>] [--fsfs-packing] [--fsfs-sharding=<n>]
[--list] [--milestone-filter=<regex>] [--mode-filter=<type>]
[--server-minor-version=<version>] [--http-proxy=<host>:<port>]
[--config-file=<file>] [--ssl-cert=<file>]
<abs_srcdir> <abs_builddir>
<prog ...>
The optional flags and the first two parameters are passed unchanged
to the TestHarness constructor. All other parameters are names of
test programs.
Each <prog> should be the full path (absolute or from the current directory)
and filename of a test program, optionally followed by '#' and a comma-
separated list of test numbers; the default is to run all the tests in it.
'''
# A few useful constants
SVN_VER_MINOR = 8
import os, re, subprocess, sys, imp, threading
from datetime import datetime
import getopt
try:
my_getopt = getopt.gnu_getopt
except AttributeError:
my_getopt = getopt.getopt
# Ensure the compiled C tests use a known locale (Python tests set the locale
# explicitly).
os.environ['LC_ALL'] = 'C'
class TextColors:
'''Some ANSI terminal constants for output color'''
ENDC = '\033[0;m'
FAILURE = '\033[1;31m'
SUCCESS = '\033[1;32m'
@classmethod
def disable(cls):
cls.ENDC = ''
cls.FAILURE = ''
cls.SUCCESS = ''
def _get_term_width():
'Attempt to discern the width of the terminal'
# This may not work on all platforms, in which case the default of 80
# characters is used. Improvements welcomed.
def ioctl_GWINSZ(fd):
try:
import fcntl, termios, struct, os
cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
except:
return None
return cr
cr = None
if not cr:
try:
cr = (os.environ['SVN_MAKE_CHECK_LINES'],
os.environ['SVN_MAKE_CHECK_COLUMNS'])
except:
cr = None
if not cr:
cr = ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2)
if not cr:
( run in 1.210 second using v1.01-cache-2.11-cpan-62a16548d74 )