Commits

Ronald Oussoren committed 6ce456e

Correctly detect unexpected passing tests in the calculation of the summary line.

Comments (0)

Files changed (39)

pyobjc-core/Tools/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))
         if dist.has_metadata('include'):
             for fn in dist.metadata_listdir('include'):
                 data = dist.get_metadata('include/%s'%(fn,))
-                open(os.path.join(include_root, fn), 'w').write(data)
+                fp = open(os.path.join(include_root, fn), 'w')
+                try:
+                    fp.write(data)
+                finally:
+                    fp.close()
 
         else:
             data = gPyObjCAPI_H
-            open(os.path.join(include_root, 'pyobjc-api.h'), 'w').write(data)
+            fp = open(os.path.join(include_root, 'pyobjc-api.h'), 'w')
+            try:
+                fp.write(data)
+            finally:
+                fp.close()
 
         for e in self.extensions:
             if include_root not in e.include_dirs:
         cmdclass = cmdclass.copy()
 
     if not os_compatible:
+        if min_os_level != None:
+            if max_os_level != None:
+                msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
+                        min_os_level, max_os_level)
+            else:
+                msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
+        elif max_os_level != None:
+            msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
+        else:
+            msg = "This distribution is only supported on MacOSX"
+
         def create_command_subclass(base_class):
-            if min_os_level != None:
-                if max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX versions %s upto and including %s"%(
-                            min_os_level, max_os_level)
-                else:
-                    msg = "This distribution is only supported on MacOSX >= %s"%(min_os_level,)
-            elif max_os_level != None:
-                    msg = "This distribution is only supported on MacOSX <= %s"%(max_os_level,)
-            else:
-                    msg = "This distribution is only supported on MacOSX"
 
             class subcommand (base_class):
                 def run(self):
 
             return subcommand
 
+        class no_test (oc_test):
+            def run(self):
+                print("WARNING: %s\n"%(msg,))
+                print("SUMMARY: {'count': 0, 'fails': 0, 'errors': 0, 'xfails': 0, 'skip': 65, 'xpass': 0, 'message': msg }\n")
+
         cmdclass['build'] = create_command_subclass(build.build)
-        cmdclass['test'] = create_command_subclass(oc_test)
-        cmdclass['install'] = create_command_subclass(pyobjc_install_lib)
+        cmdclass['test'] = no_test
+        cmdclass['install'] = create_command_subclass(install.install)
+        cmdclass['install_lib'] = create_command_subclass(pyobjc_install_lib)
         cmdclass['develop'] = create_command_subclass(develop.develop)
         cmdclass['build_py'] = create_command_subclass(oc_build_py)
     else:

pyobjc-framework-Accounts/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-AddressBook/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-AppleScriptKit/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-AppleScriptObjC/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-Automator/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-CFNetwork/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-CalendarStore/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-Cocoa/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-Collaboration/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-CoreData/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-CoreLocation/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-CoreText/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-DictionaryServices/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-EventKit/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-ExceptionHandling/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-FSEvents/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-InputMethodKit/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-InstallerPlugins/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-InstantMessage/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-InterfaceBuilderKit/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-LatentSemanticMapping/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-LaunchServices/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-Message/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-OpenDirectory/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-PreferencePanes/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-PubSub/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-QTKit/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-Quartz/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-ScreenSaver/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-ScriptingBridge/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-SearchKit/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-ServerNotification/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-ServiceManagement/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-Social/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-SyncServices/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-SystemConfiguration/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-WebKit/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))

pyobjc-framework-XgridFoundation/pyobjc_setup.py

                 fails=len(result.failures),
                 errors=len(result.errors),
                 xfails=len(getattr(result, 'expectedFailures', [])),
-                xpass=len(getattr(result, 'expectedSuccesses', [])),
+                xpass=len(getattr(result, 'unexpectedSuccesses', [])),
                 skip=len(getattr(result, 'skipped', [])),
             )
             print("SUMMARY: %s"%(summary,))