showard | 3de2a76 | 2008-09-12 16:33:18 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
showard | b7ad096 | 2009-06-15 20:22:23 +0000 | [diff] [blame^] | 3 | import os, shutil, tempfile, unittest |
showard | 3de2a76 | 2008-09-12 16:33:18 +0000 | [diff] [blame] | 4 | |
| 5 | COMPILE_SCRIPT_DIR = os.path.join(os.path.dirname(__file__), 'client') |
| 6 | |
| 7 | class ClientCompilationTest(unittest.TestCase): |
| 8 | def _compile_module(self, module_name): |
| 9 | compile_script = module_name + '-compile' |
| 10 | full_path = os.path.join(COMPILE_SCRIPT_DIR, compile_script) |
showard | b7ad096 | 2009-06-15 20:22:23 +0000 | [diff] [blame^] | 11 | temp_dir = tempfile.mkdtemp('.client_compilation_unittest') |
| 12 | try: |
| 13 | result = os.system(full_path + ' -validateOnly -out ' + temp_dir) |
| 14 | finally: |
| 15 | shutil.rmtree(temp_dir) |
showard | 3de2a76 | 2008-09-12 16:33:18 +0000 | [diff] [blame] | 16 | self.assertEquals(result, 0) |
| 17 | |
| 18 | |
| 19 | def test_afe_compilation(self): |
| 20 | self._compile_module('AfeClient') |
| 21 | |
| 22 | |
| 23 | def test_tko_compilation(self): |
| 24 | self._compile_module('TkoClient') |
| 25 | |
| 26 | |
showard | 9f4500a | 2009-04-27 20:10:35 +0000 | [diff] [blame] | 27 | def test_embedded_tko_compilation(self): |
| 28 | self._compile_module('EmbeddedTkoClient') |
| 29 | |
| 30 | |
showard | 3de2a76 | 2008-09-12 16:33:18 +0000 | [diff] [blame] | 31 | if __name__ == '__main__': |
| 32 | unittest.main() |