瀏覽代碼

Testing from the command line

Mike Lewis 13 年之前
父節點
當前提交
4cd88bdd34

+ 10 - 0
Makefile

@@ -0,0 +1,10 @@
+SDK=iphonesimulator5.0
+TEST_KEY=sr_test_fun
+TEST_SCENARIOS="[1-8]*"
+
+
+test:
+
+	bash ./TestSupport/run_test.sh $(TEST_SCENARIOS) $(TEST_KEY) $(SDK)
+	open reports/clients/index.html
+	

+ 19 - 0
SocketRocket.xcodeproj/project.pbxproj

@@ -30,6 +30,16 @@
 		F6C41C98145F7C6100641356 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F6C41C95145F7C4700641356 /* libicucore.dylib */; };
 /* End PBXBuildFile section */
 
+/* Begin PBXContainerItemProxy section */
+		F62417D514D50869003CE997 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = F6B208241450F597009315AF /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = F6B2082C1450F597009315AF;
+			remoteInfo = SocketRocket;
+		};
+/* End PBXContainerItemProxy section */
+
 /* Begin PBXFileReference section */
 		F6016C7B146124B20037BB3D /* base64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = base64.c; sourceTree = "<group>"; };
 		F6016C7E146124ED0037BB3D /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base64.h; sourceTree = "<group>"; };
@@ -208,6 +218,7 @@
 			buildRules = (
 			);
 			dependencies = (
+				F62417D614D50869003CE997 /* PBXTargetDependency */,
 			);
 			name = SRWebSocketTests;
 			productName = SRWebSocketTests;
@@ -291,6 +302,14 @@
 		};
 /* End PBXSourcesBuildPhase section */
 
+/* Begin PBXTargetDependency section */
+		F62417D614D50869003CE997 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = F6B2082C1450F597009315AF /* SocketRocket */;
+			targetProxy = F62417D514D50869003CE997 /* PBXContainerItemProxy */;
+		};
+/* End PBXTargetDependency section */
+
 /* Begin PBXVariantGroup section */
 		F6BDA80A145900D200FE3253 /* InfoPlist.strings */ = {
 			isa = PBXVariantGroup;

+ 1 - 7
SocketRocket.xcodeproj/xcshareddata/xcschemes/SocketRocket.xcscheme

@@ -31,7 +31,7 @@
             ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
             <ActionContent
                title = "Run Script"
-               scriptText = "PIDFILE=$TMPDIR/srtharness.pid&#10;if [ -r $PIDFILE ]; then&#10;EXISTING_PID=`cat $PIDFILE`&#10;    echo &quot;Killing Dangling SRTextharneess PID:&quot; $EXISTING_PID&#10;    kill $EXISTING_PID&#10;    rm $PIDFILE&#10;fi&#10;&#10;pushd $PROJECT_DIR&#10;&#10;export MACOSX_DEPLOYMENT_TARGET=&quot;10.7&quot;&#10;&#10;bash TestSupport/ensure_virtualenv.sh $PROJECT_DIR/.env&#10;source .env/bin/activate&#10;&#10;&#10;nohup sr-testharness -k hello_test_harness -i &apos;&apos; -c &apos;[1-8]*&apos; &amp;&#10;&#10;#nohup sr-testharness -k hello_test_harness -i &apos;&apos; -c &apos;*&apos; &amp;&#10;&#10;echo $! &gt; $PIDFILE&#10;&#10;popd"
+               scriptText = "PIDFILE=$TMPDIR/srtharness.pid&#10;if [ -r $PIDFILE ]; then&#10;    EXISTING_PID=`cat $PIDFILE`&#10;    echo &quot;Killing Dangling SRTextharneess PID:&quot; $EXISTING_PID&#10;    kill $EXISTING_PID&#10;    rm $PIDFILE&#10;fi&#10;&#10;pushd $PROJECT_DIR&#10;&#10;export MACOSX_DEPLOYMENT_TARGET=&quot;10.7&quot;&#10;&#10;bash TestSupport/ensure_virtualenv.sh $PROJECT_DIR/.env&#10;source .env/bin/activate&#10;&#10;&#10;nohup sr-testharness -k hello_test_harness -i &apos;&apos; -c &apos;[1-8]*&apos; &amp;&#10;&#10;#nohup sr-testharness -k hello_test_harness -i &apos;&apos; -c &apos;*&apos; &amp;&#10;&#10;echo $! &gt; $PIDFILE&#10;&#10;popd"
                shellToInvoke = "/bin/bash">
                <EnvironmentBuildable>
                   <BuildableReference
@@ -101,12 +101,6 @@
       buildConfiguration = "Debug"
       debugDocumentVersioning = "YES"
       allowLocationSimulation = "YES">
-      <CommandLineArguments>
-         <CommandLineArgument
-            argument = "SR_TESTHARNESS_KEY"
-            isEnabled = "YES">
-         </CommandLineArgument>
-      </CommandLineArguments>
       <AdditionalOptions>
       </AdditionalOptions>
    </LaunchAction>

+ 18 - 0
TestSupport/run_test.sh

@@ -0,0 +1,18 @@
+export MACOSX_DEPLOYMENT_TARGET="10.7"
+
+TEST_SCENARIOS=$1
+TEST_KEY=$2
+SDK=$3
+
+export SR_TESTHARNESS_KEY=$TEST_KEY
+
+bash TestSupport/ensure_virtualenv.sh .env
+
+.env/bin/sr-testharness -k $TEST_KEY -i '' -c "$TEST_SCENARIOS" &
+
+CHILD_PID=$!
+
+xcodebuild -target SocketRocket -sdk $SDK -configuration Debug clean
+xcodebuild -target SRWebSocketTests -sdk $SDK -configuration Debug clean build
+
+kill $CHILD_PID

文件差異過大導致無法顯示
+ 3 - 0
nohup.out


部分文件因文件數量過多而無法顯示