Skip to content

Commit

Permalink
Fixing tests; Adding Makefiles; make test
Browse files Browse the repository at this point in the history
(MacOSX make test crashes though)
  • Loading branch information
gabriel committed Oct 22, 2009
1 parent cacc717 commit bc3fd81
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Project-IPhone/YAJLIPhone.xcodeproj/project.pbxproj
Expand Up @@ -53,6 +53,7 @@
005BF31610185BA400C35A81 /* YAJLGen.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 005BF2D610185B3000C35A81 /* YAJLGen.h */; };
005BF35D10185F7E00C35A81 /* stream_array1.json in Resources */ = {isa = PBXBuildFile; fileRef = 005BF35B10185F7E00C35A81 /* stream_array1.json */; };
005BF35E10185F7E00C35A81 /* stream_array2.json in Resources */ = {isa = PBXBuildFile; fileRef = 005BF35C10185F7E00C35A81 /* stream_array2.json */; };
00A59CEA109014550032BD92 /* error2.json in Resources */ = {isa = PBXBuildFile; fileRef = 00A59CE9109014550032BD92 /* error2.json */; };
00ABD2EF0FFA0C1800965787 /* overflow.json in Resources */ = {isa = PBXBuildFile; fileRef = 00ABD2EC0FFA0C1800965787 /* overflow.json */; };
00ABD2F00FFA0C1800965787 /* stream1.json in Resources */ = {isa = PBXBuildFile; fileRef = 00ABD2ED0FFA0C1800965787 /* stream1.json */; };
00ABD2F10FFA0C1800965787 /* stream2.json in Resources */ = {isa = PBXBuildFile; fileRef = 00ABD2EE0FFA0C1800965787 /* stream2.json */; };
Expand Down Expand Up @@ -204,6 +205,7 @@
005BF30210185B7600C35A81 /* object_expected_array.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = object_expected_array.json; sourceTree = "<group>"; };
005BF35B10185F7E00C35A81 /* stream_array1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stream_array1.json; sourceTree = "<group>"; };
005BF35C10185F7E00C35A81 /* stream_array2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stream_array2.json; sourceTree = "<group>"; };
00A59CE9109014550032BD92 /* error2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = error2.json; sourceTree = "<group>"; };
00ABD2EC0FFA0C1800965787 /* overflow.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = overflow.json; sourceTree = "<group>"; };
00ABD2ED0FFA0C1800965787 /* stream1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stream1.json; sourceTree = "<group>"; };
00ABD2EE0FFA0C1800965787 /* stream2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stream2.json; sourceTree = "<group>"; };
Expand Down Expand Up @@ -422,6 +424,7 @@
00C4056E0FE777B4003CE908 /* Samples */ = {
isa = PBXGroup;
children = (
00A59CE9109014550032BD92 /* error2.json */,
005BF35B10185F7E00C35A81 /* stream_array1.json */,
005BF35C10185F7E00C35A81 /* stream_array2.json */,
005BF30010185B7600C35A81 /* gen_expected1.json */,
Expand Down Expand Up @@ -641,6 +644,7 @@
005BF35D10185F7E00C35A81 /* stream_array1.json in Resources */,
005BF35E10185F7E00C35A81 /* stream_array2.json in Resources */,
0041A1E7107E690E001DDCA8 /* RunTests.sh in Resources */,
00A59CEA109014550032BD92 /* error2.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -671,7 +675,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "";
shellScript = "Libraries/libGHUnitIPhone3_0-0.4.13/RunTests.sh";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
18 changes: 18 additions & 0 deletions Project/Makefile
@@ -0,0 +1,18 @@

TEST_TARGET=Tests
SDK=macosx10.5
COMMAND=xcodebuild

default:
# Set default make action here

docs:
cd .. && /Applications/Doxygen.app/Contents/Resources/doxygen

# If you need to clean a specific target/configuration: $(COMMAND) -target $(TARGET) -configuration DebugOrRelease -sdk $(SDK) clean
clean:
-rm -rf build/*

test:
GHUNIT_CLI=1 $(COMMAND) -target $(TEST_TARGET) -configuration Debug -sdk $(SDK) build

19 changes: 19 additions & 0 deletions Project/YAJL.xcodeproj/project.pbxproj
Expand Up @@ -24,6 +24,7 @@
008042121018480D0090C385 /* NSStringTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 008042111018480D0090C385 /* NSStringTest.m */; };
0080423B10184D8F0090C385 /* object_expected_array.json in Resources */ = {isa = PBXBuildFile; fileRef = 0080423A10184D6F0090C385 /* object_expected_array.json */; };
008B7C680FF9E82500C791B4 /* PerfTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 008B7C670FF9E82500C791B4 /* PerfTest.m */; };
00A59D30109017410032BD92 /* YAJL.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* YAJL.framework */; };
00ABD1500FF9F36400965787 /* NSObject+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 00C404750FE77543003CE908 /* NSObject+SBJSON.m */; };
00ABD1510FF9F36400965787 /* NSString+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 00C404770FE77543003CE908 /* NSString+SBJSON.m */; };
00ABD1520FF9F36500965787 /* SBJSONScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 00C404790FE77543003CE908 /* SBJSONScanner.m */; };
Expand Down Expand Up @@ -84,6 +85,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
00A59D30109017410032BD92 /* YAJL.framework in CopyFiles */,
0041A106107E66B9001DDCA8 /* GHUnit.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -425,6 +427,7 @@
00E5DDF50F5B6E3E00C11F1D /* Sources */,
00E5DDF60F5B6E3E00C11F1D /* Frameworks */,
00C4FD960FE5F94D003CE908 /* CopyFiles */,
00A59CFD109014E80032BD92 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -508,6 +511,22 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
00A59CFD109014E80032BD92 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "../Tests/RunTests.sh\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
00E5DDF50F5B6E3E00C11F1D /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
27 changes: 27 additions & 0 deletions Tests/RunTests.sh
@@ -0,0 +1,27 @@
#!/bin/sh

# If we aren't running from the command line, then exit
if [ "$GHUNIT_CLI" != "1" ]; then
exit 0
fi

export DYLD_ROOT_PATH="$SDKROOT"
export DYLD_FRAMEWORK_PATH="$CONFIGURATION_BUILD_DIR"
export IPHONE_SIMULATOR_ROOT="$SDKROOT"

export MallocScribble=YES
export MallocPreScribble=YES
export MallocGuardEdges=YES
export MallocStackLogging=YES
export MallocStackLoggingNoCompact=YES
export NSAutoreleaseFreedObjectCheckEnabled=YES

export CFZombieLevel=3
export NSZombieEnabled=YES

"$TARGET_BUILD_DIR/$EXECUTABLE_PATH" -RegisterForSystemEvents
RETVAL=$?

exit $RETVAL


0 comments on commit bc3fd81

Please sign in to comment.