Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 2939cb2

Browse files
Merge pull request #783 from xamarin/drop-32-bit-arm
[tests] removed 32-bit tests
2 parents ac9f57a + 2d057f4 commit 2939cb2

File tree

1 file changed

+16
-28
lines changed

1 file changed

+16
-28
lines changed

tests/tom-swifty-test/SwiftReflector/CompilationTargetTests.cs

+16-28
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,15 @@ public void IphoneDeviceFramework ()
163163
return a + b
164164
}";
165165
using (var output = CompileStringToResult (swiftCode, PlatformName.iOS, "10.2", null,
166-
new List<TargetCpu> () { TargetCpu.Arm64, TargetCpu.Armv7s }, false)) {
166+
new List<TargetCpu> () { TargetCpu.Arm64 }, false)) {
167167

168168
var outputFile = Path.Combine (output.DirectoryPath, "NoNameModule.framework", "NoNameModule");
169169
Assert.IsTrue (File.Exists (outputFile), "we didn't get a file!");
170170

171171
using (var macho = MachO.Read (outputFile, ReadingMode.Immediate)) {
172-
Assert.AreEqual (2, macho.Count, "wrong contents");
172+
Assert.AreEqual (1, macho.Count, "wrong contents");
173173
var file = macho.FirstOrDefault (f => f.Architecture == MachO.Architectures.ARM64);
174174
Assert.IsNotNull (file, "no arm64");
175-
file = macho.FirstOrDefault (f => f.Architecture == MachO.Architectures.ARMv7s);
176-
Assert.IsNotNull (file, "no arm7s");
177175
}
178176
}
179177
}
@@ -185,19 +183,17 @@ public void IphoneSimulatorFramework ()
185183
return a + b
186184
}";
187185
using (var output = CompileStringToResult (swiftCode, PlatformName.iOS, "10.2",
188-
new List<TargetCpu> () { TargetCpu.Arm64, TargetCpu.X86_64, TargetCpu.I386 }, null, false)) {
186+
new List<TargetCpu> () { TargetCpu.Arm64, TargetCpu.X86_64 }, null, false)) {
189187

190188
var outputFile = Path.Combine (output.DirectoryPath, "NoNameModule.framework", "NoNameModule");
191189
Assert.IsTrue (File.Exists (outputFile), "we didn't get a file!");
192190

193191
using (var macho = MachO.Read (outputFile, ReadingMode.Immediate)) {
194-
Assert.AreEqual (3, macho.Count, "wrong contents");
192+
Assert.AreEqual (2, macho.Count, "wrong contents");
195193
var file = macho.FirstOrDefault (f => f.Architecture == MachO.Architectures.ARM64);
196194
Assert.IsNotNull (file, "no arm64");
197195
file = macho.FirstOrDefault (f => f.Architecture == MachO.Architectures.x86_64);
198196
Assert.IsNotNull (file, "no x86_64");
199-
file = macho.FirstOrDefault (f => f.Architecture == MachO.Architectures.i386);
200-
Assert.IsNotNull (file, "no i386");
201197
}
202198
}
203199
}
@@ -210,38 +206,34 @@ public void IphoneXCFramework ()
210206
return a + b
211207
}";
212208
using (var output = CompileStringToResult (swiftCode, PlatformName.iOS, "10.2",
213-
new List<TargetCpu> () { TargetCpu.Arm64, TargetCpu.X86_64, TargetCpu.I386 },
214-
new List<TargetCpu> () { TargetCpu.Arm64, TargetCpu.Armv7s }, false)) {
209+
new List<TargetCpu> () { TargetCpu.Arm64, TargetCpu.X86_64 },
210+
new List<TargetCpu> () { TargetCpu.Arm64 }, false)) {
215211

216212
var outputDirectory = Path.Combine (output.DirectoryPath, "NoNameModule.xcframework");
217213
Assert.IsTrue (Directory.Exists (outputDirectory), "no xcframework");
218214

219-
var deviceFM = Path.Combine (outputDirectory, "ios-arm64_armv7s", "NoNameModule.framework");
215+
var deviceFM = Path.Combine (outputDirectory, "ios-arm64", "NoNameModule.framework");
220216
Assert.IsTrue (Directory.Exists (deviceFM), "no device directory");
221217

222-
var simFM = Path.Combine (outputDirectory, "ios-arm64_i386_x86_64-simulator", "NoNameModule.framework");
218+
var simFM = Path.Combine (outputDirectory, "ios-arm64_x86_64-simulator", "NoNameModule.framework");
223219
Assert.IsTrue (Directory.Exists (simFM), "no simulator directory");
224220

225221
var outputFile = Path.Combine (deviceFM, "NoNameModule");
226222
Assert.IsTrue (File.Exists (outputFile), "we didn't get a device file!");
227223

228224
using (var macho = MachO.Read (outputFile, ReadingMode.Immediate)) {
229-
Assert.AreEqual (2, macho.Count, "wrong device contents");
225+
Assert.AreEqual (1, macho.Count, "wrong device contents");
230226
var file = macho.FirstOrDefault (f => f.Architecture == MachO.Architectures.ARM64);
231227
Assert.IsNotNull (file, "device: no arm64");
232-
file = macho.FirstOrDefault (f => f.Architecture == MachO.Architectures.ARMv7s);
233-
Assert.IsNotNull (file, "device: no armv7s");
234228
}
235229

236230
outputFile = Path.Combine (simFM, "NoNameModule");
237231
Assert.IsTrue (File.Exists (outputFile), "we didn't get a simulator file!");
238232

239233
using (var macho = MachO.Read (outputFile, ReadingMode.Immediate)) {
240-
Assert.AreEqual (3, macho.Count, "wrong simulator contents");
234+
Assert.AreEqual (2, macho.Count, "wrong simulator contents");
241235
var file = macho.FirstOrDefault (f => f.Architecture == MachO.Architectures.ARM64);
242236
Assert.IsNotNull (file, "simulator: no arm64");
243-
file = macho.FirstOrDefault (f => f.Architecture == MachO.Architectures.i386);
244-
Assert.IsNotNull (file, "simulator: no i386");
245237
file = macho.FirstOrDefault (f => f.Architecture == MachO.Architectures.x86_64);
246238
Assert.IsNotNull (file, "simulator: no x86_64");
247239
}
@@ -310,7 +302,7 @@ public void RoundTripiOSDeviceFramework ()
310302
return a - b
311303
}";
312304
using (var output = CompileStringToResult (swiftCode, PlatformName.iOS, "10.9",
313-
null, new List<TargetCpu> () { TargetCpu.Arm64, TargetCpu.Armv7s }, false)) {
305+
null, new List<TargetCpu> () { TargetCpu.Arm64 }, false)) {
314306

315307
var errors = new ErrorHandling ();
316308
var rep = UniformTargetRepresentation.FromPath ("NoNameModule", new List<string> () { output.DirectoryPath }, errors);
@@ -320,13 +312,13 @@ public void RoundTripiOSDeviceFramework ()
320312
var fwk = rep.Framework;
321313

322314
Assert.AreEqual (Path.Combine (output.DirectoryPath, "NoNameModule.framework"), fwk.Path, "wrong fwk path");
323-
Assert.AreEqual (2, fwk.Targets.Count, "wrong number of targets");
315+
Assert.AreEqual (1, fwk.Targets.Count, "wrong number of targets");
324316
Assert.AreEqual (PlatformName.iOS, fwk.OperatingSystem, "wrong os");
325317
Assert.AreEqual (TargetEnvironment.Device, fwk.Environment, "wrong environment");
326318

327319
foreach (var target in fwk.Targets) {
328320
Assert.AreEqual ("10.9", target.MinimumOSVersion.ToString (), $"wrong minimum os in {target}");
329-
Assert.IsTrue (target.Cpu == TargetCpu.Arm64 || target.Cpu == TargetCpu.Armv7s, $"wrong cpu in {target}");
321+
Assert.IsTrue (target.Cpu == TargetCpu.Arm64, $"wrong cpu in {target}");
330322
}
331323
}
332324
}
@@ -369,7 +361,7 @@ public void RoundTripiOSXCFramework ()
369361
}";
370362
using (var output = CompileStringToResult (swiftCode, PlatformName.iOS, "10.9",
371363
new List<TargetCpu> () { TargetCpu.Arm64, TargetCpu.X86_64 },
372-
new List<TargetCpu> () { TargetCpu.Arm64, TargetCpu.Armv7s }, false)) {
364+
new List<TargetCpu> () { TargetCpu.Arm64 }, false)) {
373365

374366
var errors = new ErrorHandling ();
375367
var rep = UniformTargetRepresentation.FromPath ("NoNameModule", new List<string> () { output.DirectoryPath }, errors);
@@ -384,12 +376,12 @@ public void RoundTripiOSXCFramework ()
384376
var fwk = xcfwk.Frameworks.FirstOrDefault (fw => fw.Environment == TargetEnvironment.Device);
385377
Assert.IsNotNull (fwk, "not a device framwwork");
386378

387-
Assert.AreEqual (2, fwk.Targets.Count, "wrong number of targets");
379+
Assert.AreEqual (1, fwk.Targets.Count, "wrong number of targets");
388380
Assert.AreEqual (PlatformName.iOS, fwk.OperatingSystem, "wrong os");
389381

390382
foreach (var target in fwk.Targets) {
391383
Assert.AreEqual ("10.9", target.MinimumOSVersion.ToString (), $"wrong minimum os in {target}");
392-
Assert.IsTrue (target.Cpu == TargetCpu.Arm64 || target.Cpu == TargetCpu.X86_64 || target.Cpu == TargetCpu.Armv7s, $"wrong cpu in {target}");
384+
Assert.IsTrue (target.Cpu == TargetCpu.Arm64 || target.Cpu == TargetCpu.X86_64, $"wrong cpu in {target}");
393385
}
394386
}
395387
}
@@ -543,11 +535,7 @@ public void FromStringManufacturerFail ()
543535
Assert.Throws (typeof (ArgumentOutOfRangeException), () => new CompilationTarget ("i386-banana-ios10.1"));
544536
}
545537

546-
[TestCase ("i386", TargetCpu.I386)]
547538
[TestCase ("arm64", TargetCpu.Arm64)]
548-
[TestCase ("armv7k", TargetCpu.Arm7vk)]
549-
[TestCase ("armv7s", TargetCpu.Armv7s)]
550-
[TestCase ("armv7", TargetCpu.Armv7)]
551539
[TestCase ("x86_64", TargetCpu.X86_64)]
552540
[TestCase ("arm64_32", TargetCpu.Arm64_32)]
553541
public void FromStringCpuSuccess (string cpu, TargetCpu targetCpu)

0 commit comments

Comments
 (0)