From 080b28284751ae178608f45268765f6e0ae94287 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 16 Sep 2009 17:04:27 +0000 Subject: [Author: dmaclach] Add support for more complex unit test class hierarchies than what is available out of the box in SenTestCase. I currently have the release notes checked out as part of a separate change, and will update them accordingly for this as well. R=thomasvl,mrossetti DELTA=80 (79 added, 0 deleted, 1 changed) --- UnitTesting/GTMSenTestCase.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'UnitTesting/GTMSenTestCase.h') diff --git a/UnitTesting/GTMSenTestCase.h b/UnitTesting/GTMSenTestCase.h index 9837b2b..58c0594 100644 --- a/UnitTesting/GTMSenTestCase.h +++ b/UnitTesting/GTMSenTestCase.h @@ -1008,4 +1008,27 @@ GTM_EXTERN NSString *const SenTestLineNumberKey; // to set up our logging system correctly to verify logging calls. // See GTMUnitTestDevLog.h for details @interface GTMTestCase : SenTestCase + +// Returns YES if this is an abstract testCase class as opposed to a concrete +// testCase class that you want tests run against. SenTestCase is not designed +// out of the box to handle an abstract class hierarchy descending from it with +// some concrete subclasses. In some cases we want all the "concrete" +// subclasses of an abstract subclass of SenTestCase to run a test, but we don't +// want that test to be run against an instance of an abstract subclass itself. +// By returning "YES" here, the tests defined by this class won't be run against +// an instance of this class. As an example class hierarchy: +// +// FooExtensionTestCase +// GTMTestCase <- ExtensionTestCase < +// BarExtensionTestCase +// +// So FooExtensionTestCase and BarExtensionTestCase inherit from +// ExtensionTestCase (and probably FooExtension and BarExtension inherit from a +// class named Extension). We want the tests in ExtensionTestCase to be run as +// part of FooExtensionTestCase and BarExtensionTestCase, but we don't want them +// run against ExtensionTestCase. The default implementation of +// isAbstractTestCase returns NO if self (being a class) has no subclasses and +// YES otherwise. ++ (BOOL)isAbstractTestCase; + @end -- cgit v1.2.3