Skip to content

Commit f26d72c

Browse files
committed
revert: "feat: visionOS unit tests"
1 parent 5715cf8 commit f26d72c

File tree

7 files changed

+26
-93
lines changed

7 files changed

+26
-93
lines changed

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ To start diving into the v8 iOS runtime make sure you have Xcode and [Homebrew](
55
# Install CMake
66
brew install cmake
77

8-
# Install jq (for scripting json replacements)
9-
brew install jq
10-
118
# (Optional) Install clang-format to format the code
129
brew install clang-format
1310

TestFixtures/Api/TNSVersions.h

+19-32
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
#define generateVersionDeclarations(V1, V2) \
2-
__attribute__((availability(ios, introduced = V1))) \
3-
__attribute__((availability(visionos, introduced = V1))) @interface TNSInterface \
4-
##V2##Plus : NSObject @end \
5-
\
6-
@interface TNSInterfaceMembers \
7-
##V2 : NSObject @property int property __attribute__((availability(ios, introduced = V1))) \
8-
__attribute__((availability(visionos, introduced = V1))); \
9-
\
10-
+(void)staticMethod __attribute__((availability(ios, introduced = V1))) \
11-
__attribute__((availability(visionos, introduced = V1))); \
12-
\
13-
-(void)instanceMethod __attribute__((availability(ios, introduced = V1))) \
14-
__attribute__((availability(visionos, introduced = V1))); \
15-
@end \
16-
\
17-
__attribute__((availability(ios, introduced = V1))) \
18-
__attribute__((availability(visionos, introduced = V1))) void TNSFunction##V2##Plus(); \
19-
\
20-
__attribute__((availability(ios, introduced = V1))) __attribute__( \
21-
(availability(visionos, introduced = V1))) extern const int TNSConstant##V2##Plus; \
22-
\
23-
enum TNSEnum##V2##Plus { TNSEnum##V2##Member } \
24-
__attribute__((availability(ios, introduced = V1))) \
25-
__attribute__((availability(visionos, introduced = V1)))
1+
#define generateVersionDeclarations(V1, V2) \
2+
__attribute__((availability(ios, introduced = V1))) @interface TNSInterface \
3+
##V2##Plus : NSObject @end \
4+
\
5+
@interface TNSInterfaceMembers \
6+
##V2 : NSObject @property int property __attribute__((availability(ios, introduced = V1))); \
7+
\
8+
+(void)staticMethod __attribute__((availability(ios, introduced = V1))); \
9+
\
10+
-(void)instanceMethod __attribute__((availability(ios, introduced = V1))); \
11+
@end \
12+
\
13+
__attribute__((availability(ios, introduced = V1))) void TNSFunction##V2##Plus(); \
14+
\
15+
__attribute__((availability(ios, introduced = V1))) extern const int TNSConstant##V2##Plus; \
16+
\
17+
enum TNSEnum##V2##Plus { TNSEnum##V2##Member } \
18+
__attribute__((availability(ios, introduced = V1)))
2619

2720
#ifndef generateVersionImpl
2821
#define generateVersion(V1, V2) generateVersionDeclarations(V1, V2)
@@ -52,8 +45,6 @@
5245
generateVersion(MAJOR##.4, MAJOR##_4); \
5346
generateVersion(MAJOR##.5, MAJOR##_5);
5447

55-
generateMinors(1);
56-
generateMinors(2);
5748
generateMinors(9);
5849
generateMinors(10);
5950
generateMinors(11);
@@ -67,7 +58,6 @@ generateMinors(15);
6758
#define MAX_AVAILABILITY 31.7
6859

6960
__attribute__((availability(ios, introduced = MAX_AVAILABILITY)))
70-
__attribute__((availability(visionos, introduced = MAX_AVAILABILITY)))
7161
@protocol TNSProtocolNeverAvailable<NSObject>
7262

7363
@property(class, readonly) int staticPropertyFromProtocolNeverAvailable;
@@ -84,9 +74,7 @@ __attribute__((availability(visionos, introduced = MAX_AVAILABILITY)))
8474

8575
@end
8676

87-
__attribute__((availability(ios, introduced = 1.0)))
88-
__attribute__((availability(visionos, introduced = 1.0)))
89-
@protocol TNSProtocolAlwaysAvailable<NSObject>
77+
__attribute__((availability(ios, introduced = 1.0))) @protocol TNSProtocolAlwaysAvailable<NSObject>
9078

9179
@property(class, readonly) int staticPropertyFromProtocolAlwaysAvailable;
9280

@@ -103,7 +91,6 @@ __attribute__((availability(visionos, introduced = 1.0)))
10391
@end
10492

10593
__attribute__((availability(ios, introduced = MAX_AVAILABILITY)))
106-
__attribute__((availability(visionos, introduced = MAX_AVAILABILITY)))
10794
@interface TNSInterfaceNeverAvailable : TNSInterfaceAlwaysAvailable
10895
@end
10996

TestFixtures/exported-symbols.txt

-9
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ _functionWithUShortPtr
5858
_TNSIsConfigurationDebug
5959
_TNSClearOutput
6060
_TNSConstant
61-
_TNSConstant1_0Plus
62-
_TNSConstant1_1Plus
63-
_TNSConstant1_2Plus
6461
_TNSConstant10_0Plus
6562
_TNSConstant10_1Plus
6663
_TNSConstant10_2Plus
@@ -97,18 +94,12 @@ _TNSConstant15_2Plus
9794
_TNSConstant15_3Plus
9895
_TNSConstant15_4Plus
9996
_TNSConstant15_5Plus
100-
_TNSConstant1_0Plus
101-
_TNSConstant1_1Plus
102-
_TNSConstant1_2Plus
10397
_TNSConstant9_0Plus
10498
_TNSConstant9_1Plus
10599
_TNSConstant9_2Plus
106100
_TNSConstant9_3Plus
107101
_TNSConstant9_4Plus
108102
_TNSConstant9_5Plus
109-
_TNSFunction1_0Plus
110-
_TNSFunction1_1Plus
111-
_TNSFunction1_2Plus
112103
_TNSFunction9_0Plus
113104
_TNSFunction9_1Plus
114105
_TNSFunction9_2Plus

TestRunner/app/tests/Infrastructure/simulator.js

-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,3 @@ function isSimulator() {
77
}
88

99
global.isSimulator = isSimulator();
10-
11-
function isVision() {
12-
return UIDevice.currentDevice.model.toLowerCase().includes('vision');
13-
}
14-
15-
global.isVision = isVision();

TestRunner/app/tests/MetadataTests.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ describe("Metadata", function () {
1010
const swiftLikeObj = TNSSwiftLikeFactory.create();
1111
expect(swiftLikeObj.constructor).toBe(global.TNSSwiftLike);
1212
expect(swiftLikeObj.constructor.name).toBe("_TtC17NativeScriptTests12TNSSwiftLike");
13-
let majorVersion = 13;
14-
let minorVersion = 4;
15-
if (isVision) {
16-
majorVersion = 1;
17-
minorVersion = 0;
18-
}
19-
var expectedName = NSProcessInfo.processInfo.isOperatingSystemAtLeastVersion({ majorVersion: majorVersion, minorVersion: minorVersion, patchVersion: 0 })
13+
var expectedName = NSProcessInfo.processInfo.isOperatingSystemAtLeastVersion({ majorVersion: 13, minorVersion: 4, patchVersion: 0 })
2014
? "_TtC17NativeScriptTests12TNSSwiftLike"
2115
: "NativeScriptTests.TNSSwiftLike";
2216
expect(NSString.stringWithUTF8String(class_getName(swiftLikeObj.constructor)).toString()).toBe(expectedName);

TestRunner/app/tests/VersionDiffTests.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,8 @@ describe(module.id, function() {
1717
}
1818

1919
function forEachVersion(action) {
20-
let majorMinVersion = 9;
21-
let majorMaxVersion = 15;
22-
let minorMaxVersion = 5;
23-
if (isVision) {
24-
majorMinVersion = 1;
25-
majorMaxVersion = 1;
26-
minorMaxVersion = 2;
27-
}
28-
for (var major = majorMinVersion; major <= majorMaxVersion; major++) {
29-
for (var minor = 0; minor <= minorMaxVersion; minor++) {
20+
for (var major = 9; major <= 15; major++) {
21+
for (var minor = 0; minor <= 5; minor++) {
3022
action(major, minor);
3123
}
3224
}
@@ -82,10 +74,6 @@ describe(module.id, function() {
8274
});
8375

8476
it("Base class which is unavailable should be skipped", function() {
85-
if (isVision) {
86-
pending();
87-
return;
88-
}
8977
// Test case inspired from MTLArrayType(8.0) : MTLType(11.0) : NSObject
9078
// TNSInterfaceNeverAvailableDescendant : TNSInterfaceNeverAvailable(API31.7 - skipped) : TNSInterfaceAlwaysAvailable
9179
expect(Object.getPrototypeOf(TNSInterfaceNeverAvailableDescendant).toString()).toBe(TNSInterfaceAlwaysAvailable.toString(), "TNSInterfaceNeverAvailable base class should be skipped as it is unavailable");

v8ios.xcodeproj/project.pbxproj

+4-22
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
2B5088A62BBEB92300F6EB68 /* metadata-arm64.bin in Resources */ = {isa = PBXBuildFile; fileRef = 2BFE21ED2AC1AC3100307752 /* metadata-arm64.bin */; };
1011
2B5088A72BBEC1BC00F6EB68 /* TNSWidgets.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C20525A72577D86600C12A5C /* TNSWidgets.xcframework */; };
12+
2B5088A82BBEC1BC00F6EB68 /* TNSWidgets.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C20525A72577D86600C12A5C /* TNSWidgets.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1113
2B7EA6AF2353477000E5184E /* NativeScriptException.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2B7EA6AD2353476F00E5184E /* NativeScriptException.mm */; };
1214
2B7EA6B02353477000E5184E /* NativeScriptException.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B7EA6AE2353477000E5184E /* NativeScriptException.h */; };
1315
2BFE22062AC1C93100307752 /* metadata-arm64.bin in Resources */ = {isa = PBXBuildFile; fileRef = 2BFE22052AC1C93100307752 /* metadata-arm64.bin */; };
@@ -1848,6 +1850,7 @@
18481850
files = (
18491851
C27E5DB522F3206B00498ED0 /* app in Resources */,
18501852
C27E5DBA22F324C200498ED0 /* [email protected] in Resources */,
1853+
2B5088A62BBEB92300F6EB68 /* metadata-arm64.bin in Resources */,
18511854
);
18521855
runOnlyForDeploymentPostprocessing = 0;
18531856
};
@@ -2287,6 +2290,7 @@
22872290
};
22882291
C293752B229FC4740075CB16 /* PBXTargetDependency */ = {
22892292
isa = PBXTargetDependency;
2293+
platformFilter = ios;
22902294
target = C29374E1229FC0F60075CB16 /* TestFixtures */;
22912295
targetProxy = C293752A229FC4740075CB16 /* PBXContainerItemProxy */;
22922296
};
@@ -2380,7 +2384,6 @@
23802384
C23992CE236C2D6E00D2F720 /* Debug */ = {
23812385
isa = XCBuildConfiguration;
23822386
buildSettings = {
2383-
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
23842387
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
23852388
CLANG_ENABLE_MODULES = NO;
23862389
CODE_SIGN_STYLE = Automatic;
@@ -2396,8 +2399,6 @@
23962399
);
23972400
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TestRunnerTests;
23982401
PRODUCT_NAME = "$(TARGET_NAME)";
2399-
SUPPORTED_PLATFORMS = "xrsimulator xros iphonesimulator iphoneos";
2400-
SUPPORTS_MACCATALYST = YES;
24012402
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
24022403
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
24032404
SWIFT_VERSION = 5.0;
@@ -2409,7 +2410,6 @@
24092410
C23992CF236C2D6E00D2F720 /* Release */ = {
24102411
isa = XCBuildConfiguration;
24112412
buildSettings = {
2412-
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
24132413
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
24142414
CLANG_ENABLE_MODULES = NO;
24152415
CODE_SIGN_STYLE = Automatic;
@@ -2425,8 +2425,6 @@
24252425
);
24262426
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.TestRunnerTests;
24272427
PRODUCT_NAME = "$(TARGET_NAME)";
2428-
SUPPORTED_PLATFORMS = "xrsimulator xros iphonesimulator iphoneos";
2429-
SUPPORTS_MACCATALYST = YES;
24302428
SWIFT_COMPILATION_MODE = wholemodule;
24312429
SWIFT_OPTIMIZATION_LEVEL = "-O";
24322430
SWIFT_VERSION = 5.0;
@@ -2559,7 +2557,6 @@
25592557
C27E5D9F22F31CCC00498ED0 /* Debug */ = {
25602558
isa = XCBuildConfiguration;
25612559
buildSettings = {
2562-
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
25632560
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
25642561
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
25652562
CLANG_CXX_LIBRARY = "compiler-default";
@@ -2591,16 +2588,13 @@
25912588
);
25922589
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.AppWithModules;
25932590
PRODUCT_NAME = "$(TARGET_NAME)";
2594-
SUPPORTED_PLATFORMS = "xrsimulator xros iphonesimulator iphoneos";
2595-
SUPPORTS_MACCATALYST = YES;
25962591
TARGETED_DEVICE_FAMILY = 1;
25972592
};
25982593
name = Debug;
25992594
};
26002595
C27E5DA022F31CCC00498ED0 /* Release */ = {
26012596
isa = XCBuildConfiguration;
26022597
buildSettings = {
2603-
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
26042598
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
26052599
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
26062600
CLANG_CXX_LIBRARY = "compiler-default";
@@ -2632,16 +2626,13 @@
26322626
);
26332627
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.AppWithModules;
26342628
PRODUCT_NAME = "$(TARGET_NAME)";
2635-
SUPPORTED_PLATFORMS = "xrsimulator xros iphonesimulator iphoneos";
2636-
SUPPORTS_MACCATALYST = YES;
26372629
TARGETED_DEVICE_FAMILY = 1;
26382630
};
26392631
name = Release;
26402632
};
26412633
C29374E9229FC0F60075CB16 /* Debug */ = {
26422634
isa = XCBuildConfiguration;
26432635
buildSettings = {
2644-
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
26452636
CLANG_ENABLE_MODULES = NO;
26462637
CLANG_WARN_STRICT_PROTOTYPES = NO;
26472638
DEFINES_MODULE = YES;
@@ -2650,10 +2641,7 @@
26502641
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
26512642
OTHER_LDFLAGS = "-ObjC";
26522643
PRODUCT_NAME = "$(TARGET_NAME)";
2653-
SDKROOT = iphoneos;
26542644
SKIP_INSTALL = YES;
2655-
SUPPORTED_PLATFORMS = "xrsimulator xros iphonesimulator iphoneos";
2656-
SUPPORTS_MACCATALYST = YES;
26572645
SYMROOT = build;
26582646
TARGETED_DEVICE_FAMILY = "1,2";
26592647
};
@@ -2662,7 +2650,6 @@
26622650
C29374EA229FC0F60075CB16 /* Release */ = {
26632651
isa = XCBuildConfiguration;
26642652
buildSettings = {
2665-
ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
26662653
CLANG_ENABLE_MODULES = NO;
26672654
CLANG_WARN_STRICT_PROTOTYPES = NO;
26682655
DEFINES_MODULE = YES;
@@ -2672,10 +2659,7 @@
26722659
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
26732660
OTHER_LDFLAGS = "-ObjC";
26742661
PRODUCT_NAME = "$(TARGET_NAME)";
2675-
SDKROOT = iphoneos;
26762662
SKIP_INSTALL = YES;
2677-
SUPPORTED_PLATFORMS = "xrsimulator xros iphonesimulator iphoneos";
2678-
SUPPORTS_MACCATALYST = YES;
26792663
SYMROOT = build;
26802664
TARGETED_DEVICE_FAMILY = "1,2";
26812665
};
@@ -2863,7 +2847,6 @@
28632847
__DATA,
28642848
__TNSMetadata,
28652849
"\"$(SRCROOT)/NativeScript/metadata-arm64.bin\"",
2866-
"-w",
28672850
);
28682851
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.NativeScript;
28692852
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
@@ -2956,7 +2939,6 @@
29562939
__DATA,
29572940
__TNSMetadata,
29582941
"\"$(SRCROOT)/NativeScript/metadata-arm64.bin\"",
2959-
"-w",
29602942
);
29612943
PRODUCT_BUNDLE_IDENTIFIER = org.nativescript.NativeScript;
29622944
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";

0 commit comments

Comments
 (0)