[PyObjC-svn] r2026 - in trunk/pyobjc/pyobjc-core: . Lib/PyObjCTools Lib/objc Lib/objc/test Modules/objc

[email protected]
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Tue Jan 13 05:37:10 2009
New Revision: 2026

Log:
Minor updates

Added:
   trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py   (contents, props changed)
   trunk/pyobjc/pyobjc-core/Lib/objc/_context.py   (contents, props changed)
Modified:
   trunk/pyobjc/pyobjc-core/Lib/objc/__init__.py
   trunk/pyobjc/pyobjc-core/Lib/objc/_bridges.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/__init__.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_NULL.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_allocatebuffer.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_archive_python.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_arrays.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_bundleFunctions.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_bundleVariables.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_classandinst.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_clinmeth.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_conversion.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_copying.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_corefoundation.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_ctests.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_dict_proxy.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_exceptions.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_filepointer.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_identity.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_imp.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_initialized.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_ivar.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_keyvalue.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_leaks.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_list_proxy.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_locking.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_function.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_imp.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_py.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_py2py.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_method_prototypes.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methodaccess.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methodedits.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methods.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methods2.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_nsdate_proxy.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_number_proxy.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_objc.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_opaque.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_outputinitializer.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_pickle.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_pickling_objc.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_posing.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protected.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protocol.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protocolNamed.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_regr.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_set_proxy.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_signatures.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_sockaddr.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_charbyte.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_charint.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_methdef.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_nsbool.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_struct.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_unichar.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_splitsig.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_structpointer.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_structs.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_subclass.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_varargs.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_voidpointer.py
   trunk/pyobjc/pyobjc-core/Lib/objc/test/test_weakref.py
   trunk/pyobjc/pyobjc-core/Modules/objc/instance-var.m
   trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m
   trunk/pyobjc/pyobjc-core/Modules/objc/method-signature.h
   trunk/pyobjc/pyobjc-core/Modules/objc/method-signature.m
   trunk/pyobjc/pyobjc-core/Modules/objc/objc_util.m
   trunk/pyobjc/pyobjc-core/Modules/objc/parsexml.m
   trunk/pyobjc/pyobjc-core/Modules/objc/struct-wrapper.m
   trunk/pyobjc/pyobjc-core/NEWS.txt

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/__init__.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/__init__.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/__init__.py	Tue Jan 13 05:37:10 2009
@@ -34,6 +34,7 @@
 from _pythonify import *
 from _functions import *
 from _locking import *
+from _context import *
 
 import _pycoder
 

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/_bridges.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/_bridges.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/_bridges.py	Tue Jan 13 05:37:10 2009
@@ -48,7 +48,7 @@
     BRIDGED_TYPES.append((FSSpec, FSSpec_to_struct))
 
 def _bridgePythonTypes():
-    # python TO Obj-C
+    # Python to Obj-C
     OC_PythonObject = lookUpClass('OC_PythonObject')
     try:
         if BRIDGED_TYPES:

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/__init__.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/__init__.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/__init__.py	Tue Jan 13 05:37:10 2009
@@ -1,52 +1,3 @@
-# Dummy file to make this directory a package.
-import unittest
-import objc
-import os
-import gc
-import subprocess
-
-# Have a way to disable the autorelease pool behaviour
-_usepool = not os.environ.get('PYOBJC_NO_AUTORELEASE')
-_useleaks = bool(os.environ.get('PyOBJC_USE_LEAKS'))
-_useleaks = False
-_leaksVerbose = False
-
-def leaks():
-    data = subprocess.Popen(
-            ['/usr/bin/leaks', str(os.getpid())], stdout=subprocess.PIPE
-        ).communicate()[0]
-    return data.splitlines()
-
-
-_poolclass = objc.lookUpClass('NSAutoreleasePool')
-class TestCase (unittest.TestCase):
-    """
-    A version of TestCase that wraps every test into its own
-    autorelease pool.
-    """
-    def run(self, *args):
-        if _useleaks:
-            leaksBefore = leaks()
-        if _usepool:
-            p = _poolclass.alloc().init()
-        else:
-            p = 1
-
-        try:
-            unittest.TestCase.run(self, *args)
-        finally:
-            gc.collect()
-            del p
-            gc.collect()
-            
-            if _useleaks:
-                leaksAfter = leaks()
-                if len(leaksBefore) != len(leaksAfter):
-                    print "\ntest %s is leaking [%d lines]"%(self, len(leaksAfter) - len(leaksBefore))
-                    if _leaksVerbose:
-                        # XXX: add a smartish filter the surpresses the leaks
-                        # in leaksBefore.
-                        for ln in leaksAfter:
-                            print ln
-
-main = unittest.main
+"""
+objc.test package - unittests for the pyobjc core
+"""

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_NULL.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_NULL.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_NULL.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 
 setSignature = objc.setSignatureForSelector
@@ -60,7 +60,7 @@
 
 from objc.test.NULL import *
 
-class TestNULL (objc.test.TestCase):
+class TestNULL (TestCase):
     def testNULL(self):
         self.assert_(hasattr(objc, 'NULL'))
         self.assertEquals(repr(objc.NULL), 'objc.NULL')
@@ -107,7 +107,7 @@
         return 441;
     callOut_ = objc.selector(callOut_, signature='v@:o^i')    
 
-class TestNULLArguments (objc.test.TestCase):
+class TestNULLArguments (TestCase):
     def testCallInOutNULL(self):
         obj = OCTestNULL.alloc().init()
 
@@ -229,4 +229,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_allocatebuffer.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_allocatebuffer.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_allocatebuffer.py	Tue Jan 13 05:37:10 2009
@@ -1,8 +1,8 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 
 import objc
 
-class TestAllocateBuffer(objc.test.TestCase):
+class TestAllocateBuffer(TestCase):
     def testBadLengths(self):
         self.assertRaises(ValueError, objc.allocateBuffer, 0)
         self.assertRaises(ValueError, objc.allocateBuffer, -1000)
@@ -23,5 +23,5 @@
                 raise
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()
     objc.recycleAutoreleasePool()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_archive_python.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_archive_python.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_archive_python.py	Tue Jan 13 05:37:10 2009
@@ -7,7 +7,7 @@
 
 import sys, copy_reg
 
-import objc.test
+from PyObjCTools.TestSupport import *
 
 from objc.test.fnd import NSArchiver, NSUnarchiver
 from objc.test.fnd import NSKeyedArchiver, NSKeyedUnarchiver
@@ -56,7 +56,7 @@
 
     # For some reason NSCoding support doesn't work on OSX 10.4 yet, ignore these
     # tests for now
-    class TestKeyedArchiveSimple (objc.test.TestCase):
+    class TestKeyedArchiveSimple (TestCase):
         def testBasicObjects(self):
             buf = NSKeyedArchiver.archivedDataWithRootObject_(a_function)
             self.assert_(isinstance(buf, NSData))
@@ -252,7 +252,7 @@
 
 
 
-    class TestKeyedArchivePlainPython (objc.test.TestCase, test.pickletester.AbstractPickleTests):
+    class TestKeyedArchivePlainPython (TestCase, test.pickletester.AbstractPickleTests):
         # Ensure that we don't run every test case three times
         def setUp(self):
             self._protocols = test.pickletester.protocols
@@ -397,7 +397,7 @@
     # Second set of tests: test if archiving a graph that
     # contains both python and objective-C objects works correctly.
     #
-    class TestKeyedArchiveMixedGraphs (objc.test.TestCase):
+    class TestKeyedArchiveMixedGraphs (TestCase):
         def dumps(self, arg, proto=0, fast=0):
             # Ignore proto and fast
             return NSKeyedArchiver.archivedDataWithRootObject_(arg)
@@ -438,8 +438,8 @@
     # And finally some tests to check if archiving of Python
     # subclasses of NSObject works correctly.
     #
-    class TestArchivePythonObjCSubclass (objc.test.TestCase):
+    class TestArchivePythonObjCSubclass (TestCase):
         pass
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_arrays.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_arrays.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_arrays.py	Tue Jan 13 05:37:10 2009
@@ -3,14 +3,14 @@
 
 This tests both calling such methods, as well as implementing methods with such arguments.
 """
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 import array
 from objc.test.arrays import *
 from objc.test.fnd import NSObject
 
 
-class TestArrayCalling (objc.test.TestCase):
+class TestArrayCalling (TestCase):
     def testArrayOfInts(self):
         o = OC_ArrayTest.alloc().init()
 
@@ -133,7 +133,7 @@
     ]
 )
 
-class TestArrayCallbacks (objc.test.TestCase):
+class TestArrayCallbacks (TestCase):
     def testCallArrayInt(self):
         class OC_TestArrayInt_In (NSObject):
             def arrayOf4Ints_(self, array):
@@ -178,4 +178,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_bundleFunctions.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_bundleFunctions.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_bundleFunctions.py	Tue Jan 13 05:37:10 2009
@@ -1,6 +1,6 @@
 import objc
 import objc.test.fnd as Foundation
-import objc.test
+from PyObjCTools.TestSupport import *
 import os
 
 NSObject = objc.lookUpClass('NSObject')
@@ -15,7 +15,7 @@
     ( u'NSClassFromString', S(objc._C_CLASS, objc._C_ID) ),
 ]
 
-class TestBundleFunctions (objc.test.TestCase):
+class TestBundleFunctions (TestCase):
     def setUp(self):
         self.bundle = Foundation.NSBundle.bundleForClass_(Foundation.NSBundle)
 
@@ -51,6 +51,6 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()
 
 

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_bundleVariables.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_bundleVariables.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_bundleVariables.py	Tue Jan 13 05:37:10 2009
@@ -1,8 +1,8 @@
 import objc
 import objc.test.fnd as Foundation
-import objc.test
+from PyObjCTools.TestSupport import *
 
-class TestBundleVariables (objc.test.TestCase):
+class TestBundleVariables (TestCase):
     def setUp(self):
         self.bundle = Foundation.NSBundle.bundleForClass_(Foundation.NSBundle)
 
@@ -34,6 +34,6 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()
 
 

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_classandinst.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_classandinst.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_classandinst.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 from objc.test.testclassandinst import PyObjC_TestClassAndInstance, PyObjC_TestUnallocatable
 
@@ -27,7 +27,7 @@
 #     def isInstance__inst__(self):
 #         return objc.NO
 
-class TestClassAndInstance(objc.test.TestCase):
+class TestClassAndInstance(TestCase):
     def testClassAndInstanceInstanceOverrideWorkaround(self):
         self.failIf(PyObjC_TestClassAndInstanceInstanceOverride.pyobjc_classMethods.isInstance())
         self.failIf(PyObjC_TestClassAndInstanceInstanceOverride.alloc().init().pyobjc_instanceMethods.isInstance())
@@ -76,4 +76,4 @@
         self.assertEquals(PyObjC_TestUnallocatable.alloc(), None)
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_clinmeth.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_clinmeth.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_clinmeth.py	Tue Jan 13 05:37:10 2009
@@ -1,11 +1,11 @@
 """
 Tests for accessing methods through classes and instances
 """
-import unittest
+from PyObjCTools.TestSupport import *
 from objc.test.clinmeth import *
 import objc
 
-class TestClassMethods (unittest.TestCase):
+class TestClassMethods (TestCase):
     # Some very basic tests that check that getattr on instances doesn't
     # return a class method and that getattr on classes prefers classmethods
     # over instance methods (and v.v. for getattr on instances)
@@ -37,7 +37,7 @@
         self.assertEquals(m(), 2)
 
 
-class TestInstanceMethods (unittest.TestCase):
+class TestInstanceMethods (TestCase):
     # Check that instance methods can be accessed through the instance, and 
     # also through the class when no class method of the same name is 
     # available.
@@ -58,7 +58,7 @@
 
         self.assertEquals(m(), 1)
 
-class TestSuper (unittest.TestCase):
+class TestSuper (TestCase):
     # Tests that check if super() behaves as expected (which is the most likely
     # reason for failure).
 
@@ -87,5 +87,5 @@
 
 
 if __name__ == "__main__":
-    unittest.main()
+    main()
 

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_conversion.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_conversion.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_conversion.py	Tue Jan 13 05:37:10 2009
@@ -3,7 +3,7 @@
 
 TODO: This only tests C values at the moment.
 """
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test.testbndl import pyObjCPy, carrayMaker
 from objc.test.testbndl import UCHAR_MAX
 from objc.test.testbndl import CHAR_MAX, CHAR_MIN
@@ -18,7 +18,7 @@
 import array, sys
 
 
-class TestNumbers (objc.test.TestCase):
+class TestNumbers (TestCase):
     """
     Test of conversion of numbers, especially boundary cases
     """
@@ -205,7 +205,7 @@
         self.assertRaises(ValueError, pyObjCPy, objc._C_FLT, "1")
 
 
-class TestStruct (objc.test.TestCase):
+class TestStruct (TestCase):
     """
     Structs are usually represented as tuples, but any sequence type is
     accepted as input, as long as it has the right number of elements
@@ -244,7 +244,7 @@
         self.assertEquals(inval, pyObjCPy(signature, iter(inval)))
         self.assertEquals(inval, pyObjCPy(signature, iter(list(inval))))
 
-class TestArray (objc.test.TestCase):
+class TestArray (TestCase):
     def test_simple(self):
         signature = '[10i]'
         value = tuple(range(10))
@@ -260,7 +260,7 @@
         self.assertRaises(ValueError, pyObjCPy, signature, iter(value[:9]))
         self.assertRaises(TypeError, pyObjCPy, signature, None)
 
-class TestCArray (objc.test.TestCase):
+class TestCArray (TestCase):
     # Tests for the PyObjC_PythonToCArray (C-)function, this function is
     # used to build variable-length C Arrays from Python objects.
 
@@ -433,7 +433,7 @@
 
 
 
-class PyOCTestTypeStr(objc.test.TestCase):
+class PyOCTestTypeStr(TestCase):
     #
     # Check that typestrings have the expected values.
     # We currently depend on these values in this file as wel as in the
@@ -472,4 +472,4 @@
         self.assertEquals(objc._C_INOUT, "N")
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_copying.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_copying.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_copying.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 
 NSObject = objc.lookUpClass("NSObject")
@@ -88,7 +88,7 @@
         other.z = "hello"
         return other
 
-class TestNSCopying (objc.test.TestCase):
+class TestNSCopying (TestCase):
     def testCopyingWithoutSuperFromObjC(self):
         v = OC_TestCopy1.alloc().init()
         self.assert_(not v.copyWithZone_.isClassMethod)
@@ -225,7 +225,7 @@
 NSMutableArray = objc.lookUpClass("NSMutableArray")
 import copy
 
-class TestPyCopyObjC (objc.test.TestCase):
+class TestPyCopyObjC (TestCase):
     # Testcases that ensure that copy.copy works
     # with Objective-C objects as well.
 
@@ -239,4 +239,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_corefoundation.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_corefoundation.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_corefoundation.py	Tue Jan 13 05:37:10 2009
@@ -2,7 +2,7 @@
 Testcases for the CoreFoundation wrappers introduced in 1.5
 """
 import objc
-import objc.test
+from PyObjCTools.TestSupport import *
 import re
 
 from objc.test.corefoundation import *
@@ -22,7 +22,7 @@
         "NSDate",
     )
 
-class TestCoreFoundation (objc.test.TestCase):
+class TestCoreFoundation (TestCase):
     def testTollFree(self):
         obj = OC_TestCoreFoundation.today()
 
@@ -94,6 +94,6 @@
         self.assert_( not hasattr( cftype, 'myMethod'))
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()
     
 

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_ctests.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_ctests.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_ctests.py	Tue Jan 13 05:37:10 2009
@@ -6,7 +6,8 @@
 the code in this file defines a class CTests that has the functions in the
 unitest.m file as its methods.
 """
-import objc.test, sys, platform
+import sys, platform
+from PyObjCTools.TestSupport import *
 from  objc.test import ctests
 
 names = [ x for x in dir (ctests) if not x.startswith('_') ]
@@ -46,7 +47,7 @@
 for n in names:
     methods['test_%s'%(n,)] = make_test(n)
 
-CTests = type(objc.test.TestCase)('CTests', (objc.test.TestCase,), methods)
+CTests = type(TestCase)('CTests', (TestCase,), methods)
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_dict_proxy.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_dict_proxy.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_dict_proxy.py	Tue Jan 13 05:37:10 2009
@@ -4,7 +4,7 @@
 NOTE: this file is very, very incomplete and just tests copying at the moment.
 """
 import sys
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSDictionary, NSMutableDictionary, NSPredicate, NSObject, NSNull
 from objc.test.pythonset import OC_TestSet
 import objc
@@ -15,7 +15,7 @@
 
 
 
-class TestMutableSequence (objc.test.TestCase):
+class TestMutableSequence (TestCase):
     mapClass = dict
 
     def testCopy(self):
@@ -51,4 +51,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_exceptions.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_exceptions.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_exceptions.py	Tue Jan 13 05:37:10 2009
@@ -5,9 +5,10 @@
 #
 from objc.test.exceptions import *
 
-import unittest, objc
+from PyObjCTools.TestSupport import *
+import objc
 
-class TestExceptionsFromObjC (unittest.TestCase):
+class TestExceptionsFromObjC (TestCase):
     def testSimple(self):
         o = PyObjCTestExceptions.alloc().init()
 
@@ -85,4 +86,4 @@
             self.assertEquals(e._pyobjc_exc_, u"thrown string")
 
 if __name__ == "__main__":
-    unittest.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_filepointer.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_filepointer.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_filepointer.py	Tue Jan 13 05:37:10 2009
@@ -1,11 +1,11 @@
 from objc.test.filepointer import OC_TestFilePointer
-import objc.test
+from PyObjCTools.TestSupport import *
 
 fp = open('/etc/passwd', 'r')
 gFirstPasswdLine = fp.readline()
 fp.close()
 
-class TestFilePointer (objc.test.TestCase):
+class TestFilePointer (TestCase):
     def testOpenInPython(self):
         fp = open('/etc/passwd', 'r')
         o = OC_TestFilePointer.new()
@@ -59,4 +59,4 @@
         self.assertEquals(fp.mode, 'a+')
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_identity.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_identity.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_identity.py	Tue Jan 13 05:37:10 2009
@@ -8,11 +8,12 @@
 #   to plists, ...)
 # - Implement the required functionality
 
-import objc.test, sys, os
+import sys, os
 import objc
 from objc.test.identity import *
+from PyObjCTools.TestSupport import *
 
-class TestPythonRoundTrip (objc.test.TestCase):
+class TestPythonRoundTrip (TestCase):
     # TODO: verify
 
     def testBasicPython(self):
@@ -51,7 +52,7 @@
             self.assert_(v is container.storedObject, repr(v))
 
 
-class ObjCRoundTrip (objc.test.TestCase):
+class ObjCRoundTrip (TestCase):
     # TODO: NSProxy
 
     def testNSObject(self):
@@ -148,7 +149,7 @@
         self.assert_(container.isSameObjectAsStored_(v), repr(v))
 
 
-class ObjCtoPython (objc.test.TestCase):
+class ObjCtoPython (TestCase):
     # TODO: NSProxy
 
     def assertFetchingTwice(self, container, message = None):
@@ -241,7 +242,7 @@
         container.setStoredObjectToResultOf_on_("zero", cls)
         self.assertFetchingTwice(container, "decimal")
 
-class PythonToObjC (objc.test.TestCase):
+class PythonToObjC (TestCase):
     # TODO: verify
 
     def testPlainObjects(self):
@@ -279,7 +280,7 @@
 
             self.assert_(container.isSameObjectAsStored_(v), repr(v))
 
-class TestSerializingDataStructures (objc.test.TestCase):
+class TestSerializingDataStructures (TestCase):
     # OC_Python{Array,Dictionary} used to contain specialized 
     # identity-preservation code. It is unclear why this was added, it might
     # have to do with writing data to plist files.
@@ -312,4 +313,4 @@
         
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_imp.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_imp.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_imp.py	Tue Jan 13 05:37:10 2009
@@ -1,10 +1,10 @@
 import objc
-import objc.test
+from PyObjCTools.TestSupport import *
 
 NSObject = objc.lookUpClass('NSObject')
 
 
-class TestBasicIMP (objc.test.TestCase):
+class TestBasicIMP (TestCase):
     # Test the basic functionality of IMP's. Imp's are basically unbound
     # selectors if you look at the interface. The implementation refers to
     # the actual functions that implements the method for calling the IMP
@@ -57,4 +57,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_initialized.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_initialized.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_initialized.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test.initialize import OC_TestInitialize
 
 class OC_TestInitializePython (OC_TestInitialize):
@@ -12,7 +12,7 @@
         OBJECT_LIST.append(self)
         return self
 
-class TestInitializing (objc.test.TestCase):
+class TestInitializing (TestCase):
     #
     # These tests make sure that we don't call retain/release on objects
     # that are not yet initialized.
@@ -80,4 +80,4 @@
         self.assertEquals(v, start)
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_ivar.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_ivar.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_ivar.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 
 import objc
 import sys
@@ -27,8 +27,8 @@
     doubleVar = objc.ivar('doubleVar', objc._C_DBL)
 
 
-class TestInstanceVariables(objc.test.TestCase):
-    if not hasattr(objc.test.TestCase, 'assertAlmostEquals'):
+class TestInstanceVariables(TestCase):
+    if not hasattr(TestCase, 'assertAlmostEquals'):
         def assertAlmostEquals(self, val1, val2):
             self.assert_(abs(val1 - val2) < 0.000001)
 
@@ -105,7 +105,7 @@
         self.assertRaises(TypeError, delattr, self.object.idVar)
 
 
-class TestAllInstanceVariables (objc.test.TestCase):
+class TestAllInstanceVariables (TestCase):
     # Some tests for accessing any instance variable, even those not 
     # declared in python.
 
@@ -236,4 +236,4 @@
     
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_keyvalue.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_keyvalue.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_keyvalue.py	Tue Jan 13 05:37:10 2009
@@ -5,7 +5,7 @@
 in PyObjCTools.test.test_keyvalue and Foundation.test.test_keyvalue.
 """
 import objc
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import *
 
 
@@ -68,7 +68,7 @@
 
     roprop = property(lambda self: u"read-only")
 
-class PyKeyValueCoding (objc.test.TestCase):
+class PyKeyValueCoding (TestCase):
     def testNoPrivateVars(self):
         # Private instance variables ('anObject.__value') are not accessible using
         # key-value coding.
@@ -238,7 +238,7 @@
         self.assertEquals(o.multiple.level2.level3.keyB, 9.999)
 
 
-class TestAccMethod (objc.test.TestCase):
+class TestAccMethod (TestCase):
     def testStrCap(self):
         class Foo:
             def callme(self):
@@ -285,22 +285,22 @@
         self.assertEquals(IndirectNumber,
             STUB.keyValue_forObject_key_(DO_VALUEFORKEYPATH, self.path, u"indirectHead.indirectNumber"))
 
-class TestObjCKVCoding(AbstractKVCodingTest, objc.test.TestCase):
+class TestObjCKVCoding(AbstractKVCodingTest, TestCase):
     def setUp(self):
         self.base = PyObjCTest_KVBaseClass.new()
         self.path = PyObjCTest_KVPathClass.new()
 
-class TestPythonKVCoding(AbstractKVCodingTest, objc.test.TestCase):
+class TestPythonKVCoding(AbstractKVCodingTest, TestCase):
     def setUp(self):
         self.base = KVPyBase()
         self.path = KVPyPath()
 
-class TestPythonSubObjCContainerCoding(AbstractKVCodingTest, objc.test.TestCase):
+class TestPythonSubObjCContainerCoding(AbstractKVCodingTest, TestCase):
     def setUp(self):
         self.base = KVPySubObjCBase.new()
         self.path = KVPySubObjCPath.new()
 
-class TestPythonSubOverObjC(AbstractKVCodingTest, objc.test.TestCase):
+class TestPythonSubOverObjC(AbstractKVCodingTest, TestCase):
     def setUp(self):
         self.base = KVPySubOverObjCBase.new()
         self.path = KVPySubOverObjCPath.new()
@@ -329,7 +329,7 @@
     # MacOS X 10.3 and later use 'setValue:forKey: u' instead of
     # 'takeValue:forKey: u', test these as wel.
 
-    class PyKeyValueCoding_10_3 (objc.test.TestCase):
+    class PyKeyValueCoding_10_3 (TestCase):
         def testPythonConvention(self):
             o = KeyValueClass2()
 
@@ -424,7 +424,7 @@
         return u"Hello world"
 
 if PyObjCTest_KeyValueObserver is not None:
-    class TestKeyValueObservingFromNative (objc.test.TestCase):
+    class TestKeyValueObservingFromNative (TestCase):
         # This test makes uses of Key-Value Coding/Observing from Objective-C.
         # Versions of PyObjC upto 2003-12-29 crashed on this test due to the way
         # key-value observing is implemented in Cocoa.
@@ -490,7 +490,7 @@
             global DEALLOCS
             DEALLOCS += 1
 
-    class TestKeyValueObservingFromPython (objc.test.TestCase):
+    class TestKeyValueObservingFromPython (TestCase):
         # Check for using KVO in python.
 
         def testAutomaticObserving(self):
@@ -644,4 +644,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_leaks.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_leaks.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_leaks.py	Tue Jan 13 05:37:10 2009
@@ -1,7 +1,7 @@
 """
 Check if we manage retainCounts correctly.
 """
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 from objc.test.fnd import *
 
@@ -32,7 +32,7 @@
         self.slot1 = LeaksClass.alloc().init()
         return self
 
-class TestRetains(objc.test.TestCase):
+class TestRetains(TestCase):
     def testPyClass(self):
 
         global LeaksDel
@@ -107,4 +107,4 @@
 
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_list_proxy.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_list_proxy.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_list_proxy.py	Tue Jan 13 05:37:10 2009
@@ -4,7 +4,7 @@
 NOTE: this file is very, very incomplete and just tests copying at the moment.
 """
 import sys
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSArray, NSMutableArray, NSPredicate, NSObject, NSNull
 from objc.test.pythonset import OC_TestSet
 import objc
@@ -37,7 +37,7 @@
 
 
 
-class TestImmutableSequence (objc.test.TestCase, BasicSequenceTests):
+class TestImmutableSequence (TestCase, BasicSequenceTests):
     seqClass = tuple
 
     def testCopy(self):
@@ -56,7 +56,7 @@
                 OC_TestSet.set_addObject_, o, 4)
 
 
-class TestMutableSequence (objc.test.TestCase, BasicSequenceTests):
+class TestMutableSequence (TestCase, BasicSequenceTests):
     seqClass = list
 
     def testCopy(self):
@@ -74,4 +74,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_locking.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_locking.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_locking.py	Tue Jan 13 05:37:10 2009
@@ -5,7 +5,7 @@
 locking doesn't actually lock. It should be possible to find a faster mechanism for this.
 """
 import sys
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 import threading
 import time
@@ -76,7 +76,7 @@
     def appendToList_(self, value):
         self.list.append(value)
 
-class TestLockingBasic (objc.test.TestCase):
+class TestLockingBasic (TestCase):
 
     def testBasicLocking(self):
         lst = []
@@ -133,7 +133,7 @@
     # a compile error on earlier editions of python, hence and ugly exec statement.
     exec """
 from __future__ import with_statement
-class TestLockingWithStatement (objc.test.TestCase):
+class TestLockingWithStatement (TestCase):
 
     def testBasicLocking(self):
         lst = []
@@ -161,4 +161,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata.py	Tue Jan 13 05:37:10 2009
@@ -10,7 +10,7 @@
 - Probably need special-casing for arrays (numarray and array.array)!
 """
 import objc
-import objc.test
+from PyObjCTools.TestSupport import *
 import warnings
 import array
 
@@ -343,11 +343,11 @@
 
 setupMetaData()
 
-class TestArrayDefault (objc.test.TestCase):
+class TestArrayDefault (TestCase):
     # TODO: what is the default anyway?
     pass
 
-class TestArraysOut (objc.test.TestCase):
+class TestArraysOut (TestCase):
     def testFixedSize(self):
         o = OC_MetaDataTest.new()
 
@@ -434,7 +434,7 @@
         self.assertEquals(list(v),  [10, 11])
 
 
-class TestArraysInOut (objc.test.TestCase):
+class TestArraysInOut (TestCase):
     def testFixedSize(self):
         o = OC_MetaDataTest.new()
 
@@ -545,7 +545,7 @@
         self.assertEquals(len(v), 2)
         self.assertEquals(list(v),  [4, 3])
 
-class TestArraysIn (objc.test.TestCase):
+class TestArraysIn (TestCase):
     def testFixedSize(self):
         o = OC_MetaDataTest.new()
 
@@ -628,7 +628,7 @@
         self.assertRaises(ValueError, o.makeIntArray_count_, a, 21)
 
 
-class TestArrayReturns (objc.test.TestCase):
+class TestArrayReturns (TestCase):
     # TODO:
     # - Add null-terminated arrays of various supported types:
     #   -> integers
@@ -673,7 +673,7 @@
         v = o.nullStringArray()
         self.assertEquals(v, objc.NULL)
 
-class TestByReference (objc.test.TestCase):
+class TestByReference (TestCase):
     # Pass by reference arguments. 
     # Note that these tests aren't exhaustive, we have test_methods and
     # test_methods2 for that :-)
@@ -762,7 +762,7 @@
         self.assertEquals(y, 43)
         self.assertEquals(z, objc.NULL)
 
-class TestPrintfFormat (objc.test.TestCase):
+class TestPrintfFormat (TestCase):
     def test_nsformat(self):
         o = OC_MetaDataTest.new()
 
@@ -890,20 +890,20 @@
             self.assertEquals(list(v), [ fmt, fmt%args ])
 
 
-class TestVariadic (objc.test.TestCase):
+class TestVariadic (TestCase):
     def testRaises(self):
         o = OC_MetaDataTest.new()
 
         self.assertRaises(TypeError, o.varargsMethodWithObjects_, 1)
         self.assertRaises(TypeError, o.varargsMethodWithObjects_, 1, 2, 3)
 
-class TestIgnore (objc.test.TestCase):
+class TestIgnore (TestCase):
     def testRaises(self):
         o = OC_MetaDataTest.new()
 
         self.assertRaises(TypeError, o.ignoreMethod)
 
-class TestMetaDataAccess (objc.test.TestCase):
+class TestMetaDataAccess (TestCase):
     def testSuggestions(self):
         meta = OC_MetaDataTest.varargsMethodWithObjects_.__metadata__()
         self.assert_(isinstance(meta, dict))
@@ -967,7 +967,7 @@
         self.assertEquals(meta['classmethod'], False)
 
 
-class TestBuffers (objc.test.TestCase):
+class TestBuffers (TestCase):
     # Some tests that check if buffer APIs get sane treatment
 
     def testInChars(self):
@@ -1078,7 +1078,7 @@
         self.assertEquals(str(buffer(v)), '\xab'*44);
         self.assert_(v is a)
 
-class TestVariableLengthValue (objc.test.TestCase):
+class TestVariableLengthValue (TestCase):
 
     def testResult(self):
         o = OC_MetaDataTest.alloc().init()
@@ -1114,7 +1114,7 @@
 
         # XXX: Hard crash when using o.makeVariableLengthArray_halfCount_???
 
-class TestVariadicArray (objc.test.TestCase):
+class TestVariadicArray (TestCase):
     def testObjects(self):
         o = OC_MetaDataTest.alloc().init()
 
@@ -1131,4 +1131,4 @@
         self.assertEquals(v, list(range(40)))
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_function.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_function.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_function.py	Tue Jan 13 05:37:10 2009
@@ -4,7 +4,7 @@
 These tests are for global function
 """
 import objc
-import objc.test
+from PyObjCTools.TestSupport import *
 import warnings
 
 from objc.test.metadatafunction import *
@@ -253,16 +253,16 @@
 
 objc._loadFunctionList(function_list, globals(),  _FunctionTable, False)
 
-class TestExists (objc.test.TestCase):
+class TestExists (TestCase):
     def testFunctionsExists(self):
         for item in _FunctionTable:
             self.assert_( item[0] in globals() )
 
-class TestArrayDefault (objc.test.TestCase):
+class TestArrayDefault (TestCase):
     # TODO: what is the default anyway?
     pass
 
-class TestArraysOut (objc.test.TestCase):
+class TestArraysOut (TestCase):
     def testFixedSize(self):
         v = fill4Tuple_(None)
         self.assertEquals(list(v), [0, -1, -8, -27])
@@ -329,7 +329,7 @@
         self.assertEquals(list(v),  [10, 11])
 
 
-class TestArraysInOut (objc.test.TestCase):
+class TestArraysInOut (TestCase):
     def testFixedSize(self):
 
         a = (1,2,3,4)
@@ -415,7 +415,7 @@
         self.assertEquals(len(v), 2)
         self.assertEquals(list(v),  [4, 3])
 
-class TestArraysIn (objc.test.TestCase):
+class TestArraysIn (TestCase):
     def testFixedSize(self):
 
         v = make4Tuple_((1.0, 4.0, 8.0, 12.5))
@@ -484,7 +484,7 @@
         self.assertEquals(len(v), 4)
         self.assertEquals(list(v), [1,2,3,4])
 
-class TestArrayReturns (objc.test.TestCase):
+class TestArrayReturns (TestCase):
     # TODO:
     # - Add null-terminated arrays of various supported types:
     #   -> integers
@@ -526,7 +526,7 @@
         v = nullStringArray()
         self.assertEquals(v, objc.NULL)
 
-class TestByReference (objc.test.TestCase):
+class TestByReference (TestCase):
     # Pass by reference arguments. 
     # Note that these tests aren't exhaustive, we have test_methods and
     # test_methods2 for that :-)
@@ -605,7 +605,7 @@
         self.assertEquals(y, 43)
         self.assertEquals(z, objc.NULL)
 
-class TestPrintfFormat (objc.test.TestCase):
+class TestPrintfFormat (TestCase):
     def test_nsformat(self):
 
         v = makeArrayWithFormat_("%3d", 10)
@@ -623,4 +623,4 @@
         self.assertEquals(list(v), [ "hello %s", "hello world"])
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_imp.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_imp.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_imp.py	Tue Jan 13 05:37:10 2009
@@ -10,18 +10,18 @@
 - Probably need special-casing for arrays (numarray and array.array)!
 """
 import objc
-import objc.test
+from PyObjCTools.TestSupport import *
 
 from objc.test.metadata import *
 import objc.test.test_metadata # to get the right metadata
 import warnings
 
 
-class TestArrayDefault (objc.test.TestCase):
+class TestArrayDefault (TestCase):
     # TODO: what is the default anyway?
     pass
 
-class TestArraysOut (objc.test.TestCase):
+class TestArraysOut (TestCase):
     def testFixedSize(self):
         o = OC_MetaDataTest.new()
         m = o.methodForSelector_('fill4Tuple:')
@@ -108,7 +108,7 @@
 
 
 
-class TestArraysInOut (objc.test.TestCase):
+class TestArraysInOut (TestCase):
     def testFixedSize(self):
         o = OC_MetaDataTest.new()
         m = o.methodForSelector_('reverse4Tuple:')
@@ -206,7 +206,7 @@
         self.assertEquals(len(v), 2)
         self.assertEquals(list(v),  [4, 3])
 
-class TestArraysIn (objc.test.TestCase):
+class TestArraysIn (TestCase):
     def testFixedSize(self):
         o = OC_MetaDataTest.new()
         m = o.methodForSelector_('make4Tuple:')
@@ -290,7 +290,7 @@
         self.assertEquals(len(v), 4)
         self.assertEquals(list(v), [1,2,3,4])
 
-class TestArrayReturns (objc.test.TestCase):
+class TestArrayReturns (TestCase):
     # TODO:
     # - Add null-terminated arrays of various supported types:
     #   -> integers
@@ -342,7 +342,7 @@
         v = m(o)
         self.assertEquals(v, objc.NULL)
 
-class TestByReference (objc.test.TestCase):
+class TestByReference (TestCase):
     # Pass by reference arguments. 
     # Note that these tests aren't exhaustive, we have test_methods and
     # test_methods2 for that :-)
@@ -440,4 +440,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_py.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_py.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_py.py	Tue Jan 13 05:37:10 2009
@@ -10,7 +10,7 @@
 - Probably need special-casing for arrays (numarray and array.array)!
 """
 import objc
-import objc.test
+from PyObjCTools.TestSupport import *
 import warnings
 
 from objc.test.metadata import *
@@ -441,11 +441,11 @@
         elif z is objc.NULL:
             return [x, y, z], 15, 16
 
-class TestArrayDefault (objc.test.TestCase):
+class TestArrayDefault (TestCase):
     # TODO: what is the default anyway?
     pass
 
-class TestArraysOut (objc.test.TestCase):
+class TestArraysOut (TestCase):
     def testFixedSize(self):
         o = Py_MetaDataTest_AllArgs.new()
 
@@ -518,7 +518,7 @@
         self.assertEquals(c, 2)
         self.assertEquals(list(v),  [0, 1])
 
-class TestArraysInOut (objc.test.TestCase):
+class TestArraysInOut (TestCase):
     def testFixedSize(self):
         o = Py_MetaDataTest_AllArgs.new()
 
@@ -608,7 +608,7 @@
         self.assertEquals(len(v), 2)
         self.assertEquals(list(v),  [45, 51])
 
-class TestArraysIn (objc.test.TestCase):
+class TestArraysIn (TestCase):
     def testFixedSize(self):
         o = Py_MetaDataTest_AllArgs.new()
 
@@ -680,7 +680,7 @@
         self.assertEquals(len(v), 4)
         self.assertEquals(list(v), [1,2,3,4])
 
-class TestArrayReturns (objc.test.TestCase):
+class TestArrayReturns (TestCase):
     # TODO:
     # - Add null-terminated arrays of various supported types:
     #   -> integers
@@ -718,7 +718,7 @@
         v = OC_MetaDataTest.nullStringArrayOn_(o)
         self.assertEquals(v, objc.NULL)
 
-class TestByReference (objc.test.TestCase):
+class TestByReference (TestCase):
     # Pass by reference arguments. 
     # Note that these tests aren't exhaustive, we have test_methods and
     # test_methods2 for that :-)
@@ -809,4 +809,4 @@
         self.assertEquals(z, objc.NULL)
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_py2py.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_py2py.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_metadata_py2py.py	Tue Jan 13 05:37:10 2009
@@ -13,7 +13,7 @@
 - Probably need special-casing for arrays (numarray and array.array)!
 """
 import objc
-import objc.test
+from PyObjCTools.TestSupport import *
 
 from objc.test.metadata import *
 
@@ -24,7 +24,7 @@
 if 0:
     from objc.test.test_metadata_py2 import Py_MetaDataTest_OutputOptional
 
-class TestArraysOut_AllArgs (objc.test.TestCase):
+class TestArraysOut_AllArgs (TestCase):
     def testFixedSize(self):
         o = Py_MetaDataTest_AllArgs.new()
 
@@ -105,7 +105,7 @@
         self.assertEquals(list(v),  [0, 1])
 
 if 0:
-    class TestArraysOut_OutputOptional (objc.test.TestCase):
+    class TestArraysOut_OutputOptional (TestCase):
         def testFixedSize(self):
             o = Py_MetaDataTest_OutputOptional.new()
 
@@ -185,7 +185,7 @@
             self.assertEquals(c, 2)
             self.assertEquals(list(v),  [0, 1])
 
-class TestArraysInOut_AllArgs (objc.test.TestCase):
+class TestArraysInOut_AllArgs (TestCase):
     def testFixedSize(self):
         o = Py_MetaDataTest_AllArgs.new()
 
@@ -281,7 +281,7 @@
         self.assertEquals(len(v), 2)
         self.assertEquals(list(v),  [45, 51])
 
-class TestArraysIn_AllArgs (objc.test.TestCase):
+class TestArraysIn_AllArgs (TestCase):
     def testFixedSize(self):
         o = Py_MetaDataTest_AllArgs.new()
 
@@ -361,7 +361,7 @@
         self.assertEquals(len(v), 4)
         self.assertEquals(list(v), [1,2,3,4])
 
-class TestArrayReturns_AllArgs (objc.test.TestCase):
+class TestArrayReturns_AllArgs (TestCase):
     # TODO:
     # - Add null-terminated arrays of various supported types:
     #   -> integers
@@ -399,7 +399,7 @@
         v = o.nullStringArray()
         self.assertEquals(v, objc.NULL)
 
-class TestByReference_AllArgs (objc.test.TestCase):
+class TestByReference_AllArgs (TestCase):
     # Pass by reference arguments. 
     # Note that these tests aren't exhaustive, we have test_methods and
     # test_methods2 for that :-)
@@ -491,4 +491,4 @@
         self.assertEquals(z, 16) # , objc.NULL)
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_method_prototypes.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_method_prototypes.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_method_prototypes.py	Tue Jan 13 05:37:10 2009
@@ -11,10 +11,10 @@
         o.myMethod_() # should also work, arg == 1
 """
 
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSObject
 
-class TestInheritedProtoype (objc.test.TestCase):
+class TestInheritedProtoype (TestCase):
     # 
     # These tests check for methods that are inherited from a superclass and
     # therefore have an explict method signature. The number of arguments in
@@ -194,7 +194,7 @@
         except objc.BadPrototypeError:
             pass
 
-class TestExplicitPrototype (objc.test.TestCase):
+class TestExplicitPrototype (TestCase):
     # 
     # These tests check for methods with an explict method signature in the
     # python code (not inheritted). The python code should match the provided
@@ -369,7 +369,7 @@
         except objc.BadPrototypeError:
             pass
 
-class TestImplicitSignature (objc.test.TestCase):
+class TestImplicitSignature (TestCase):
     # 
     # These tests check for methods that aren't inheritted and don't have
     # an explicit prototype either
@@ -516,4 +516,4 @@
         self.assertEquals(OC_ImplProto_Variations.methodWithArg_.signature, "v@:@")
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methodaccess.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methodaccess.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methodaccess.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 import sys
 
@@ -8,7 +8,7 @@
 
 
 
-class MethodAccessTest (objc.test.TestCase):
+class MethodAccessTest (TestCase):
 
     def testObjCObject(self):
         # Trying to access the methods of objc.objc_object should not
@@ -68,10 +68,10 @@
 
         self.assert_(hasattr(NSObject.pyobjc_classMethods, "alloc"))
 
-class ClassAndInstanceMethods(objc.test.TestCase):
+class ClassAndInstanceMethods(TestCase):
     def testClassThroughInstance(self):
         # Class methods are not accessible through instances.
         self.assertRaises(AttributeError, getattr, NSObject.new(), 'alloc')
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methodedits.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methodedits.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methodedits.py	Tue Jan 13 05:37:10 2009
@@ -1,6 +1,6 @@
 # FIXME: This test suite seems to polute it's environment, other tests fail
 # when this test suite is active!
-import objc.test
+from PyObjCTools.TestSupport import *
 import sys
 
 import objc
@@ -39,7 +39,7 @@
     def purePythonMethod(self):
         return u"<pure-py>"
 
-class TestFromObjCSuperToObjCClass(objc.test.TestCase):
+class TestFromObjCSuperToObjCClass(TestCase):
     def testBasicBehavior(self):
         anInstance = Methods.new()
         self.assertEquals(anInstance.description(), u"<methods>")
@@ -124,7 +124,7 @@
 
 
 
-class TestFromPythonClassToObjCClass(objc.test.TestCase):
+class TestFromPythonClassToObjCClass(TestCase):
 
     def testPythonSourcedMethods(self):
         # 20031227, Ronald: Assigning the methods works alright, but actually
@@ -185,7 +185,7 @@
 
 
 
-class TestClassAsignments (objc.test.TestCase):
+class TestClassAsignments (TestCase):
     def testAssignAMethod(self):
         MEClass.doSomethingElse = lambda self: 2*2
         MEClass.doDuplicate_ = lambda self, x: 2*x
@@ -217,7 +217,7 @@
         self.assertRaises(AttributeError, delattr, theClass, 'alloc')
         self.assertRaises(AttributeError, delattr, theClass, 'init')
 
-class TestCategory (objc.test.TestCase):
+class TestCategory (TestCase):
     # Tests of objc.Category
 
     def testPyClassCategory(self):
@@ -316,4 +316,4 @@
 
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methods.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methods.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methods.py	Tue Jan 13 05:37:10 2009
@@ -33,7 +33,7 @@
 - See also testbndl.m, the implementation there must be synchronized
   with this file.
 """
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 import sys
 import struct
@@ -98,7 +98,7 @@
     return struct.unpack('f',struct.pack('f', value))[0]
 
 
-class PyOCTestSimpleReturns(objc.test.TestCase):
+class PyOCTestSimpleReturns(TestCase):
     #
     # Test returns of simple types from instance and classs methods
     #
@@ -323,7 +323,7 @@
         self.assertEquals(obj.dummy2Func(), ((1,2,3,4),))
 
 
-class PyOCTestSimpleArguments(objc.test.TestCase):
+class PyOCTestSimpleArguments(TestCase):
     #
     # Test argument passing of single basic values.
     #
@@ -499,7 +499,7 @@
         self.assertRaises(ValueError, self.obj.dummy2Arg_, ((8,6,4,2,1),))
 
 
-class PyOCTestByReferenceArguments(objc.test.TestCase):
+class PyOCTestByReferenceArguments(TestCase):
     #
     # Test argument passing of single basic values by reference.
     #
@@ -900,7 +900,7 @@
     doubleArg_ = objc.selector(doubleArg_, signature=OC_TestClass1.doubleArg_.signature)
 
 
-class OCPyTestSimpleCalls(objc.test.TestCase):
+class OCPyTestSimpleCalls(TestCase):
     #
     # Test argument passing of single basic values by reference.
     #
@@ -1235,7 +1235,7 @@
         for o in POINTS:
             self.assertEquals(self.obj.invokeInstanceNSPointFuncOf_(self.ocobj), o)
 
-class OCPyTestSimpleArguments(objc.test.TestCase):
+class OCPyTestSimpleArguments(TestCase):
     #
     # Test argument passing of single basic values.
     #
@@ -1261,4 +1261,4 @@
         self.assertEquals(self.obj.invokeInstanceLongLongArg_on_(-(1L << 60), self.ocobj), -(1L << 61))
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methods2.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methods2.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_methods2.py	Tue Jan 13 05:37:10 2009
@@ -1,13 +1,4 @@
-'''
-          THIS IS A GENERATED FILE DO NOT EDIT
-
-          Generated by: Scripts/gen_test_methods.py
-
-This file tests method calling to and from Objective-C. See testbndl.m for
-the Objective-C helper classes used in theses tests.
-
-'''
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 from objc import YES, NO, nil
 from objc.test.fnd import NSPriorDayDesignations
@@ -279,16 +270,6 @@
 
 from objc.test.testbndl2 import *
 
-if hasattr(objc.test.TestCase, 'assertAlmostEquals'):
-    TestCase = objc.test.TestCase
-else:
-    # We use assertAlmostEquals for comparing floats, python 2.2 doesn't
-    # have this method in unittest.TestCase.
-
-    class TestCase (objc.test.TestCase):
-        def assertAlmostEquals(self, val1, val2, message=None):
-            self.assert_ (abs (val1 - val2) < 0.00001, message)
-
 class PyToObjC (TestCase):
 	# Test calling Objective-C from Python
 	# Simple returns from class methods
@@ -57969,4 +57950,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_nsdate_proxy.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_nsdate_proxy.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_nsdate_proxy.py	Tue Jan 13 05:37:10 2009
@@ -1,8 +1,8 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSDateFormatter, NSArray, NSDate
 import datetime
 
-class TestNSDateProxy (objc.test.TestCase):
+class TestNSDateProxy (TestCase):
     # Test for proxied datetime.date and datetime.datetime objects,
     # these have a custom proxy class.
 
@@ -34,4 +34,4 @@
 
         
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_number_proxy.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_number_proxy.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_number_proxy.py	Tue Jan 13 05:37:10 2009
@@ -5,7 +5,7 @@
 the Foundation bindings :-(
 """
 import sys, os
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSNumber, NSNumberFormatter
 from objc.test.pythonnumber import OC_TestNumber
 import objc
@@ -17,7 +17,7 @@
 NSOrderedSame = 0
 NSOrderedDescending = 1
 
-class TestNSNumber (objc.test.TestCase):
+class TestNSNumber (TestCase):
     # These testcases check the behaviour of NSNumber, these
     # are mostly here to verify that NSNumbers behave as
     # we expect them to.
@@ -190,7 +190,7 @@
         self.assertEquals(v, u"264")
 
 
-class TestPyNumber (objc.test.TestCase):
+class TestPyNumber (TestCase):
     # Basic tests of the proxy methods
 
     def testClasses(self):
@@ -426,7 +426,7 @@
         self.assert_(isinstance(v, unicode))
         self.assertEquals(v, u"True")
 
-class TestInteractions (objc.test.TestCase):
+class TestInteractions (TestCase):
     # Test interactions between Python and NSNumber numbers
 
     def testMixedCompare(self):
@@ -471,7 +471,7 @@
         self.assert_(not OC_TestNumber.number_isEqualTo_(NSNumber.numberWithFloat_(0), 42))
 
 
-class TestNumberFormatter (objc.test.TestCase):
+class TestNumberFormatter (TestCase):
     # Test behaviour of an NSNumberFormatter, both with 
     # Python numbers and NSNumbers
     def testFormatting(self):
@@ -491,4 +491,4 @@
         self.assertEquals(formatter.stringForObjectValue_(n), formatter.stringForObjectValue_(p))
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_objc.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_objc.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_objc.py	Tue Jan 13 05:37:10 2009
@@ -1,12 +1,11 @@
-import objc.test
-
+from PyObjCTools.TestSupport import *
 import objc
 from objc.test.testbndl import PyObjC_TestClass4
 import fnd as Foundation
 from objc.test.fnd import NSObject, NSArray, NSAttributedString
 
 
-class TestConstants(objc.test.TestCase):
+class TestConstants(TestCase):
     def testBooleans(self):
         self.assert_(objc.YES, "YES was not true.")
         self.assert_(not objc.NO, "NO was true.")
@@ -16,7 +15,7 @@
         self.assert_(not objc.nil, "nil is not nil/None.")
 
 
-class TestObjCRuntime (objc.test.TestCase):
+class TestObjCRuntime (TestCase):
     # Tests for objc.runtime
     def setUp(self):
         import warnings
@@ -42,7 +41,7 @@
                           "objc.runtime.NSObject and objc.lookUpClass('NSObject') were different.")
 
 
-class TestClassLookup(objc.test.TestCase):
+class TestClassLookup(TestCase):
     def testLookupClassNoSuchClassErrorRaised(self):
         self.assertRaises(objc.nosuchclass_error, objc.lookUpClass, "")
         self.assertRaises(objc.nosuchclass_error, objc.lookUpClass, "ThisClassReallyShouldNotExist")
@@ -61,7 +60,7 @@
         self.assert_(NSException in objc.getClassList(), "getClassList() does not appear to contain NSException class")
         self.assert_(NSMutableArray in objc.getClassList(), "getClassList() does not appear to contain NSMutableArray class")
 
-class TestMethodInvocation(objc.test.TestCase):
+class TestMethodInvocation(TestCase):
     def setUp(self):
         self.NSObjectInstance = NSObject.alloc().init()
 
@@ -75,11 +74,11 @@
         self.assertEqual(self.NSObjectInstance.pyobjc_instanceMethods.self(), self.NSObjectInstance.self())
         self.assertEqual(type(self.NSObjectInstance).pyobjc_instanceMethods.self(self.NSObjectInstance), self.NSObjectInstance.self())
 
-class TestClassDict(objc.test.TestCase):
+class TestClassDict(TestCase):
     def testDict(self):
         self.assert_("attributesAtIndex_longestEffectiveRange_inRange_" in NSAttributedString.__dict__)
 
-class TestPickle(objc.test.TestCase):
+class TestPickle(TestCase):
     # We don't support pickling at the moment, make sure we enforce that.
 
     def testPicklePure(self):
@@ -99,7 +98,7 @@
         self.assertRaises((TypeError, ValueError), pickle.dumps, o, 2)
 
 
-class TestDescription (objc.test.TestCase):
+class TestDescription (TestCase):
     def testSimple(self):
         TESTS   = [u'a'], u'hello', 2
         a = NSArray.arrayWithArray_([u'a'])
@@ -109,4 +108,4 @@
             self.assertEquals(expect, PyObjC_TestClass4.fetchObjectDescription_(obj))
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_opaque.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_opaque.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_opaque.py	Tue Jan 13 05:37:10 2009
@@ -1,8 +1,8 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 from objc.test.opaque import *
 
-class TestFromPython (objc.test.TestCase):
+class TestFromPython (TestCase):
     def testBasic (self):
         tp = objc.createOpaquePointerType(
                 "BarHandle", BarEncoded, "BarHandle doc")
@@ -20,7 +20,7 @@
         self.assertEquals(OC_OpaqueTest.nullBar(), None)
 
 
-class TestFromC (objc.test.TestCase):
+class TestFromC (TestCase):
     def testMutable(self):
         self.assert_( isinstance(FooHandle, type) )
 
@@ -68,4 +68,4 @@
         self.assertEquals(f.__pointer__, g.__pointer__)
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_outputinitializer.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_outputinitializer.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_outputinitializer.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 from objc.test.testoutputinitializer import PyObjC_TestOutputInitializer
 
@@ -6,11 +6,11 @@
         "initWithBooleanOutput:", dict(arguments={
             2: dict(type_modifier='o')}))
 
-class TestOutputInitializer(objc.test.TestCase):
+class TestOutputInitializer(TestCase):
     def testOutputInitializer(self):
         robj, rtrue = PyObjC_TestOutputInitializer.alloc().initWithBooleanOutput_(None)
         self.assertEquals(rtrue, objc.YES)
         self.assertEquals(robj.isInitialized(), objc.YES)
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_pickle.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_pickle.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_pickle.py	Tue Jan 13 05:37:10 2009
@@ -1,11 +1,11 @@
 from objc.test.fnd import NSNumber
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc._pythonify import OC_PythonInt, OC_PythonFloat, OC_PythonLong
 import pickle
 import cPickle
 import sys
 
-class TestPickleNumber (objc.test.TestCase):
+class TestPickleNumber (TestCase):
 
     def testPickleInt(self):
         v = NSNumber.numberWithInt_(42)
@@ -68,4 +68,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_pickling_objc.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_pickling_objc.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_pickling_objc.py	Tue Jan 13 05:37:10 2009
@@ -2,24 +2,24 @@
 Test cases for testing if it is possible to pickle
 Objective-C objects
 """
-import objc.test
+from PyObjCTools.TestSupport import *
 
 
 # Test cases for pickling ObjC objects 
-class TestPickleObjC (objc.test.TestCase):
+class TestPickleObjC (TestCase):
     pass
 
 
 # Test cases for pickling mixed Python/ObjC 
 # object graphs
-class TestPickleMixedGraph (objc.test.TestCase):
+class TestPickleMixedGraph (TestCase):
     pass
 
 
 # Test cases for pickling Python subclasses
 # of NSObject
-class TestPicklePythonNSObject (objc.test.TestCase):
+class TestPicklePythonNSObject (TestCase):
     pass
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_posing.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_posing.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_posing.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 import sys
 
@@ -17,7 +17,7 @@
     pass
 
 else:
-    class TestPosing(objc.test.TestCase):
+    class TestPosing(TestCase):
         def testPosing(self):
 
             class PoseClass(BaseClass):
@@ -43,4 +43,4 @@
 
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protected.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protected.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protected.py	Tue Jan 13 05:37:10 2009
@@ -1,7 +1,7 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test.protected import *
 
-class TestProtected (objc.test.TestCase):
+class TestProtected (TestCase):
     def testProtectedNotInDir(self):
 
         d = dir(PyObjCTest_Protected)

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protocol.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protocol.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protocol.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 import warnings
 import sys
@@ -18,7 +18,7 @@
     objc.selector(None, selector="testMethod2:", signature="v@:i", isRequired=0)
 ))
 
-class TestInformalProtocols(objc.test.TestCase):
+class TestInformalProtocols(TestCase):
 
 
     def testMissingProto(self):
@@ -64,7 +64,7 @@
 
     if OC_TestProtocol is not None:
 
-        class TestFormalOCProtocols(objc.test.TestCase):
+        class TestFormalOCProtocols(TestCase):
             
             def testImplementFormalProtocol(self):
 
@@ -108,7 +108,7 @@
 
 
 
-    class TestFormalProtocols (objc.test.TestCase):
+    class TestFormalProtocols (TestCase):
         # Implement unittests for formal protocols here.
         #
 
@@ -244,4 +244,4 @@
             self.assertEquals(1, 0)
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protocolNamed.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protocolNamed.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_protocolNamed.py	Tue Jan 13 05:37:10 2009
@@ -1,7 +1,7 @@
 import objc
-import objc.test
+from PyObjCTools.TestSupport import *
 
-class TestProtocols (objc.test.TestCase):
+class TestProtocols (TestCase):
     def testBasic(self):
         p = objc.protocolNamed('NSObject')
         self.assert_(isinstance(p, objc.formal_protocol))
@@ -11,4 +11,4 @@
         self.assertRaises(objc.ProtocolError, objc.protocolNamed, "PyObjCFooBarProtocol")
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_regr.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_regr.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_regr.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test import structargs
 from objc.test import testbndl
 
@@ -6,7 +6,7 @@
 from objc.test.fnd import NSObject
 
 
-class TestRegressions(objc.test.TestCase):
+class TestRegressions(TestCase):
     def testNSObjectRespondsToCommonMethods(self):
         self.assert_(NSObject.pyobjc_classMethods.respondsToSelector_('alloc'))
         self.assert_(NSObject.instancesRespondToSelector_('init'))
@@ -131,4 +131,4 @@
         self.assertEquals(p.testWithObject_(o) % 16, o.stackPtr() % 16)
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_set_proxy.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_set_proxy.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_set_proxy.py	Tue Jan 13 05:37:10 2009
@@ -2,7 +2,7 @@
 Tests for the proxy of Python sets
 """
 import sys
-import objc.test
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSSet, NSMutableSet, NSPredicate, NSObject, NSNull
 from objc.test.pythonset import OC_TestSet
 import objc
@@ -162,7 +162,7 @@
         self.assert_(isinstance(o, unicode))
 
 
-class TestImmutableSet (objc.test.TestCase, BasicSetTests):
+class TestImmutableSet (TestCase, BasicSetTests):
     setClass = frozenset
 
     def testCopy(self):
@@ -207,7 +207,7 @@
                 OC_TestSet.removeAllObjecsFromSet_, o)
 
 
-class TestMutableSet (objc.test.TestCase, BasicSetTests):
+class TestMutableSet (TestCase, BasicSetTests):
     setClass = set
 
     def testCopy(self):
@@ -293,4 +293,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_signatures.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_signatures.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_signatures.py	Tue Jan 13 05:37:10 2009
@@ -1,10 +1,10 @@
 """
 Test some basic features of signature strings.
 """
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 
-class PyOCTestTypeStr(objc.test.TestCase):
+class PyOCTestTypeStr(TestCase):
     def testSelectorSignatures(self):
 
         self.assert_(
@@ -130,4 +130,4 @@
 
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_sockaddr.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_sockaddr.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_sockaddr.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import unittest
+from PyObjCTools.TestSupport import *
 import objc
 from objc.test.sockaddr import PyObjCTestSockAddr
 
@@ -23,7 +23,7 @@
 
 
 
-class TestSockAddrSupport (unittest.TestCase):
+class TestSockAddrSupport (TestCase):
     def testToObjC(self):
         o = PyObjCTestSockAddr
         
@@ -46,4 +46,4 @@
         self.assertEquals(v, ('::1', 443, 2, 3))
         
 if __name__ == "__main__":
-	unittest.main()
+	main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_charbyte.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_charbyte.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_charbyte.py	Tue Jan 13 05:37:10 2009
@@ -7,7 +7,8 @@
 
 - Add tests for calling methods from ObjC
 """
-import objc.test, weakref
+import weakref, objc
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSObject
 
 from objc.test.specialtypecodes import *
@@ -83,7 +84,7 @@
 
 setupMetaData()
 
-class TestTypeCode_byte (objc.test.TestCase):
+class TestTypeCode_byte (TestCase):
     def testReturnValue(self):
         o = OC_TestSpecialTypeCode.alloc().init()
 
@@ -169,4 +170,4 @@
         self.assertEquals(w, "hand")
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_charint.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_charint.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_charint.py	Tue Jan 13 05:37:10 2009
@@ -7,8 +7,9 @@
 
 - Add tests for calling methods from ObjC
 """
-import objc.test, weakref
+import weakref
 from objc.test.fnd import NSObject
+from PyObjCTools.TestSupport import *
 
 from objc.test.specialtypecodes import *
 import array
@@ -83,7 +84,7 @@
 
 setupMetaData()
 
-class TestTypeCode_int8 (objc.test.TestCase):
+class TestTypeCode_int8 (TestCase):
     def testReturnValue(self):
         o = OC_TestSpecialTypeCode.alloc().init()
 
@@ -166,4 +167,4 @@
         self.assertEquals(w, (ord('h'), ord('a'), ord('n'), ord('d')))
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_methdef.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_methdef.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_methdef.py	Tue Jan 13 05:37:10 2009
@@ -8,12 +8,13 @@
 
 These tests ensure that private type codes don't leak into the Objective-C runtime.
 """
-import objc.test, weakref
+import weakref
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSObject
 
 from objc.test.specialtypecodes import *
 
-class TestTypeCodeLeaks (objc.test.TestCase):
+class TestTypeCodeLeaks (TestCase):
     def testSimpleTypes(self):
         class OC_TestTypeCodeLeaks_Result (NSObject):
 
@@ -304,4 +305,4 @@
         self.assertEquals(csig[3], objc._C_STRUCT_B + 'test=' + objc._C_SHT + objc._C_STRUCT_E)
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_nsbool.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_nsbool.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_nsbool.py	Tue Jan 13 05:37:10 2009
@@ -17,7 +17,8 @@
 - Add tests with these types in struct definitions
 - Review test cases to make sure the tests are complete enough
 """
-import objc.test, weakref
+import weakref
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSObject
 
 from objc.test.specialtypecodes import *
@@ -81,7 +82,7 @@
 
 setupMetaData()
 
-class TestTypeCode_BOOL (objc.test.TestCase):
+class TestTypeCode_BOOL (TestCase):
     def testReturnValue(self):
         o = OC_TestSpecialTypeCode.alloc().init()
 
@@ -162,4 +163,4 @@
         self.assertRaises(ValueError, o.BOOLArrayOf4InOut_, "\x00\x01\x00\x01")
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_struct.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_struct.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_struct.py	Tue Jan 13 05:37:10 2009
@@ -4,7 +4,8 @@
 TODO:
 * _C_UNICHAR, _C_CHAR_AS_INT, _C_CHAR_AS_TEXT
 """
-import objc.test, weakref
+import weakref
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSObject
 
 from objc.test.specialtypecodes import *
@@ -28,7 +29,7 @@
 
 
 
-class TestRecode (objc.test.TestCase):
+class TestRecode (TestCase):
     # Use recode to test to/from Objective-C. 
     #
     # This has limited because in 'real life' we'd encode/decode based on a
@@ -54,7 +55,7 @@
         self.assert_(w.valid[3] is False)
 
 
-class TestObjectiveC (objc.test.TestCase):
+class TestObjectiveC (TestCase):
     # Use an Objective-C class to test to/from Objective-C. 
     #
     def testBoolStruct(self):
@@ -79,4 +80,4 @@
         self.assert_(w.valid[3] is False)
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_unichar.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_unichar.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_specialtypecodes_unichar.py	Tue Jan 13 05:37:10 2009
@@ -7,7 +7,8 @@
 
 - Add tests for calling methods from ObjC
 """
-import objc.test, weakref
+import weakref
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSObject
 
 from objc.test.specialtypecodes import *
@@ -83,7 +84,7 @@
 
 setupMetaData()
 
-class TestTypeCode_UniChar (objc.test.TestCase):
+class TestTypeCode_UniChar (TestCase):
     def testReturnValue(self):
         o = OC_TestSpecialTypeCode.alloc().init()
 
@@ -176,4 +177,4 @@
         self.assertEquals(w, u"hand")
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_splitsig.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_splitsig.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_splitsig.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 
 
@@ -40,7 +40,7 @@
 import sys
 
 
-class SplitSignatureTest (objc.test.TestCase):
+class SplitSignatureTest (TestCase):
 
     def testSplitSignature(self):
     # This is a very expensive test, with 1 goal: Verify that all method
@@ -108,4 +108,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_structpointer.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_structpointer.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_structpointer.py	Tue Jan 13 05:37:10 2009
@@ -1,9 +1,9 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 from objc.test.structpointer2 import *
 from objc.test.structpointer1 import *
 
-class TestOpaqueStructPointer (objc.test.TestCase):
+class TestOpaqueStructPointer (TestCase):
     def testPointer(self):
 
         # Check that the TestPointerStructPtr has a signature that is 
@@ -18,4 +18,4 @@
         self.assert_(isinstance(v, TestStructPointerStructPtr))
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_structs.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_structs.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_structs.py	Tue Jan 13 05:37:10 2009
@@ -7,13 +7,13 @@
 Add tests for nested structs as well (that is assert that NSRect.location is 
 an NSPoint, but using our own types)
 """
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 from objc.test.structs import *
 from objc.test.fnd import NSObject
 
 
-class TestStructs (objc.test.TestCase):
+class TestStructs (TestCase):
     def testCreateExplicit(self):
         tp = objc.createStructType("FooStruct", "{_FooStruct=ffff}", ["a","b","c","d"])
         self.assert_(isinstance(tp, type))
@@ -99,4 +99,4 @@
 
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_subclass.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_subclass.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_subclass.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,4 @@
-import objc.test
+from PyObjCTools.TestSupport import *
 import objc
 from objc.test.testbndl import PyObjC_TestClass3
 import sys
@@ -9,7 +9,7 @@
 NSArray = objc.lookUpClass('NSArray')
 NSAutoreleasePool = objc.lookUpClass('NSAutoreleasePool')
 
-class TestSubclassing(objc.test.TestCase):
+class TestSubclassing(TestCase):
     def testMethodRaise(self):
         # Defining a method whose name is a keyword followed by two underscores
         # should define the method name without underscores in the runtime,
@@ -101,7 +101,7 @@
             self.assert_(x.getArgumentTypeAtIndex_(3).startswith('i'))
 
 
-class TestSelectors(objc.test.TestCase):
+class TestSelectors(TestCase):
     def testSelectorRepr(self):
         class SelectorRepr(NSObject):
             def foo(self):
@@ -110,7 +110,7 @@
         self.assert_(repr(SelectorRepr.foo).startswith('<unbound selector foo of SelectorRepr at'))
 
 
-class TestCopying (objc.test.TestCase):
+class TestCopying (TestCase):
 
     def testCopy(self):
         class MyCopyClass (NSObject):
@@ -176,7 +176,7 @@
         o = MITestClass2.alloc().init()
         self.assertEquals(o.mixinMethod(), "foo")
 
-class TestClassMethods (objc.test.TestCase):
+class TestClassMethods (TestCase):
 
     def testClassMethod(self):
         """ check that classmethod()-s are converted to selectors """
@@ -200,7 +200,7 @@
         self.assert_(isinstance(StaticMethodTest.stMeth, types.FunctionType))
 
 
-class TestOverridingSpecials(objc.test.TestCase):
+class TestOverridingSpecials(TestCase):
     def testOverrideSpecialMethods(self):
         aList = [0]
 
@@ -418,4 +418,4 @@
 
 
 if __name__ == '__main__':
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_varargs.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_varargs.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_varargs.py	Tue Jan 13 05:37:10 2009
@@ -1,10 +1,10 @@
 import objc
-import objc.test
+from PyObjCTools.TestSupport import *
 
 NSObject = objc.lookUpClass("NSObject")
 
 if 0:
-    class VarargsMethod (objc.test.TestCase):
+    class VarargsMethod (TestCase):
         def testVariableArgumentCount(self):
             class VarArgsClass1 (NSObject):
                 def instanceMethod1_(self, arg1, *args):
@@ -58,4 +58,4 @@
             self.assertEquals(l, [{'foo':'bar', 'baz':'foo'}])
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_voidpointer.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_voidpointer.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_voidpointer.py	Tue Jan 13 05:37:10 2009
@@ -1,7 +1,8 @@
-import objc.test, sys
+import sys
+from PyObjCTools.TestSupport import *
 from objc.test.voidpointer import OC_TestVoidPointer
 
-class TestVoidPointer (objc.test.TestCase):
+class TestVoidPointer (TestCase):
     def testVoidPointerMethods(self):
         o = OC_TestVoidPointer.alloc().init()
         self.assertEquals(o.getvalue(), 0)
@@ -13,5 +14,5 @@
         self.assertEquals(o.getvalue(), sys.maxint + 1)
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()
 

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/test/test_weakref.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/test/test_weakref.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/test/test_weakref.py	Tue Jan 13 05:37:10 2009
@@ -1,4 +1,5 @@
-import objc.test, weakref
+import weakref
+from PyObjCTools.TestSupport import *
 from objc.test.fnd import NSObject
 
 class OC_WeakrefTest1 (NSObject):
@@ -7,7 +8,7 @@
 class OC_WeakrefTest2 (OC_WeakrefTest1):
     pass
 
-class TestWeakrefs (objc.test.TestCase):
+class TestWeakrefs (TestCase):
     def testPureObjC(self):
         o = NSObject.new()
         self.assertRaises(TypeError, weakref.ref, o)
@@ -21,4 +22,4 @@
         self.assertRaises(TypeError, weakref.ref, o)
 
 if __name__ == "__main__":
-    objc.test.main()
+    main()

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/instance-var.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/instance-var.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/instance-var.m	Tue Jan 13 05:37:10 2009
@@ -150,6 +150,7 @@
 		return -1;
 	}
 
+
 	if (self->ivar == NULL) {
 		var = class_getInstanceVariable(
 				object_getClass(objc), self->name);
@@ -164,6 +165,8 @@
 		var = self->ivar;
 	}
 	
+	NSString* ocName = [NSString stringWithUTF8String:self->name];
+	[objc willChangeValueForKey:ocName];
 
 	if (self->isSlot) {
 		PyObject** slotval = (PyObject**)(
@@ -172,6 +175,7 @@
 		Py_XDECREF(*slotval);
 		*slotval = value;
 
+		[objc didChangeValueForKey:ocName];
 		return 0;
 	}
 
@@ -181,6 +185,7 @@
 
 		res = depythonify_c_value(@encode(id), value, &new_value);
 		if (res == -1) {
+			[objc didChangeValueForKey:ocName];
 			return -1;
 		}
 
@@ -195,20 +200,24 @@
 		}
 
 		object_setIvar(objc, var, new_value);
+		[objc didChangeValueForKey:ocName];
 
 		return 0;
 	}
 
 	size = PyObjCRT_SizeOfType(ivar_getTypeEncoding(var));
 	if (size == -1) {
+		[objc didChangeValueForKey:ocName];
 		return -1;
 	}
 	res = depythonify_c_value(ivar_getTypeEncoding(var), value, 
 		(void*)(((char*)objc)+ivar_getOffset(var)));
 	if (res == -1) {
+		[objc didChangeValueForKey:ocName];
 		return -1;
 	}
 
+	[objc didChangeValueForKey:ocName];
 	return 0;
 }
 

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/libffi_support.m	Tue Jan 13 05:37:10 2009
@@ -3063,6 +3063,10 @@
 					return NULL;
 				}
 
+				if (methinfo->free_result) {
+					free(*(void**)pRetval);
+				}
+
 			}
 	 	}
 

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/method-signature.h
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/method-signature.h	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/method-signature.h	Tue Jan 13 05:37:10 2009
@@ -54,6 +54,7 @@
 	const char* signature;
 	BOOL variadic:1;
 	BOOL null_terminated_array:1;
+	BOOL		free_result:1;
 	PyObject*   suggestion;
 	struct _PyObjC_ArgDescr rettype;
 	struct _PyObjC_ArgDescr argtype[1];

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/method-signature.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/method-signature.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/method-signature.m	Tue Jan 13 05:37:10 2009
@@ -119,6 +119,7 @@
 	retval->ob_size = nargs;
 	retval->suggestion = NULL;
 	retval->variadic = NO;
+	retval->free_result = NO;
 	retval->null_terminated_array = NO;
 	retval->signature = PyObjCUtil_Strdup(signature);
 	if (retval->signature == NULL) {
@@ -519,6 +520,14 @@
 			Py_DECREF(methinfo);
 			return NULL;
 		}
+
+		if (retval != NULL) {
+			PyObject* av = PyDict_GetItemString(metadata, "free_result");
+			if (av && PyObject_IsTrue(av)) {
+				methinfo->free_result = YES;
+			}
+			Py_XDECREF(av);
+		}
 	}
 
 
@@ -707,7 +716,7 @@
 	if (descr->ptrType != PyObjC_kPointerPlain) {
 		v = PyBool_FromLong(descr->arraySizeInRetval);
 		if (v == NULL) goto error;
-		r = PyDict_SetItemString(result, "c_array_length_in_retval", v);
+		r = PyDict_SetItemString(result, "c_array_length_in_result", v);
 		Py_DECREF(v);
 		if (r == -1) goto error;
 	}

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/objc_util.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/objc_util.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/objc_util.m	Tue Jan 13 05:37:10 2009
@@ -1116,6 +1116,10 @@
 	Py_ssize_t i;
 	Py_ssize_t eltsize;
 
+	if (size == -1) {
+		size = 0;
+	}
+
 	eltsize = PyObjCRT_SizeOfType(elementType);
 	if (eltsize == -1) {
 		return NULL;

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/parsexml.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/parsexml.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/parsexml.m	Tue Jan 13 05:37:10 2009
@@ -40,6 +40,7 @@
 	"null_accepted', ",
 	"c_array_of_variable_length",
 	"printf_format",
+	"free_result",
 	NULL
 };
 

Modified: trunk/pyobjc/pyobjc-core/Modules/objc/struct-wrapper.m
==============================================================================
--- trunk/pyobjc/pyobjc-core/Modules/objc/struct-wrapper.m	(original)
+++ trunk/pyobjc/pyobjc-core/Modules/objc/struct-wrapper.m	Tue Jan 13 05:37:10 2009
@@ -395,7 +395,25 @@
 			v = PyBool_FromLong(0);
 			break;
 #endif
+		case _C_NSBOOL:
+			v = PyBool_FromLong(0);
+			break;
+
+		case _C_CHAR_AS_TEXT:
+			{
+				char ch = 0;
+				v = PyString_FromStringAndSize(&ch, 1);
+			}
+			break;
+
+		case _C_UNICHAR:
+			{
+				Py_UNICODE ch = 0;
+				v = PyUnicode_FromUnicode(&ch, 1);
+			}
+			break;
 
+		case _C_CHAR_AS_INT:
 		case _C_CHR: case _C_UCHR:
 		case _C_SHT: case _C_USHT:
 		case _C_INT: case _C_UINT:
@@ -416,6 +434,12 @@
 					Py_DECREF(v);
 					return -1;
 				}
+			} else if (!PyErr_Occurred()) {
+				/* this is a struct-type without a struct
+				 * wrapper. Default to None
+				 */
+				v = Py_None;
+				Py_INCREF(Py_None);
 			}
 				
 
@@ -459,7 +483,7 @@
 	int r;
 
 	if (self == NULL) {
-		*(void**)retval = NULL;
+		*(int**)retval = 0;
 		return;
 	}
 

Modified: trunk/pyobjc/pyobjc-core/NEWS.txt
==============================================================================
--- trunk/pyobjc/pyobjc-core/NEWS.txt	(original)
+++ trunk/pyobjc/pyobjc-core/NEWS.txt	Tue Jan 13 05:37:10 2009
@@ -7,6 +7,42 @@
 Version 2.1 (...)
 -----------------
 
+- Added ``PyObjC.TestSupport``. This is an unsupported module containing
+  useful functionality for testing PyObjC itself.
+
+- Added ``free_result`` attribute to the ``retval`` element in metadata
+  files. When this attribute has value ``'true'`` the return value of the
+  C function (or ObjC-method) will be free-ed using the function ``free()``,
+  otherwise the bridge assumes other code is reponsible to free the result.
+
+  This is to be used for low-level C API's that return a pointer to a
+  dynamicly allocated array that is to be free-ed by the caller. One example
+  is the function ``DHCPClientPreferencesCopyApplicationOptions`` in the
+  SystemConfiguration framework.
+
+- Added ``objc.context``, which is helpfull for dealing with "context" 
+  arguments as used by several Cocoa APIs. The context argument must be
+  a number in Python, while you'd prefer to pass in an arbitrary object 
+  instead. The ``objc.context`` registry allows you to get a context 
+  integer for an arbitrary Python object, and retrieve that later on.
+
+  To get the context integer for a Python object::
+      
+      ctx = objc.context.register(myValue)
+
+  To unregister the object when you no longer need the context integer::
+
+      objc.context.unregister(myValue)
+
+  To retrieve the Python object given a context integer::
+
+      myValue = objc.context.get(ctx)
+
+
+  NOTE: This API is particularly handy when using Key-Value Observing, where
+  the context number should be a unique value to make ensure that KVO usage
+  by the superclass doesn't get confused with your own usage of KVO.
+
 - PyObjC can now run in 64-bit mode.
 
   NOTE: 64-bit support is beta quality, that is: all unittests pass, but I 

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.