Ensure python2.6 support

This commit is contained in:
Siu Kwan Lam 2013-01-24 11:44:25 -06:00
commit 3b1ae9889d
7 changed files with 70 additions and 32 deletions

View file

@ -3,12 +3,13 @@
# Import the llvm-py modules.
from llvm import *
from llvm.core import *
from llvm.test_llvmpy import TestCase
import logging
import unittest
class TestInlineAsm(unittest.TestCase):
class TestInlineAsm(TestCase):
def test_inline_asm(self):
mod = Module.new(__name__)
fnty = Type.function(Type.int(), [Type.int()])

View file

@ -2,13 +2,14 @@ from llvm.core import *
from llvm.passes import *
from llvm.ee import *
import llvm
from llvm.test_llvmpy import TestCase
from os.path import dirname, join as join_path
import unittest
import re
class TestLoopVectorizer(unittest.TestCase):
class TestLoopVectorizer(TestCase):
def test_loop_vectorizer(self):
if llvm.version <= (3, 1):
return # SKIP

View file

@ -1,10 +1,10 @@
from __future__ import print_function
import unittest
from llvm.test_llvmpy import TestCase
from llvm.core import *
class TestMetaData(unittest.TestCase):
class TestMetaData(TestCase):
def test_metadata_get(self):
module = Module.new('test_metadata')
md = MetaData.get(module, [Constant.int(Type.int(), 1234)])

View file

@ -1,8 +1,9 @@
from llvm.core import *
from llvm.tbaa import *
from llvm.test_llvmpy import TestCase
import unittest
class TestTBAABuilder(unittest.TestCase):
class TestTBAABuilder(TestCase):
def test_tbaa_builder(self):
mod = Module.new('test_tbaa_builder')
fty = Type.function(Type.void(), [Type.pointer(Type.float())])

View file

@ -7,9 +7,9 @@ import unittest, sys, logging
from llvm import *
from llvm.core import *
from llvm.test_llvmpy import TestCase
class TestModule(unittest.TestCase):
class TestModule(TestCase):
def setUp(self):
pass
@ -100,8 +100,10 @@ def main():
gc.set_debug(gc.DEBUG_LEAK)
# run tests
unittest.main(exit=False) # set exit to False so that it will return.
if sys.version_info[:2] > (2, 6):
unittest.main(exit=False) # set exit to False so that it will return.
else:
unittest.main()
# done
for it in gc.garbage:
logging.debug('garbage = %s', it)

View file

@ -4,8 +4,9 @@ import unittest
import llvm.ee
from llvm.core import *
from llvm import _dwarf, debuginfo
from llvm.test_llvmpy import TestCase
class TestDebugInfo(unittest.TestCase):
class TestDebugInfo(TestCase):
def test_dwarf_constants(self):
dwarf_constants = vars(_dwarf)