Skip to content

Commit e2a8c76

Browse files
authored
Merge 1271d8c into cdf9acd
2 parents cdf9acd + 1271d8c commit e2a8c76

File tree

44 files changed

+153
-361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+153
-361
lines changed

Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
7BFC8B0626D4D24B000D3504 /* LoremIpsum.txt in Resources */ = {isa = PBXBuildFile; fileRef = 7BFC8B0526D4D24B000D3504 /* LoremIpsum.txt */; };
2222
844DA821282584C300E6B62E /* CoreDataViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F57BC427BBD787000D09D4 /* CoreDataViewController.swift */; };
2323
844DA822282584F700E6B62E /* SentryData.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = D845F35927BAD4CC00A4D7A2 /* SentryData.xcdatamodeld */; };
24+
84732B28292F0BE600790372 /* SentryBaseUnitTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84732B27292F0BE600790372 /* SentryBaseUnitTest.swift */; };
2425
848A256B286E3351008A8858 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; };
2526
848A256D286E3351008A8858 /* fatal-error-binary-images-message2.json in Resources */ = {isa = PBXBuildFile; fileRef = D83A30DF279F1F5C00372D0A /* fatal-error-binary-images-message2.json */; };
2627
848A256F286E3351008A8858 /* Sentry.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 630853322440C44F00DDE4CE /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
@@ -250,6 +251,7 @@
250251
7B64386C26A6C544000D0F65 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
251252
7B79000329028C7300A7F467 /* MetricKitManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MetricKitManager.swift; sourceTree = "<group>"; };
252253
7BFC8B0526D4D24B000D3504 /* LoremIpsum.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = LoremIpsum.txt; sourceTree = "<group>"; };
254+
84732B27292F0BE600790372 /* SentryBaseUnitTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryBaseUnitTest.swift; sourceTree = "<group>"; };
253255
848A2573286E3351008A8858 /* PerformanceBenchmarks.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PerformanceBenchmarks.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
254256
848A2578286E3490008A8858 /* PerformanceBenchmarks-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PerformanceBenchmarks-Info.plist"; sourceTree = "<group>"; };
255257
84B527B728DD24BA00475E8D /* SentryDeviceTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SentryDeviceTests.mm; path = ../../../Tests/SentryTests/Helper/SentryDeviceTests.mm; sourceTree = "<group>"; };
@@ -426,6 +428,7 @@
426428
D83A30DF279F1F5C00372D0A /* fatal-error-binary-images-message2.json */,
427429
7B64386A26A6C544000D0F65 /* LaunchUITests.swift */,
428430
D83A30E5279FE21F00372D0A /* SentryFileIOTrackingIntegrationTests.swift */,
431+
84732B27292F0BE600790372 /* SentryBaseUnitTest.swift */,
429432
84B527B728DD24BA00475E8D /* SentryDeviceTests.mm */,
430433
84B527BB28DD25E400475E8D /* SentryDevice.h */,
431434
84B527BC28DD25E400475E8D /* SentryDevice.mm */,
@@ -834,6 +837,7 @@
834837
84B527B928DD24BA00475E8D /* SentryDeviceTests.mm in Sources */,
835838
D83A30E6279FE21F00372D0A /* SentryFileIOTrackingIntegrationTests.swift in Sources */,
836839
7B64386B26A6C544000D0F65 /* LaunchUITests.swift in Sources */,
840+
84732B28292F0BE600790372 /* SentryBaseUnitTest.swift in Sources */,
837841
84B527BD28DD25E400475E8D /* SentryDevice.mm in Sources */,
838842
D83A30C8279EFD6E00372D0A /* ClearTestState.swift in Sources */,
839843
);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// This is a dummy copy of SentryBaseUnitTest to be used by SentryFileIOTrackingIntegrationTests when compiled into iOS-SwiftUITests
2+
3+
import XCTest
4+
5+
class SentryBaseUnitTest: XCTestCase {}

Sentry.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@
513513
7BCFBD6D2681D0A900BC27D8 /* SentryCrashScopeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BCFBD6C2681D0A900BC27D8 /* SentryCrashScopeObserver.h */; };
514514
7BCFBD6F2681D0EE00BC27D8 /* SentryCrashScopeObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BCFBD6E2681D0EE00BC27D8 /* SentryCrashScopeObserver.m */; };
515515
7BD337E424A356180050DB6E /* SentryCrashIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BD337E324A356180050DB6E /* SentryCrashIntegrationTests.swift */; };
516-
7BD47B4E268F0B470076A663 /* ClearTestState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BD47B4C268F0B080076A663 /* ClearTestState.swift */; };
517516
7BD4BD4127EB0F0D0071F4FF /* SentryDiscardReason.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BD4BD4027EB0F0C0071F4FF /* SentryDiscardReason.h */; };
518517
7BD4BD4327EB29BA0071F4FF /* SentryClientReport.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BD4BD4227EB29BA0071F4FF /* SentryClientReport.h */; };
519518
7BD4BD4527EB29F50071F4FF /* SentryClientReport.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BD4BD4427EB29F50071F4FF /* SentryClientReport.m */; };
@@ -602,6 +601,7 @@
602601
8419C0C428C1889D001C8259 /* SentryProfilerSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8419C0C328C1889D001C8259 /* SentryProfilerSwiftTests.swift */; };
603602
8453421228BE855D00C22EEC /* SentrySampleDecision.m in Sources */ = {isa = PBXBuildFile; fileRef = 8453421128BE855D00C22EEC /* SentrySampleDecision.m */; };
604603
8453421628BE8A9500C22EEC /* SentrySpanStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 8453421528BE8A9500C22EEC /* SentrySpanStatus.m */; };
604+
84732A71292C3CF800790372 /* SentryBaseUnitTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84732A70292C3CF800790372 /* SentryBaseUnitTest.swift */; };
605605
84A888FD28D9B11700C51DFD /* SentryProfiler+Test.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A888FC28D9B11700C51DFD /* SentryProfiler+Test.h */; };
606606
84A8891C28DBD28900C51DFD /* SentryDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A8891A28DBD28900C51DFD /* SentryDevice.h */; };
607607
84A8891D28DBD28900C51DFD /* SentryDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84A8891B28DBD28900C51DFD /* SentryDevice.mm */; };
@@ -1290,7 +1290,6 @@
12901290
7BCFBD6C2681D0A900BC27D8 /* SentryCrashScopeObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryCrashScopeObserver.h; path = include/SentryCrashScopeObserver.h; sourceTree = "<group>"; };
12911291
7BCFBD6E2681D0EE00BC27D8 /* SentryCrashScopeObserver.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryCrashScopeObserver.m; sourceTree = "<group>"; };
12921292
7BD337E324A356180050DB6E /* SentryCrashIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashIntegrationTests.swift; sourceTree = "<group>"; };
1293-
7BD47B4C268F0B080076A663 /* ClearTestState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClearTestState.swift; sourceTree = "<group>"; };
12941293
7BD4BD4027EB0F0C0071F4FF /* SentryDiscardReason.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDiscardReason.h; path = include/SentryDiscardReason.h; sourceTree = "<group>"; };
12951294
7BD4BD4227EB29BA0071F4FF /* SentryClientReport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryClientReport.h; path = include/SentryClientReport.h; sourceTree = "<group>"; };
12961295
7BD4BD4427EB29F50071F4FF /* SentryClientReport.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryClientReport.m; sourceTree = "<group>"; };
@@ -1413,6 +1412,7 @@
14131412
844DA81F28246DE300E6B62E /* scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = scripts; sourceTree = "<group>"; };
14141413
8453421128BE855D00C22EEC /* SentrySampleDecision.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySampleDecision.m; sourceTree = "<group>"; };
14151414
8453421528BE8A9500C22EEC /* SentrySpanStatus.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySpanStatus.m; sourceTree = "<group>"; };
1415+
84732A70292C3CF800790372 /* SentryBaseUnitTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SentryBaseUnitTest.swift; sourceTree = "<group>"; };
14161416
84A888FC28D9B11700C51DFD /* SentryProfiler+Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "SentryProfiler+Test.h"; path = "Sources/Sentry/include/SentryProfiler+Test.h"; sourceTree = SOURCE_ROOT; };
14171417
84A8891A28DBD28900C51DFD /* SentryDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDevice.h; path = include/SentryDevice.h; sourceTree = "<group>"; };
14181418
84A8891B28DBD28900C51DFD /* SentryDevice.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryDevice.mm; sourceTree = "<group>"; };
@@ -1962,7 +1962,6 @@
19621962
639889D21EDF06C100EA7442 /* SentryTests-Bridging-Header.h */,
19631963
63AA75951EB8AEDB00D153DE /* SentryTests.m */,
19641964
7B9421C4260CA393001F9349 /* SentrySDK+Tests.h */,
1965-
7BD47B4C268F0B080076A663 /* ClearTestState.swift */,
19661965
7BA8409F24A1EC6E00B718AA /* SentrySDKTests.swift */,
19671966
630436151EC0AD3100C4D3FA /* SentryNSDataCompressionTests.m */,
19681967
630C01931EC3402C00C52CEF /* SentryKSCrashReportConverterTests.m */,
@@ -1981,6 +1980,7 @@
19811980
7B0002312477F0520035FEF1 /* SentrySessionTests.m */,
19821981
7B0002332477F52D0035FEF1 /* SentrySessionTests.swift */,
19831982
7B944FAF2469B46000A10721 /* TestClient.swift */,
1983+
84732A70292C3CF800790372 /* SentryBaseUnitTest.swift */,
19841984
7B0A54552523178700A71716 /* SentryScopeSwiftTests.swift */,
19851985
8E70B10025CB8695002B3155 /* SentrySpanIdTests.swift */,
19861986
7B4260332630315C00B36EDD /* SampleError.swift */,
@@ -3657,6 +3657,7 @@
36573657
63FE722220DA66EC00CDBAE8 /* SentryCrashJSONCodec_Tests.m in Sources */,
36583658
7B0A5452252311CE00A71716 /* SentryBreadcrumbTests.swift in Sources */,
36593659
7BA0C04A280563AA003E0326 /* TestTransportAdapter.swift in Sources */,
3660+
84732A71292C3CF800790372 /* SentryBaseUnitTest.swift in Sources */,
36603661
7BE3C7752445C82300A38442 /* SentryCurrentDateTests.swift in Sources */,
36613662
7B3398672459C4AE00BD9C96 /* SentryEnvelopeRateLimitTests.swift in Sources */,
36623663
8EA9AF492665AC48002771B4 /* SentryPerformanceTrackerTests.swift in Sources */,
@@ -3756,7 +3757,6 @@
37563757
7BC6EC18255C44540059822A /* SentryDebugMetaTests.swift in Sources */,
37573758
A811D867248E2770008A41EA /* SentrySystemEventBreadcrumbsTest.swift in Sources */,
37583759
7B82D54924E2A2D400EE670F /* SentryIdTests.swift in Sources */,
3759-
7BD47B4E268F0B470076A663 /* ClearTestState.swift in Sources */,
37603760
7B6D98ED24C703F8005502FA /* Async.swift in Sources */,
37613761
7BA0C04C28056556003E0326 /* SentryTransportAdapterTests.swift in Sources */,
37623762
7BE0DC29272A9E1C004FA8B7 /* SentryBreadcrumbTrackerTests.swift in Sources */,

Sources/SentryCrash/Recording/Tools/SentryCrashFileUtils.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ sentrycrashfu_removeFile(const char *path, bool mustExist)
394394
bool
395395
sentrycrashfu_deleteContentsOfPath(const char *path)
396396
{
397+
if (path == NULL) {
398+
return false;
399+
}
400+
397401
if (!canDeletePath(path)) {
398402
return false;
399403
}

Tests/SentryTests/ClearTestState.swift

Lines changed: 0 additions & 30 deletions
This file was deleted.

Tests/SentryTests/Helper/SentrySwizzleWrapperTests.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extension SentrySwizzleWrapper {
1212

1313
}
1414

15-
class SentrySwizzleWrapperTests: XCTestCase {
15+
class SentrySwizzleWrapperTests: SentryBaseUnitTest {
1616

1717
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
1818

@@ -31,16 +31,10 @@ class SentrySwizzleWrapperTests: XCTestCase {
3131

3232
override func setUp() {
3333
super.setUp()
34-
3534
fixture = Fixture()
3635
sut = SentrySwizzleWrapper.sharedInstance
3736
}
38-
39-
override func tearDown() {
40-
super.tearDown()
41-
clearTestState()
42-
}
43-
37+
4438
func testSendAction_RegisterCallbacks_CallbacksCalled() {
4539
let firstExpectation = expectation(description: "first")
4640
sut.swizzleSendAction({ actualAction, _, _, actualEvent in

Tests/SentryTests/Integrations/ANR/SentryANRTrackingIntegrationTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class SentryANRTrackingIntegrationTests: SentrySDKIntegrationTestsBase {
2828

2929
override func tearDown() {
3030
sut.uninstall()
31-
clearTestState()
3231
super.tearDown()
3332
}
3433

Tests/SentryTests/Integrations/Breadcrumbs/SentryAutoBreadcrumbTrackingIntegrationTests.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Sentry
22
import XCTest
33

4-
class SentryAutoBreadcrumbTrackingIntegrationTests: XCTestCase {
4+
class SentryAutoBreadcrumbTrackingIntegrationTests: SentryBaseUnitTest {
55

66
private class Fixture {
77
let tracker = SentryTestBreadcrumbTracker(swizzleWrapper: SentrySwizzleWrapper.sharedInstance)
@@ -18,11 +18,6 @@ class SentryAutoBreadcrumbTrackingIntegrationTests: XCTestCase {
1818
fixture = Fixture()
1919
}
2020

21-
override func tearDown() {
22-
super.tearDown()
23-
clearTestState()
24-
}
25-
2621
func testInstallWithSwizzleEnabled_StartSwizzleCalled() {
2722
let sut = fixture.sut
2823

Tests/SentryTests/Integrations/Breadcrumbs/SentryBreadcrumbTrackerTests.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import XCTest
22

3-
class SentryBreadcrumbTrackerTests: XCTestCase {
3+
class SentryBreadcrumbTrackerTests: SentryBaseUnitTest {
44

55
private var scope: Scope!
66

@@ -12,12 +12,7 @@ class SentryBreadcrumbTrackerTests: XCTestCase {
1212
let hub = TestHub(client: client, andScope: scope)
1313
SentrySDK.setCurrentHub(hub)
1414
}
15-
16-
override func tearDown() {
17-
super.tearDown()
18-
clearTestState()
19-
}
20-
15+
2116
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
2217

2318
func testStopRemovesSwizzleSendAction() {

Tests/SentryTests/Integrations/Breadcrumbs/SentrySystemEventBreadcrumbsTest.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testable import Sentry
22
import XCTest
33

4-
class SentrySystemEventBreadcrumbsTest: XCTestCase {
4+
class SentrySystemEventBreadcrumbsTest: SentryBaseUnitTest {
55

66
// This feature only works on iOS
77
#if os(iOS)
@@ -59,8 +59,6 @@ class SentrySystemEventBreadcrumbsTest: XCTestCase {
5959

6060
override func tearDown() {
6161
super.tearDown()
62-
clearTestState()
63-
fixture.fileManager.deleteTimezoneOffset()
6462
sut.stop()
6563
}
6664

0 commit comments

Comments
 (0)