Skip to content

Commit 444f084

Browse files
committed
Make the testing framework handle MacOS and iOS separately
The testing framework was originally using just __APPLE__ to identify if a build was for iOS. Unfortunately this is also true for MacOS. MacOS can be identified by checking TARGET_OS_IPHONE, after including TargetConditionals, so add the logic to do that. PiperOrigin-RevId: 273574985
1 parent 0bd6e40 commit 444f084

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

testing/reporter.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#include <utility>
66
#include <vector>
77

8+
#ifdef __APPLE__
9+
#include "TargetConditionals.h"
10+
#endif
11+
812
#include "testing/reporter.h"
913

1014
namespace firebase {
@@ -96,7 +100,7 @@ void Reporter::addExpectation(const ReportRow& expectation) {
96100
#if defined(FIREBASE_ANDROID_FOR_DESKTOP) || defined(__ANDROID__)
97101
if (expectation.getPlatform() == kAndroid)
98102
expectations_.push_back(expectation);
99-
#elif defined(__APPLE__)
103+
#elif defined(__APPLE__) && TARGET_OS_IPHONE
100104
if (expectation.getPlatform() == kIos) expectations_.push_back(expectation);
101105
#endif // defined(FIREBASE_ANDROID_FOR_DESKTOP) || defined(__ANDROID__)
102106
}

0 commit comments

Comments
 (0)