From: <jf...@us...> - 2013-01-07 08:09:37
|
Revision: 957 http://confix.svn.sourceforge.net/confix/?rev=957&view=rev Author: jfasch Date: 2013-01-07 08:09:27 +0000 (Mon, 07 Jan 2013) Log Message: ----------- fixed header install tests: nested errors Modified Paths: -------------- confix/trunk/libconfix/core/utils/error.py confix/trunk/libconfix/plugins/c/tests/header_visibility_inmem.py Modified: confix/trunk/libconfix/core/utils/error.py =================================================================== --- confix/trunk/libconfix/core/utils/error.py 2013-01-06 19:26:49 UTC (rev 956) +++ confix/trunk/libconfix/core/utils/error.py 2013-01-07 08:09:27 UTC (rev 957) @@ -58,6 +58,21 @@ pass pass return lines + + def contains_error_of_type(self, t): + """ Do I contain a nested error of type t? + + This is true when I am of type t, or when I contain an error + of type t. """ + + if isinstance(self, t): + return True + for e in self.__list: + if e.contains_error_of_type(t): + return True + pass + return False + pass class NativeError(Exception): Modified: confix/trunk/libconfix/plugins/c/tests/header_visibility_inmem.py =================================================================== --- confix/trunk/libconfix/plugins/c/tests/header_visibility_inmem.py 2013-01-06 19:26:49 UTC (rev 956) +++ confix/trunk/libconfix/plugins/c/tests/header_visibility_inmem.py 2013-01-07 08:09:27 UTC (rev 957) @@ -21,6 +21,7 @@ from libconfix.setups.c import C from libconfix.plugins.c.h import HeaderBuilder +import libconfix.plugins.c.h from libconfix.core.filesys.directory import Directory from libconfix.core.filesys.file import File @@ -105,7 +106,8 @@ try: package.boil(external_nodes=[]) package.output() - except HeaderBuilder.AmbiguousVisibility, e: + except Error, e: + self.failUnless(e.contains_error_of_type(libconfix.plugins.c.h.AmbiguousVisibility)) return self.fail() pass @@ -127,7 +129,8 @@ try: package.boil(external_nodes=[]) package.output() - except HeaderBuilder.AmbiguousVisibility, e: + except Error, e: + self.failUnless(e.contains_error_of_type(libconfix.plugins.c.h.AmbiguousVisibility)) return self.fail() pass @@ -150,7 +153,8 @@ try: package.boil(external_nodes=[]) package.output() - except HeaderBuilder.AmbiguousVisibility, e: + except Error, e: + self.failUnless(e.contains_error_of_type(libconfix.plugins.c.h.AmbiguousVisibility)) return self.fail() pass @@ -272,7 +276,8 @@ try: package.boil(external_nodes=[]) package.output() - except HeaderBuilder.AmbiguousVisibility, e: + except Error, e: + self.failUnless(e.contains_error_of_type(libconfix.plugins.c.h.AmbiguousVisibility)) return self.fail() pass @@ -407,7 +412,8 @@ try: package.boil(external_nodes=[]) package.output() - except HeaderBuilder.BadNamespace: + except Error, e: + self.failUnless(e.contains_error_of_type(libconfix.plugins.c.h.BadNamespace)) return self.fail() pass @@ -436,7 +442,8 @@ try: package.boil(external_nodes=[]) package.output() - except HeaderBuilder.BadNamespace: + except Error, e: + self.failUnless(e.contains_error_of_type(libconfix.plugins.c.h.BadNamespace)) return self.fail() pass @@ -485,7 +492,8 @@ try: package.boil(external_nodes=[]) package.output() - except HeaderBuilder.BadNamespace: + except Error, e: + self.failUnless(e.contains_error_of_type(libconfix.plugins.c.h.BadNamespace)) pass pass @@ -593,7 +601,8 @@ try: package.boil(external_nodes=[]) package.output() - except HeaderBuilder.AmbiguousVisibility: + except Error, e: + self.failUnless(e.contains_error_of_type(libconfix.plugins.c.h.AmbiguousVisibility)) return self.fail() pass @@ -619,7 +628,8 @@ try: package.boil(external_nodes=[]) package.output() - except HeaderBuilder.AmbiguousVisibility: + except Error, e: + self.failUnless(e.contains_error_of_type(libconfix.plugins.c.h.AmbiguousVisibility)) return self.fail() pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |