[commit] r2032 - trunk/Tests/GPyUnit

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Mon Aug 27 11:45:15 CDT 2012


Author: ksmyth
Date: Mon Aug 27 11:45:15 2012
New Revision: 2032

Log:
Test MetaGME and UML can be rendered

Added:
   trunk/Tests/GPyUnit/test_decorators.py
Modified:
   trunk/Tests/GPyUnit/__init__.py

Modified: trunk/Tests/GPyUnit/__init__.py
==============================================================================
--- trunk/Tests/GPyUnit/__init__.py	Mon Aug 27 11:45:06 2012	(r2031)
+++ trunk/Tests/GPyUnit/__init__.py	Mon Aug 27 11:45:15 2012	(r2032)
@@ -33,6 +33,7 @@
  'GME_391',
  'test_MetaInterpreter',
  'Regr.Mga.tc1',
+ 'test_decorators',
 ]
     if platform.system() != 'Java':
         _test_names += [

Added: trunk/Tests/GPyUnit/test_decorators.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/Tests/GPyUnit/test_decorators.py	Mon Aug 27 11:45:15 2012	(r2032)
@@ -0,0 +1,55 @@
+import unittest
+import os
+import os.path
+import GPyUnit.util
+from GPyUnit.util import DispatchEx
+
+_filedir = os.path.dirname(os.path.abspath(__file__))
+def _adjacent_file(file):
+    return os.path.join(_filedir, file)
+
+class TestDecorators(unittest.TestCase):
+    def test_MetaGME(self):
+        self.runDecorators(os.environ['GME_ROOT'] + r"\Paradigms\MetaGME\MetaGME-model.xme")
+
+    def test_UML(self):
+        self.runDecorators(os.environ['GME_ROOT'] + r"\Paradigms\UML\UMLMeta.xme")
+
+    def runDecorators(self, xme_file):
+        mga = GPyUnit.util.parse_xme(self.connstr, xme_file)
+        mga.Save()
+        mga.Close()
+
+        self.gme = DispatchEx("GME.Application")
+        self.gme.OpenProject(self.connstr)
+        dumpwmf = DispatchEx("MGA.DumpWMF")
+        dumpwmf.DumpWMFs(self.outdir, self.gme)
+
+    outdir = None
+    gme = None
+    def tearDown(self):
+        if self.gme:
+            self.gme.Exit()
+            del(self.gme)
+        import glob
+        if self.outdir:
+            for file in glob.glob(self.outdir + '/*'):
+                os.unlink(file)
+    
+    def setUp(self):
+        outdir = _adjacent_file("TestDecoratorsOutput")
+        if not os.path.isdir(outdir):
+            os.mkdir(outdir)
+        self.outdir = outdir
+
+    @property
+    def connstr(self):
+        return "MGA=" + _adjacent_file("TestDecorators.mga")
+    
+
+if GPyUnit.util._opts.Dispatch_x64:
+    del TestCSharpDSMLGenerator
+    #FIXME: TestCSharpDSMLGenerator on x64 make PGO fail
+        
+if __name__ == "__main__":
+    unittest.main()


More information about the gme-commit mailing list