aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting/GTMUnitTestDevLog.h
diff options
context:
space:
mode:
authorGravatar dmaclach <dmaclach@google.com>2016-10-07 12:10:23 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2016-10-07 12:21:06 -0400
commit42124b3691197c3c4f52f069775fa0390a8ff942 (patch)
treeebd373d398ea64b45bdc1d196fa0a2c5f57cabfd /UnitTesting/GTMUnitTestDevLog.h
parent57eeab4193210df8ab0c81e9d3f1ee1ad3e24492 (diff)
First cut at pruning things/updating things.
Remove a bunch of code that Google stopped using/maintaining rather than trying to update it it. Some would be hard to update, some actually has system provided replacements; others are patterns that just don't seem as common now. Prune out the code related to macOS <= 10.5, start pruning some of the really old iOS support also. Get the projects mostly limping again with modern Xcodes so tests can be run. If someone ends up on this commit via history for something they still find as useful, feel free to do a pull request to bring the snippet of code back to life and update it for current SDKs.
Diffstat (limited to 'UnitTesting/GTMUnitTestDevLog.h')
-rw-r--r--UnitTesting/GTMUnitTestDevLog.h59
1 files changed, 3 insertions, 56 deletions
diff --git a/UnitTesting/GTMUnitTestDevLog.h b/UnitTesting/GTMUnitTestDevLog.h
index 2be231e..35d5e0d 100644
--- a/UnitTesting/GTMUnitTestDevLog.h
+++ b/UnitTesting/GTMUnitTestDevLog.h
@@ -16,69 +16,16 @@
// the License.
//
-#import "GTMDefines.h"
#import <Foundation/Foundation.h>
+#import "GTMDefines.h"
-// GTMUnitTestDevLog tracks what messages are logged to verify that you only
-// log what you expect to log during the running of unittests. This allows you
-// to log with impunity from your actual core implementations and still be able
-// to find unexpected logs in your output when running unittests.
-// In your unittests you tell GTMUnitTestDevLog what messages you expect your
-// test to spit out, and it will cause any that don't match to appear as errors
-// in your unittest run output. You can match on exact strings or standard
-// regexps.
-// Set GTM_SHOW_UNITTEST_DEVLOGS in the environment to show the logs that that
-// are expected and encountered. Otherwise they aren't display to keep the
-// unit test results easier to read.
+// GTMUnitTestDevLog modifies assertion logs so they don't get trapped by
+// build systems.
@interface GTMUnitTestDevLog : NSObject
-// Log a message
-+ (void)log:(NSString*)format, ... NS_FORMAT_FUNCTION(1, 2);
-+ (void)log:(NSString*)format args:(va_list)args NS_FORMAT_FUNCTION(1, 0);
// Turn tracking on/off
+ (void)enableTracking;
+ (void)disableTracking;
-+ (BOOL)isTrackingEnabled;
-
-// Note that you are expecting a string that has an exact match. No need to
-// escape any pattern characters.
-+ (void)expectString:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
-
-// Note that you are expecting a pattern. Pattern characters that you want
-// exact matches on must be escaped. See [GTMRegex escapedPatternForString].
-// Patterns match across newlines (kGTMRegexOptionSupressNewlineSupport) making
-// it easier to match output from the descriptions of NS collection types such
-// as NSArray and NSDictionary.
-+ (void)expectPattern:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
-
-// Note that you are expecting exactly 'n' strings
-+ (void)expect:(NSUInteger)n
- casesOfString:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
-// Note that you are expecting exactly 'n' patterns
-+ (void)expect:(NSUInteger)n
- casesOfPattern:(NSString*)format, ... NS_FORMAT_FUNCTION(2, 3);
-+ (void)expect:(NSUInteger)n
- casesOfPattern:(NSString*)format
- args:(va_list)args NS_FORMAT_FUNCTION(2, 0);
-
-// Call when you want to verify that you have matched all the logs you expect
-// to match. If your unittests inherit from GTMTestcase (like they should) you
-// will get this called for free.
-+ (void)verifyNoMoreLogsExpected;
-
-// Resets the expected logs so that you don't have anything expected.
-// In general should not be needed, unless you have a variable logging case
-// of some sort.
-+ (void)resetExpectedLogs;
@end
-
-// Does the same as GTMUnitTestDevLog, but the logs are only expected in debug.
-// ie-the expect requests don't count in release builds.
-@interface GTMUnitTestDevLogDebug : GTMUnitTestDevLog
-@end
-
-// The name of the exception that is raised when GTMUnitTestDevLog
-// finds a problem.
-GTM_EXTERN NSString *const GTMLogFailureException;