Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Hopefully safer simulation quitting.

  • Loading branch information...
commit 845c36906a45ad156861f7669baef41618242898 1 parent 4a5a90c
Rob Holland authored
View
5 ext/iCuke/sdk3.1/QuitResponse.h
@@ -0,0 +1,5 @@
+#import "iCukeHTTPResponseHandler.h"
+
+@interface QuitResponse : iCukeHTTPResponseHandler {
+}
+@end
View
23 ext/iCuke/sdk3.1/QuitResponse.m
@@ -0,0 +1,23 @@
+#import "QuitResponse.h"
+#import "iCukeHTTPServer.h"
+#import "JSON.h"
+
+@implementation QuitResponse
++ (void)load
+{
+ [iCukeHTTPResponseHandler registerHandler:self];
+}
+
++ (BOOL)canHandleRequest:(CFHTTPMessageRef)aRequest
+ method:(NSString *)requestMethod
+ url:(NSURL *)requestURL
+ headerFields:(NSDictionary *)requestHeaderFields
+{
+ return [requestURL.path isEqualToString:@"/quit"];
+}
+
+- (void)startResponse
+{
+ exit(0);
+}
+@end
View
5 ext/iCuke/sdk4.0/QuitResponse.h
@@ -0,0 +1,5 @@
+#import "iCukeHTTPResponseHandler.h"
+
+@interface QuitResponse : iCukeHTTPResponseHandler {
+}
+@end
View
23 ext/iCuke/sdk4.0/QuitResponse.m
@@ -0,0 +1,23 @@
+#import "QuitResponse.h"
+#import "iCukeHTTPServer.h"
+#import "JSON.h"
+
+@implementation QuitResponse
++ (void)load
+{
+ [iCukeHTTPResponseHandler registerHandler:self];
+}
+
++ (BOOL)canHandleRequest:(CFHTTPMessageRef)aRequest
+ method:(NSString *)requestMethod
+ url:(NSURL *)requestURL
+ headerFields:(NSDictionary *)requestHeaderFields
+{
+ return [requestURL.path isEqualToString:@"/quit"];
+}
+
+- (void)startResponse
+{
+ exit(0);
+}
+@end
View
5 lib/icuke/waxsim.rb
@@ -18,7 +18,7 @@ def launch(project_file, options = {})
command = ICuke::SDK.launch("#{directory}/#{app_name}.app", options[:platform], options[:env])
@simulator = BackgroundProcess.run(command)
-
+
timeout(30) do
begin
view
@@ -30,9 +30,8 @@ def launch(project_file, options = {})
end
def quit
- @simulator.kill('QUIT')
+ get '/quit' rescue nil
@simulator.wait
- sleep 1
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.