777 scope, filterString = eval(arg.replace("u'", "'")) |
777 scope, filterString = eval(arg.replace("u'", "'")) |
778 self.__generateFilterObjects(int(scope), filterString) |
778 self.__generateFilterObjects(int(scope), filterString) |
779 return |
779 return |
780 |
780 |
781 if cmd == DebugProtocol.RequestUTPrepare: |
781 if cmd == DebugProtocol.RequestUTPrepare: |
782 fn, tn, tfn, cov, covname, erase = arg.split('|') |
782 fn, tn, tfn, failed, cov, covname, erase = arg.split('|') |
783 sys.path.insert(0, os.path.dirname(os.path.abspath(fn))) |
783 sys.path.insert(0, os.path.dirname(os.path.abspath(fn))) |
784 os.chdir(sys.path[0]) |
784 os.chdir(sys.path[0]) |
|
785 failed = eval(failed) |
785 |
786 |
786 # set the system exception handling function to ensure, that |
787 # set the system exception handling function to ensure, that |
787 # we report on all unhandled exceptions |
788 # we report on all unhandled exceptions |
788 sys.excepthook = self.__unhandled_exception |
789 sys.excepthook = self.__unhandled_exception |
789 |
790 |
790 try: |
791 try: |
791 import unittest |
792 import unittest |
792 utModule = imp.load_source(tn, fn) |
793 utModule = imp.load_source(tn, fn) |
793 try: |
794 try: |
794 self.test = unittest.defaultTestLoader\ |
795 if failed: |
795 .loadTestsFromName(tfn, utModule) |
796 self.test = unittest.defaultTestLoader\ |
|
797 .loadTestsFromNames(failed, utModule) |
|
798 else: |
|
799 self.test = unittest.defaultTestLoader\ |
|
800 .loadTestsFromName(tfn, utModule) |
796 except AttributeError: |
801 except AttributeError: |
797 self.test = unittest.defaultTestLoader\ |
802 self.test = unittest.defaultTestLoader\ |
798 .loadTestsFromModule(utModule) |
803 .loadTestsFromModule(utModule) |
799 except: |
804 except: |
800 exc_type, exc_value, exc_tb = sys.exc_info() |
805 exc_type, exc_value, exc_tb = sys.exc_info() |