Reorganize and cleanup tests

This commit is contained in:
Siu Kwan Lam 2013-10-04 14:55:56 +08:00
commit fac1bc782d
36 changed files with 1780 additions and 1592 deletions

34
llvm/tests/support.py Normal file
View file

@ -0,0 +1,34 @@
import sys
import unittest
import contextlib
from llvm.tests import tests, isolated_tests # re-expose symbol
IS_PY3K = sys.version_info[0] >= 3
BITS = tuple.__itemsize__ * 8
if sys.version_info[:2] <= (2, 6):
# create custom TestCase
class TestCase(unittest.TestCase):
def assertIn(self, item, container):
self.assertTrue(item in container)
def assertNotIn(self, item, container):
self.assertFalse(item in container)
def assertLess(self, a, b):
self.assertTrue(a < b)
def assertIs(self, a, b):
self.assertTrue(a is b)
@contextlib.contextmanager
def assertRaises(self, exc):
try:
yield
except exc:
pass
else:
raise self.failureException("Did not raise %s" % exc)
else:
TestCase = unittest.TestCase