Update frontend/client_compliation_unittest.py to use new GWT compilation
tool.
Signed-off-by: James Ren <jamesren@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@4257 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/client_compilation_unittest.py b/frontend/client_compilation_unittest.py
index 7b3f791..bbb0f8f 100755
--- a/frontend/client_compilation_unittest.py
+++ b/frontend/client_compilation_unittest.py
@@ -1,31 +1,32 @@
#!/usr/bin/python
import os, shutil, tempfile, unittest
+import common
-COMPILE_SCRIPT_DIR = os.path.join(os.path.dirname(__file__), 'client')
+_AUTOTEST_DIR = common.autotest_dir
+
class ClientCompilationTest(unittest.TestCase):
+
+
def _compile_module(self, module_name):
- compile_script = module_name + '-compile'
- full_path = os.path.join(COMPILE_SCRIPT_DIR, compile_script)
- temp_dir = tempfile.mkdtemp('.client_compilation_unittest')
- try:
- result = os.system(full_path + ' -validateOnly -war ' + temp_dir)
- finally:
- shutil.rmtree(temp_dir)
+ compile_script = os.path.join(_AUTOTEST_DIR, 'utils',
+ 'compile_gwt_clients.py')
+ cmd = '%s -d -c %s -e "-validateOnly"' % (compile_script, module_name)
+ result = os.system(cmd)
self.assertEquals(result, 0)
def test_afe_compilation(self):
- self._compile_module('AfeClient')
+ self._compile_module('autotest.AfeClient')
def test_tko_compilation(self):
- self._compile_module('TkoClient')
+ self._compile_module('autotest.TkoClient')
def test_embedded_tko_compilation(self):
- self._compile_module('EmbeddedTkoClient')
+ self._compile_module('autotest.EmbeddedTkoClient')
if __name__ == '__main__':