Commit f1d327b2 authored by Thomas Larrieu's avatar Thomas Larrieu

Work in progress. Tests are being built

parent dfaf4911
......@@ -33,6 +33,12 @@ Supported options
and if the values do not match the execution of the recipe will
fail.
``cleanup``
List of files / directories, separated by blanks, that will be removed
at the end of the build. This feature supports wildcards.
Basically, it's used to clean things like sources or documentation
``make-binary``
Path to the ``make`` program. Defaults to 'make' which
......@@ -1079,3 +1085,4 @@ Contributors
* Guy Rozendorn (grzn)
* Marco Mariani (mmariani)
* galpin
* Thomas Larrieu (thomas.larrieu)
......@@ -307,6 +307,40 @@ class NonInformativeTests(unittest.TestCase):
build_directory = os.path.join(self.dir, 'test_parts/test__compile__')
self.assertTrue(os.path.exists(build_directory))
def test_cleanup(self):
recipe = self.make_recipe(
{},
'test',
{
'url': 'file://%s/testdata/package-0.0.0.tar.gz' % os.path.dirname(__file__),
'cleanup': 'foo\nbar'
}
)
os.chdir(self.dir)
tmp = open('foo', 'a')
tmp = open('bar', 'a')
self.assertTrue(os.path.exists('foo'))
self.assertTrue(os.path.exists('bar'))
recipe.install()
self.assertFalse(os.path.exists('foo'))
self.assertFalse(os.path.exists('bar'))
def test_cleanup_fails_when_file_does_not_exist(self):
recipe = self.make_recipe(
{},
'test',
{
'url': 'file://%s/testdata/package-0.0.0.tar.gz' % os.path.dirname(__file__),
'cleanup': 'foo\nbar'
}
)
os.chdir(self.dir)
self.assertFalse(os.path.exists('foo'))
self.assertFalse(os.path.exists('bar'))
with self.assertRaises(IOError, recipe.install()) as cm:
print cm.error_code
def test_suite():
suite = unittest.TestSuite((
doctest.DocFileSuite(
......
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