00001 from __future__ import with_statement
00002
00003 import unittest
00004
00005 import platform
00006 if platform.system() == 'Java':
00007 import os
00008 import os.path
00009 import sys
00010 sys.path.append(os.path.join(os.environ['GME_ROOT'], 'SDK', 'Java', 'Jython'))
00011 sys.path[0:0] = (os.path.join(os.environ['GME_ROOT'], 'SDK', 'Java', 'gme.jar'),)
00012 sys.add_package("org.isis.jaut")
00013 import org.isis.jaut
00014 if not org.isis.jaut.Apartment.currentApartment():
00015 org.isis.jaut.Apartment.enter(0)
00016
00017 import GPyUnit.test_PIAs
00018
00019
00020
00021
00022 def _test_names():
00023 _test_names = [
00024 'test_PIAs',
00025 'test_registrar',
00026 'test_gmeoleapp',
00027 'test_parser',
00028 'test_registry',
00029 'test_instances',
00030 'GME_297.suite',
00031 'GME_310.suite',
00032 'GME_371',
00033 'GME_391',
00034 'test_MetaInterpreter',
00035 'Regr.Mga.tc1',
00036 'test_decorators',
00037 'test_DsmlGenerator',
00038 ]
00039 if platform.system() != 'Java':
00040 _test_names += [
00041 'Regr.Mga.tc2',
00042 'Regr.Mga.tc3',
00043 'Regr.Mga.tc5',
00044 'Regr.Mga.tc6',
00045 ]
00046 return _test_names
00047
00048 def _tests():
00049
00050
00051 if platform.system() != 'Java':
00052 import GPyUnit.Regr.Mga.tc2
00053 return unittest.defaultTestLoader.loadTestsFromNames(['GPyUnit.' + test for test in _test_names()])
00054
00055 def run_xmlrunner(output_filename):
00056 import os.path
00057 import xmlrunner
00058 results = []
00059 with open(output_filename, "w") as output:
00060 output.write("<testsuites>")
00061 for test in GPyUnit._tests():
00062 runner = xmlrunner.XMLTestRunner(output)
00063 runner.run(test)
00064 output.write("</testsuites>")
00065