From ff495c9d71982ebe02c3511b021da89d8b5ea96f Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 28 Oct 2009 22:49:36 -0700 Subject: [PATCH] add embedding to the test suite --- Demos/embed/Makefile | 2 +- runtests.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) 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 } -- 2.26.2