From: Robert Bradshaw Date: Thu, 29 Oct 2009 05:49:36 +0000 (-0700) Subject: add embedding to the test suite X-Git-Tag: 0.12.alpha0~8^2~25 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ff495c9d71982ebe02c3511b021da89d8b5ea96f;p=cython.git add embedding to the test suite --- diff --git a/Demos/embed/Makefile b/Demos/embed/Makefile index 4a5209e1..dfb0cc91 100644 --- a/Demos/embed/Makefile +++ b/Demos/embed/Makefile @@ -16,7 +16,7 @@ all: embedded clean: @echo Cleaning Demos/embed - @rm -f *~ *.o *.so core core.* *.c embedded + @rm -f *~ *.o *.so core core.* *.c embedded test.output test: clean all ./embedded > test.output diff --git a/runtests.py b/runtests.py index efb4d421..ce48632e 100644 --- a/runtests.py +++ b/runtests.py @@ -127,6 +127,9 @@ class TestBuilder(object): continue suite.addTest( self.handle_directory(path, filename)) + if sys.platform not in ['win32']: + if [1 for selector in self.selectors if selector("embedded")]: + suite.addTest(unittest.makeSuite(EmbedTest)) return suite def handle_directory(self, path, context): @@ -555,6 +558,28 @@ def collect_doctests(path, module_prefix, suite, selectors): except ValueError: # no tests pass +# TODO: Support cython_freeze needed here as well. +# TODO: Windows support. + +class EmbedTest(unittest.TestCase): + + working_dir = "Demos/embed" + + def setUp(self): + self.old_dir = os.getcwd() + os.chdir(self.working_dir) + os.system("make clean > /dev/null") + + def tearDown(self): + try: + os.system("make clean > /dev/null") + except: + pass + os.chdir(self.old_dir) + + def test_embed(self): + self.assert_(os.system("make test > make.output") == 0) + class MissingDependencyExcluder: def __init__(self, deps): # deps: { module name : matcher func }