diff --git a/Project-IPhone/YAJLIPhone.xcodeproj/project.pbxproj b/Project-IPhone/YAJLIPhone.xcodeproj/project.pbxproj index 4fd1974..278c9ef 100644 --- a/Project-IPhone/YAJLIPhone.xcodeproj/project.pbxproj +++ b/Project-IPhone/YAJLIPhone.xcodeproj/project.pbxproj @@ -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 */; }; @@ -204,6 +205,7 @@ 005BF30210185B7600C35A81 /* object_expected_array.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = object_expected_array.json; sourceTree = ""; }; 005BF35B10185F7E00C35A81 /* stream_array1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stream_array1.json; sourceTree = ""; }; 005BF35C10185F7E00C35A81 /* stream_array2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stream_array2.json; sourceTree = ""; }; + 00A59CE9109014550032BD92 /* error2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = error2.json; sourceTree = ""; }; 00ABD2EC0FFA0C1800965787 /* overflow.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = overflow.json; sourceTree = ""; }; 00ABD2ED0FFA0C1800965787 /* stream1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stream1.json; sourceTree = ""; }; 00ABD2EE0FFA0C1800965787 /* stream2.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stream2.json; sourceTree = ""; }; @@ -422,6 +424,7 @@ 00C4056E0FE777B4003CE908 /* Samples */ = { isa = PBXGroup; children = ( + 00A59CE9109014550032BD92 /* error2.json */, 005BF35B10185F7E00C35A81 /* stream_array1.json */, 005BF35C10185F7E00C35A81 /* stream_array2.json */, 005BF30010185B7600C35A81 /* gen_expected1.json */, @@ -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; }; @@ -671,7 +675,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = ""; + shellScript = "Libraries/libGHUnitIPhone3_0-0.4.13/RunTests.sh"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Project/Makefile b/Project/Makefile new file mode 100644 index 0000000..1514a72 --- /dev/null +++ b/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 + diff --git a/Project/YAJL.xcodeproj/project.pbxproj b/Project/YAJL.xcodeproj/project.pbxproj index aeff454..3f68970 100644 --- a/Project/YAJL.xcodeproj/project.pbxproj +++ b/Project/YAJL.xcodeproj/project.pbxproj @@ -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 */; }; @@ -84,6 +85,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 00A59D30109017410032BD92 /* YAJL.framework in CopyFiles */, 0041A106107E66B9001DDCA8 /* GHUnit.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; @@ -425,6 +427,7 @@ 00E5DDF50F5B6E3E00C11F1D /* Sources */, 00E5DDF60F5B6E3E00C11F1D /* Frameworks */, 00C4FD960FE5F94D003CE908 /* CopyFiles */, + 00A59CFD109014E80032BD92 /* ShellScript */, ); buildRules = ( ); @@ -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; diff --git a/Tests/RunTests.sh b/Tests/RunTests.sh new file mode 100755 index 0000000..2cc1508 --- /dev/null +++ b/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 + +