From 21c17dd188f50267276c1b5964774640be501c70 Mon Sep 17 00:00:00 2001 From: Ryan Wilson Date: Wed, 23 May 2018 10:31:30 -0400 Subject: Bump version numbers for 5.1.0 (#1320) * Bump version numbers for 5.1.0 * Update push pods script for releasing SDKs. * Fix Core library version string. --- Firestore/Example/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Firestore/Example/Podfile') diff --git a/Firestore/Example/Podfile b/Firestore/Example/Podfile index 26af4cd..88cf93a 100644 --- a/Firestore/Example/Podfile +++ b/Firestore/Example/Podfile @@ -10,7 +10,7 @@ target 'Firestore_Example_iOS' do # The next line is the forcing function for the Firebase pod. The Firebase # version's subspecs should depend on the component versions in their # corresponding podspec's. - pod 'Firebase/Core', '5.0.1' + pod 'Firebase/Core', '5.1.0' pod 'FirebaseAuth', :path => '../../' pod 'FirebaseCore', :path => '../../' -- cgit v1.2.3 From a135ee17175f8f186e73252263b8dbc3785f3d3c Mon Sep 17 00:00:00 2001 From: Mina Farid Date: Mon, 4 Jun 2018 14:36:55 -0400 Subject: Add a new Xcode target and scheme for fuzz tests (#1364) Created `Firestore_FuzzTests_iOS` Xcode target as a duplicate of the target `Firestore_Tests_iOS`. - Added `-fsanitize-coverage=trace-pc-guard` to the compiler flags to enable code coverage by libFuzzer fuzzing driver. - Modified the files to compile to the fuzz testing ones. - Added a Principal testing class. * Modified the `Podfile` to include `LibFuzzer.podspec` as a dependency for the target `Firestore_FuzzTests_iOS`. * Added a skeleton for fuzz testing. Currently does not test any code but the fuzzing works fine and calls an empty `LLVMFuzzerTestOneInput` with different input values. - This means that fuzzing does not finish or crash. --- .../Example/Firestore.xcodeproj/project.pbxproj | 196 ++++++++++++++++++++- .../xcschemes/Firestore_FuzzTests_iOS.xcscheme | 57 ++++++ .../Example/FuzzTests/FSTFuzzTestsPrincipal.mm | 64 +++++++ .../FuzzTests/Firestore_FuzzTests_iOS-Info.plist | 24 +++ Firestore/Example/Podfile | 6 + 5 files changed, 345 insertions(+), 2 deletions(-) create mode 100644 Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_FuzzTests_iOS.xcscheme create mode 100644 Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm create mode 100644 Firestore/Example/FuzzTests/Firestore_FuzzTests_iOS-Info.plist (limited to 'Firestore/Example/Podfile') diff --git a/Firestore/Example/Firestore.xcodeproj/project.pbxproj b/Firestore/Example/Firestore.xcodeproj/project.pbxproj index 9207ad2..b366cb9 100644 --- a/Firestore/Example/Firestore.xcodeproj/project.pbxproj +++ b/Firestore/Example/Firestore.xcodeproj/project.pbxproj @@ -145,6 +145,10 @@ 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 6161B5032047140C00A99DBB /* FIRFirestoreSourceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6161B5012047140400A99DBB /* FIRFirestoreSourceTests.mm */; }; + 6EDD3B4620BF247500C33877 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; + 6EDD3B4820BF247500C33877 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; + 6EDD3B4920BF247500C33877 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; + 6EDD3B6020BF25AE00C33877 /* FSTFuzzTestsPrincipal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6EDD3B5E20BF24D000C33877 /* FSTFuzzTestsPrincipal.mm */; }; 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; 7346E61D20325C6900FD6CEF /* FSTDispatchQueueTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7346E61C20325C6900FD6CEF /* FSTDispatchQueueTests.mm */; }; 73866AA12082B0A5009BB4FF /* FIRArrayTransformTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 73866A9F2082B069009BB4FF /* FIRArrayTransformTests.mm */; }; @@ -181,6 +185,7 @@ B6FB4690208F9BB300554BA2 /* executor_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B6FB4688208F9B9100554BA2 /* executor_test.cc */; }; BF219E98F1C5A1DAEB5EEC86 /* Pods_Firestore_Example_iOS_SwiftBuildTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 379B34A1536045869826D82A /* Pods_Firestore_Example_iOS_SwiftBuildTest.framework */; }; C1AA536F90A0A576CA2816EB /* Pods_Firestore_Example_iOS_Firestore_SwiftTests_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BB92EB03E3F92485023F64ED /* Pods_Firestore_Example_iOS_Firestore_SwiftTests_iOS.framework */; }; + C482E724F4B10968417C3F78 /* Pods_Firestore_FuzzTests_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B79CA87A1A01FC5329031C9B /* Pods_Firestore_FuzzTests_iOS.framework */; }; C80B10E79CDD7EF7843C321E /* type_traits_apple_test.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2A0CF41BA5AED6049B0BEB2C /* type_traits_apple_test.mm */; }; C8D3CE2343E53223E6487F2C /* Pods_Firestore_Example_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5918805E993304321A05E82B /* Pods_Firestore_Example_iOS.framework */; }; DE03B2D41F2149D600A30B9C /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; @@ -217,6 +222,13 @@ remoteGlobalIDString = 6003F589195388D20070C39A; remoteInfo = Firestore; }; + 6EDD3AD320BF247500C33877 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6003F582195388D10070C39A /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6003F589195388D20070C39A; + remoteInfo = Firestore; + }; DE03B2961F2149D600A30B9C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 6003F582195388D10070C39A /* Project object */; @@ -253,7 +265,7 @@ 1277F98C20D2DF0867496976 /* Pods-Firestore_IntegrationTests_iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_IntegrationTests_iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_IntegrationTests_iOS/Pods-Firestore_IntegrationTests_iOS.debug.xcconfig"; sourceTree = ""; }; 12F4357299652983A615F886 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 132E36BB104830BD806351AC /* FSTLevelDBTransactionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTLevelDBTransactionTests.mm; sourceTree = ""; }; - 2A0CF41BA5AED6049B0BEB2C /* type_traits_apple_test.mm */ = {isa = PBXFileReference; includeInIndex = 1; path = type_traits_apple_test.mm; sourceTree = ""; }; + 2A0CF41BA5AED6049B0BEB2C /* type_traits_apple_test.mm */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.objcpp; path = type_traits_apple_test.mm; sourceTree = ""; }; 2B50B3A0DF77100EEE887891 /* Pods_Firestore_Tests_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Firestore_Tests_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 379B34A1536045869826D82A /* Pods_Firestore_Example_iOS_SwiftBuildTest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Firestore_Example_iOS_SwiftBuildTest.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3B843E4A1F3930A400548890 /* remote_store_spec_test.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = remote_store_spec_test.json; sourceTree = ""; }; @@ -396,13 +408,18 @@ 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 6161B5012047140400A99DBB /* FIRFirestoreSourceTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FIRFirestoreSourceTests.mm; sourceTree = ""; }; 69E6C311558EC77729A16CF1 /* Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS/Pods-Firestore_Example_iOS-Firestore_SwiftTests_iOS.debug.xcconfig"; sourceTree = ""; }; + 6EDD3B5B20BF247500C33877 /* Firestore_FuzzTests_iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Firestore_FuzzTests_iOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6EDD3B5C20BF247500C33877 /* Firestore_FuzzTests_iOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Firestore_FuzzTests_iOS-Info.plist"; sourceTree = ""; }; + 6EDD3B5E20BF24D000C33877 /* FSTFuzzTestsPrincipal.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTFuzzTestsPrincipal.mm; sourceTree = ""; }; 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 7346E61C20325C6900FD6CEF /* FSTDispatchQueueTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FSTDispatchQueueTests.mm; sourceTree = ""; }; 73866A9F2082B069009BB4FF /* FIRArrayTransformTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FIRArrayTransformTests.mm; sourceTree = ""; }; 74ACEC3603BE58B57A7E8D4C /* Pods-Firestore_Example_iOS-SwiftBuildTest.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Example_iOS-SwiftBuildTest.release.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Example_iOS-SwiftBuildTest/Pods-Firestore_Example_iOS-SwiftBuildTest.release.xcconfig"; sourceTree = ""; }; + 84434E57CA72951015FC71BC /* Pods-Firestore_FuzzTests_iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_FuzzTests_iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_FuzzTests_iOS/Pods-Firestore_FuzzTests_iOS.debug.xcconfig"; sourceTree = ""; }; 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 8E002F4AD5D9B6197C940847 /* Firestore.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Firestore.podspec; path = ../Firestore.podspec; sourceTree = ""; }; - 9CFD366B783AE27B9E79EE7A /* string_format_apple_test.mm */ = {isa = PBXFileReference; includeInIndex = 1; path = string_format_apple_test.mm; sourceTree = ""; }; + 97C492D2524E92927C11F425 /* Pods-Firestore_FuzzTests_iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_FuzzTests_iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_FuzzTests_iOS/Pods-Firestore_FuzzTests_iOS.release.xcconfig"; sourceTree = ""; }; + 9CFD366B783AE27B9E79EE7A /* string_format_apple_test.mm */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.objcpp; path = string_format_apple_test.mm; sourceTree = ""; }; AB356EF6200EA5EB0089B766 /* field_value_test.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = field_value_test.cc; sourceTree = ""; }; AB380CF82019382300D97691 /* target_id_generator_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = target_id_generator_test.cc; sourceTree = ""; }; AB380CFC201A2EE200D97691 /* string_util_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = string_util_test.cc; sourceTree = ""; }; @@ -435,6 +452,7 @@ B6FB4688208F9B9100554BA2 /* executor_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = executor_test.cc; sourceTree = ""; }; B6FB4689208F9B9100554BA2 /* executor_libdispatch_test.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = executor_libdispatch_test.mm; sourceTree = ""; }; B6FB468A208F9B9100554BA2 /* executor_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = executor_test.h; sourceTree = ""; }; + B79CA87A1A01FC5329031C9B /* Pods_Firestore_FuzzTests_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Firestore_FuzzTests_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BB92EB03E3F92485023F64ED /* Pods_Firestore_Example_iOS_Firestore_SwiftTests_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Firestore_Example_iOS_Firestore_SwiftTests_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D3CC3DC5338DCAF43A211155 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; DE03B2E91F2149D600A30B9C /* Firestore_IntegrationTests_iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Firestore_IntegrationTests_iOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -489,6 +507,17 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6EDD3B4520BF247500C33877 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6EDD3B4620BF247500C33877 /* Foundation.framework in Frameworks */, + C482E724F4B10968417C3F78 /* Pods_Firestore_FuzzTests_iOS.framework in Frameworks */, + 6EDD3B4820BF247500C33877 /* UIKit.framework in Frameworks */, + 6EDD3B4920BF247500C33877 /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; DE03B2D31F2149D600A30B9C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -630,6 +659,7 @@ 6003F581195388D10070C39A = { isa = PBXGroup; children = ( + 6EDD3B5D20BF24A700C33877 /* FuzzTests */, 543B4F0520A91E4B001F506D /* App */, 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 6003F5B5195388D20070C39A /* Tests */, @@ -646,6 +676,7 @@ isa = PBXGroup; children = ( 6003F58A195388D20070C39A /* Firestore_Example_iOS.app */, + 6EDD3B5B20BF247500C33877 /* Firestore_FuzzTests_iOS.xctest */, DE03B2E91F2149D600A30B9C /* Firestore_IntegrationTests_iOS.xctest */, 54C9EDF12040E16300A969CD /* Firestore_SwiftTests_iOS.xctest */, 6003F5AE195388D20070C39A /* Firestore_Tests_iOS.xctest */, @@ -662,6 +693,7 @@ 5918805E993304321A05E82B /* Pods_Firestore_Example_iOS.framework */, BB92EB03E3F92485023F64ED /* Pods_Firestore_Example_iOS_Firestore_SwiftTests_iOS.framework */, 379B34A1536045869826D82A /* Pods_Firestore_Example_iOS_SwiftBuildTest.framework */, + B79CA87A1A01FC5329031C9B /* Pods_Firestore_FuzzTests_iOS.framework */, ECEBABC7E7B693BE808A1052 /* Pods_Firestore_IntegrationTests_iOS.framework */, 2B50B3A0DF77100EEE887891 /* Pods_Firestore_Tests_iOS.framework */, 6003F591195388D20070C39A /* UIKit.framework */, @@ -731,6 +763,15 @@ name = "Podspec Metadata"; sourceTree = ""; }; + 6EDD3B5D20BF24A700C33877 /* FuzzTests */ = { + isa = PBXGroup; + children = ( + 6EDD3B5E20BF24D000C33877 /* FSTFuzzTestsPrincipal.mm */, + 6EDD3B5C20BF247500C33877 /* Firestore_FuzzTests_iOS-Info.plist */, + ); + path = FuzzTests; + sourceTree = ""; + }; AAEA2A72CFD1FA5AD34462F7 /* Pods */ = { isa = PBXGroup; children = ( @@ -740,6 +781,8 @@ 74ACEC3603BE58B57A7E8D4C /* Pods-Firestore_Example_iOS-SwiftBuildTest.release.xcconfig */, 3C81DE3772628FE297055662 /* Pods-Firestore_Example_iOS.debug.xcconfig */, 3F0992A4B83C60841C52E960 /* Pods-Firestore_Example_iOS.release.xcconfig */, + 84434E57CA72951015FC71BC /* Pods-Firestore_FuzzTests_iOS.debug.xcconfig */, + 97C492D2524E92927C11F425 /* Pods-Firestore_FuzzTests_iOS.release.xcconfig */, 1277F98C20D2DF0867496976 /* Pods-Firestore_IntegrationTests_iOS.debug.xcconfig */, F354C0FE92645B56A6C6FD44 /* Pods-Firestore_IntegrationTests_iOS.release.xcconfig */, E592181BFD7C53C305123739 /* Pods-Firestore_Tests_iOS.debug.xcconfig */, @@ -1045,6 +1088,26 @@ productReference = 6003F5AE195388D20070C39A /* Firestore_Tests_iOS.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 6EDD3AD120BF247500C33877 /* Firestore_FuzzTests_iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6EDD3B5820BF247500C33877 /* Build configuration list for PBXNativeTarget "Firestore_FuzzTests_iOS" */; + buildPhases = ( + 6EDD3AD420BF247500C33877 /* [CP] Check Pods Manifest.lock */, + 6EDD3AD520BF247500C33877 /* Sources */, + 6EDD3B4520BF247500C33877 /* Frameworks */, + 6EDD3B4A20BF247500C33877 /* Resources */, + 6EDD3B5720BF247500C33877 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 6EDD3AD220BF247500C33877 /* PBXTargetDependency */, + ); + name = Firestore_FuzzTests_iOS; + productName = FirestoreTests; + productReference = 6EDD3B5B20BF247500C33877 /* Firestore_FuzzTests_iOS.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; DE03B2941F2149D600A30B9C /* Firestore_IntegrationTests_iOS */ = { isa = PBXNativeTarget; buildConfigurationList = DE03B2E61F2149D600A30B9C /* Build configuration list for PBXNativeTarget "Firestore_IntegrationTests_iOS" */; @@ -1104,6 +1167,9 @@ DevelopmentTeam = EQHXZ8M8AV; TestTargetID = 6003F589195388D20070C39A; }; + 6EDD3AD120BF247500C33877 = { + DevelopmentTeam = EQHXZ8M8AV; + }; DE03B2941F2149D600A30B9C = { DevelopmentTeam = EQHXZ8M8AV; }; @@ -1137,6 +1203,7 @@ DE03B2941F2149D600A30B9C /* Firestore_IntegrationTests_iOS */, DE29E7F51F2174B000909613 /* AllTests_iOS */, DE0761E31F2FE611003233AF /* SwiftBuildTest */, + 6EDD3AD120BF247500C33877 /* Firestore_FuzzTests_iOS */, ); }; /* End PBXProject section */ @@ -1179,6 +1246,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6EDD3B4A20BF247500C33877 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; DE03B2D81F2149D600A30B9C /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1310,6 +1384,42 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 6EDD3AD420BF247500C33877 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Firestore_FuzzTests_iOS-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 6EDD3B5720BF247500C33877 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-Firestore_FuzzTests_iOS/Pods-Firestore_FuzzTests_iOS-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/LibFuzzer/LibFuzzer.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LibFuzzer.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Firestore_FuzzTests_iOS/Pods-Firestore_FuzzTests_iOS-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 83F2AB95D08093BB076EE521 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1577,6 +1687,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6EDD3AD520BF247500C33877 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6EDD3B6020BF25AE00C33877 /* FSTFuzzTestsPrincipal.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; DE03B2981F2149D600A30B9C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1629,6 +1747,11 @@ target = 6003F589195388D20070C39A /* Firestore_Example_iOS */; targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; }; + 6EDD3AD220BF247500C33877 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6003F589195388D20070C39A /* Firestore_Example_iOS */; + targetProxy = 6EDD3AD320BF247500C33877 /* PBXContainerItemProxy */; + }; DE03B2951F2149D600A30B9C /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 6003F589195388D20070C39A /* Firestore_Example_iOS */; @@ -1948,6 +2071,66 @@ }; name = Release; }; + 6EDD3B5920BF247500C33877 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 84434E57CA72951015FC71BC /* Pods-Firestore_FuzzTests_iOS.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + DEVELOPMENT_TEAM = EQHXZ8M8AV; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "COCOAPODS=1", + "GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1", + ); + INFOPLIST_FILE = "FuzzTests/Firestore_FuzzTests_iOS-Info.plist"; + OTHER_CFLAGS = ( + "$(inherited)", + "-fsanitize-coverage=trace-pc-guard", + ); + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Firestore_Example_iOS.app/Firestore_Example_iOS"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 6EDD3B5A20BF247500C33877 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 97C492D2524E92927C11F425 /* Pods-Firestore_FuzzTests_iOS.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + DEVELOPMENT_TEAM = EQHXZ8M8AV; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "COCOAPODS=1", + "GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1", + ); + INFOPLIST_FILE = "FuzzTests/Firestore_FuzzTests_iOS-Info.plist"; + OTHER_CFLAGS = ( + "$(inherited)", + "-fsanitize-coverage=trace-pc-guard", + ); + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Firestore_Example_iOS.app/Firestore_Example_iOS"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; DE03B2E71F2149D600A30B9C /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1277F98C20D2DF0867496976 /* Pods-Firestore_IntegrationTests_iOS.debug.xcconfig */; @@ -2131,6 +2314,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 6EDD3B5820BF247500C33877 /* Build configuration list for PBXNativeTarget "Firestore_FuzzTests_iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6EDD3B5920BF247500C33877 /* Debug */, + 6EDD3B5A20BF247500C33877 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; DE03B2E61F2149D600A30B9C /* Build configuration list for PBXNativeTarget "Firestore_IntegrationTests_iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_FuzzTests_iOS.xcscheme b/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_FuzzTests_iOS.xcscheme new file mode 100644 index 0000000..039273b --- /dev/null +++ b/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_FuzzTests_iOS.xcscheme @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm b/Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm new file mode 100644 index 0000000..63f6db0 --- /dev/null +++ b/Firestore/Example/FuzzTests/FSTFuzzTestsPrincipal.mm @@ -0,0 +1,64 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#include "LibFuzzer/FuzzerDefs.h" + +namespace { + +// Contains the code to be fuzzed. Called by the fuzzing library with +// different argument values for `data` and `size`. +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + // Code to be fuzz-tested here. + return 0; +} + +// Simulates calling the main() function of libFuzzer (FuzzerMain.cpp). +int RunFuzzTestingMain() { + // Arguments to libFuzzer main() function should be added to this array, + // e.g., dictionaries, corpus, number of runs, jobs, etc. + char *program_args[] = { + const_cast("RunFuzzTestingMain") // First argument is program name. + }; + char **argv = program_args; + int argc = sizeof(program_args) / sizeof(program_args[0]); + + // Start fuzzing using libFuzzer's driver. + return fuzzer::FuzzerDriver(&argc, &argv, LLVMFuzzerTestOneInput); +} + +} // namespace + +/** + * This class is registered as the NSPrincipalClass in the + * Firestore_FuzzTests_iOS bundle's Info.plist. XCTest instantiates this class + * to perform one-time setup for the test bundle, as documented here: + * + * https://developer.apple.com/documentation/xctest/xctestobservationcenter + */ +@interface FSTFuzzTestsPrincipal : NSObject +@end + +@implementation FSTFuzzTestsPrincipal + +- (instancetype)init { + self = [super init]; + RunFuzzTestingMain(); + return self; +} + +@end diff --git a/Firestore/Example/FuzzTests/Firestore_FuzzTests_iOS-Info.plist b/Firestore/Example/FuzzTests/Firestore_FuzzTests_iOS-Info.plist new file mode 100644 index 0000000..0d53e5f --- /dev/null +++ b/Firestore/Example/FuzzTests/Firestore_FuzzTests_iOS-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + NSPrincipalClass + FSTFuzzTestsPrincipal + CFBundleVersion + 1 + + diff --git a/Firestore/Example/Podfile b/Firestore/Example/Podfile index 88cf93a..dc5af48 100644 --- a/Firestore/Example/Podfile +++ b/Firestore/Example/Podfile @@ -37,4 +37,10 @@ target 'Firestore_Example_iOS' do target 'SwiftBuildTest' do platform :ios, '8.0' end + + target 'Firestore_FuzzTests_iOS' do + inherit! :search_paths + + pod 'LibFuzzer', :podspec => 'LibFuzzer.podspec' + end end -- cgit v1.2.3