Commit bb5fbf58 authored by Shane Hathaway's avatar Shane Hathaway

Removed unused test framework module.

parent 36e57a07
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
if not sys.modules.has_key('Testing'):
p0 = sys.path[0]
if p0 and __name__ == '__main__':
os.chdir(p0)
p0 = ''
p = d = os.path.abspath(os.curdir)
while d:
if os.path.isdir(os.path.join(p, 'Testing')):
sys.path[:1] = [p0, os.pardir, p]
break
p, d = os.path.split(p)
else:
print 'Unable to locate Testing package.'
sys.exit(1)
import Testing, unittest
execfile(os.path.join(os.path.split(Testing.__file__)[0], 'common.py'))
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
######################################################################
# Set up unit testing framework
#
# The following code should be at the top of every test module:
#
# import os, sys
# execfile(os.path.join(sys.path[0], 'framework.py'))
#
# ...and the following at the bottom:
#
# if __name__ == '__main__':
# main()
import string
scriptdir = sys.path[0]
input_dir = os.path.join(scriptdir, 'input')
output_dir = os.path.join(scriptdir, 'output')
if not sys.modules.has_key('unittest'):
if os.path.abspath(scriptdir) == os.path.abspath('.'):
# We're in the tests directory, and need to find unittest.
cwd = os.getcwd()
while 1:
for ext in 'py', 'pyc', 'pyo', 'pyd':
if os.path.isfile(os.path.join(cwd, 'unittest.' + ext)):
break
else:
cwd, lastdir = os.path.split(cwd)
if lastdir:
continue
break
sys.path.insert(1, cwd)
else:
# We must be in the same directory as unittest
sys.path.insert(1, '')
import unittest
TestRunner = unittest.TextTestRunner
def read_input(filename):
filename = os.path.join(input_dir, filename)
return open(filename, 'r').read()
def read_output(filename):
filename = os.path.join(output_dir, filename)
return open(filename, 'r').read()
def main():
if len(sys.argv) > 1:
errs = globals()[sys.argv[1]]()
else:
errs = TestRunner().run(test_suite())
sys.exit(errs and 1 or 0)
def debug():
test_suite().debug()
def pdebug():
import pdb
pdb.run('debug()')
#! /usr/bin/env python
#!/usr/bin/env python
"""Run all tests."""
import os, sys
execfile(os.path.join(sys.path[0], 'framework.py'))
import unittest
def test_suite():
suite = unittest.TestSuite()
......@@ -12,4 +11,4 @@ def test_suite():
return suite
if __name__ == "__main__":
main()
unittest.main(defaultTest='test_suite')
#! /usr/bin/env python1.5
#!/usr/bin/env python
"""Run all tests."""
import os, sys, glob
execfile(os.path.join(sys.path[0], 'framework.py'))
import unittest
import glob
import os
import sys
def test_suite():
suite = unittest.TestSuite()
......@@ -13,4 +15,4 @@ def test_suite():
return suite
if __name__ == "__main__":
main()
unittest.main(defaultTest='test_suite')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment