Commit ff495c9d authored by Robert Bradshaw's avatar Robert Bradshaw

add embedding to the test suite

parent ac5bf544
......@@ -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
......
......@@ -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 }
......
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