Skip to content

Commit 4cd88bd

Browse files
committed
Testing from the command line
1 parent 0a3fd43 commit 4cd88bd

5 files changed

Lines changed: 1518 additions & 7 deletions

File tree

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SDK=iphonesimulator5.0
2+
TEST_KEY=sr_test_fun
3+
TEST_SCENARIOS="[1-8]*"
4+
5+
6+
test:
7+
8+
bash ./TestSupport/run_test.sh $(TEST_SCENARIOS) $(TEST_KEY) $(SDK)
9+
open reports/clients/index.html
10+

SocketRocket.xcodeproj/project.pbxproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@
3030
F6C41C98145F7C6100641356 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F6C41C95145F7C4700641356 /* libicucore.dylib */; };
3131
/* End PBXBuildFile section */
3232

33+
/* Begin PBXContainerItemProxy section */
34+
F62417D514D50869003CE997 /* PBXContainerItemProxy */ = {
35+
isa = PBXContainerItemProxy;
36+
containerPortal = F6B208241450F597009315AF /* Project object */;
37+
proxyType = 1;
38+
remoteGlobalIDString = F6B2082C1450F597009315AF;
39+
remoteInfo = SocketRocket;
40+
};
41+
/* End PBXContainerItemProxy section */
42+
3343
/* Begin PBXFileReference section */
3444
F6016C7B146124B20037BB3D /* base64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = base64.c; sourceTree = "<group>"; };
3545
F6016C7E146124ED0037BB3D /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base64.h; sourceTree = "<group>"; };
@@ -208,6 +218,7 @@
208218
buildRules = (
209219
);
210220
dependencies = (
221+
F62417D614D50869003CE997 /* PBXTargetDependency */,
211222
);
212223
name = SRWebSocketTests;
213224
productName = SRWebSocketTests;
@@ -291,6 +302,14 @@
291302
};
292303
/* End PBXSourcesBuildPhase section */
293304

305+
/* Begin PBXTargetDependency section */
306+
F62417D614D50869003CE997 /* PBXTargetDependency */ = {
307+
isa = PBXTargetDependency;
308+
target = F6B2082C1450F597009315AF /* SocketRocket */;
309+
targetProxy = F62417D514D50869003CE997 /* PBXContainerItemProxy */;
310+
};
311+
/* End PBXTargetDependency section */
312+
294313
/* Begin PBXVariantGroup section */
295314
F6BDA80A145900D200FE3253 /* InfoPlist.strings */ = {
296315
isa = PBXVariantGroup;

SocketRocket.xcodeproj/xcshareddata/xcschemes/SocketRocket.xcscheme

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
3232
<ActionContent
3333
title = "Run Script"
34-
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"
34+
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"
3535
shellToInvoke = "/bin/bash">
3636
<EnvironmentBuildable>
3737
<BuildableReference
@@ -101,12 +101,6 @@
101101
buildConfiguration = "Debug"
102102
debugDocumentVersioning = "YES"
103103
allowLocationSimulation = "YES">
104-
<CommandLineArguments>
105-
<CommandLineArgument
106-
argument = "SR_TESTHARNESS_KEY"
107-
isEnabled = "YES">
108-
</CommandLineArgument>
109-
</CommandLineArguments>
110104
<AdditionalOptions>
111105
</AdditionalOptions>
112106
</LaunchAction>

TestSupport/run_test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export MACOSX_DEPLOYMENT_TARGET="10.7"
2+
3+
TEST_SCENARIOS=$1
4+
TEST_KEY=$2
5+
SDK=$3
6+
7+
export SR_TESTHARNESS_KEY=$TEST_KEY
8+
9+
bash TestSupport/ensure_virtualenv.sh .env
10+
11+
.env/bin/sr-testharness -k $TEST_KEY -i '' -c "$TEST_SCENARIOS" &
12+
13+
CHILD_PID=$!
14+
15+
xcodebuild -target SocketRocket -sdk $SDK -configuration Debug clean
16+
xcodebuild -target SRWebSocketTests -sdk $SDK -configuration Debug clean build
17+
18+
kill $CHILD_PID

0 commit comments

Comments
 (0)