diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-03-30 14:32:08 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-03-30 14:32:08 +0100 |
commit | 31f9de66f4a002f0d24b08e396eda150d4f8ce39 (patch) | |
tree | ef7c596a2315851d5794b0f659d7cd42b6ca77fe /morphlib | |
parent | 98961cb380a78ac76a58dc61ee1aa881f730180e (diff) | |
download | morph-31f9de66f4a002f0d24b08e396eda150d4f8ce39.tar.gz |
Add a dummy build system
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/buildsystem.py | 16 | ||||
-rw-r--r-- | morphlib/buildsystem_tests.py | 18 |
2 files changed, 34 insertions, 0 deletions
diff --git a/morphlib/buildsystem.py b/morphlib/buildsystem.py index 9ee62d03..3aa1e1ce 100644 --- a/morphlib/buildsystem.py +++ b/morphlib/buildsystem.py @@ -52,6 +52,22 @@ class ManualBuildSystem(BuildSystem): return False +class DummyBuildSystem(BuildSystem): + + '''A dummy build system, useful for debugging morphologies.''' + + name = 'dummy' + + def __init__(self): + self.configure_commands = ['echo dummy configure'] + self.build_commands = ['echo dummy build'] + self.test_commands = ['echo dummy test'] + self.install_commands = ['echo dummy install'] + + def used_by_project(self, srcdir): + return False + + class AutotoolsBuildSystem(BuildSystem): '''The automake/autoconf/libtool holy trinity.''' diff --git a/morphlib/buildsystem_tests.py b/morphlib/buildsystem_tests.py index 362b85dd..c0c2b510 100644 --- a/morphlib/buildsystem_tests.py +++ b/morphlib/buildsystem_tests.py @@ -53,6 +53,24 @@ class ManualBuildSystem(unittest.TestCase): self.assertFalse(self.bs.used_by_project(self.tempdir)) +class DummyBuildSystem(unittest.TestCase): + + def setUp(self): + self.bs = morphlib.buildsystem.DummyBuildSystem() + self.tempdir = tempfile.mkdtemp() + + def tearDown(self): + shutil.rmtree(self.tempdir) + + def test_does_not_autodetect_empty(self): + create_manual_project(self.tempdir) + self.assertFalse(self.bs.used_by_project(self.tempdir)) + + def test_does_not_autodetect_autotools(self): + create_autotools_project(self.tempdir) + self.assertFalse(self.bs.used_by_project(self.tempdir)) + + class AutotoolsBuildSystem(unittest.TestCase): def setUp(self): |