Skip to content

Commit 016153f

Browse files
committed
Isolated all testing code with __GCDWEBSERVER_ENABLE_TESTING__
1 parent a55781e commit 016153f

4 files changed

Lines changed: 207 additions & 198 deletions

File tree

GCDWebServer/Core/GCDWebServer.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,8 @@ typedef GCDWebServerResponse* (^GCDWebServerProcessBlock)(GCDWebServerRequest* r
6565
@property(nonatomic, readonly) NSURL* serverURL; // Only non-nil if server is running
6666
@property(nonatomic, readonly) NSURL* bonjourServerURL; // Only non-nil if server is running and Bonjour registration is active
6767
#if !TARGET_OS_IPHONE
68-
@property(nonatomic, getter=isRecordingEnabled) BOOL recordingEnabled; // Creates files in the current directory containing the raw data for all requests and responses (directory most NOT contain prior recordings)
6968
- (BOOL)runWithPort:(NSUInteger)port; // Starts then automatically stops on SIGINT i.e. Ctrl-C (use on main thread only)
7069
#endif
71-
#ifdef __GCDWEBSERVER_ENABLE_TESTING__
72-
- (NSInteger)runTestsInDirectory:(NSString*)path withPort:(NSUInteger)port; // Returns number of failed tests or -1 if server failed to start
73-
#endif
7470
@end
7571

7672
@interface GCDWebServer (Handlers)
@@ -94,3 +90,12 @@ typedef GCDWebServerResponse* (^GCDWebServerProcessBlock)(GCDWebServerRequest* r
9490
- (void)logWarning:(NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
9591
- (void)logError:(NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
9692
@end
93+
94+
#ifdef __GCDWEBSERVER_ENABLE_TESTING__
95+
96+
@interface GCDWebServer (Testing)
97+
@property(nonatomic, getter=isRecordingEnabled) BOOL recordingEnabled; // Creates files in the current directory containing the raw data for all requests and responses (directory most NOT contain prior recordings)
98+
- (NSInteger)runTestsInDirectory:(NSString*)path withPort:(NSUInteger)port; // Returns number of failed tests or -1 if server failed to start
99+
@end
100+
101+
#endif

0 commit comments

Comments
 (0)