Skip to content

Commit 9af92a4

Browse files
Reenabling MacOS tests that had an issue with libgdiplus (#4500)
* Revert "Disable tests on macOS that depend on GDI+ library. (#4492)"
1 parent a64634d commit 9af92a4

5 files changed

Lines changed: 0 additions & 124 deletions

File tree

test/Microsoft.ML.OnnxTransformerTest/DnnImageFeaturizerTest.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Collections.Generic;
77
using System.IO;
88
using System.Linq;
9-
using System.Runtime.InteropServices;
109
using Microsoft.ML.Data;
1110
using Microsoft.ML.Model;
1211
using Microsoft.ML.RunTests;
@@ -90,11 +89,6 @@ void TestDnnImageFeaturizer()
9089
[OnnxFact]
9190
public void OnnxFeaturizerWorkout()
9291
{
93-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
94-
{
95-
return;
96-
}
97-
9892
var env = new MLContext(null);
9993
var imageHeight = 224;
10094
var imageWidth = 224;
@@ -203,11 +197,6 @@ internal sealed class ModelOutput
203197
[OnnxFact]
204198
public void TestLoadFromDiskAndPredictionEngine()
205199
{
206-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
207-
{
208-
return;
209-
}
210-
211200
var dataFile = GetDataPath("images/images.tsv");
212201
var imageFolder = Path.GetDirectoryName(dataFile);
213202

test/Microsoft.ML.OnnxTransformerTest/OnnxTransformTests.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
using Xunit.Abstractions;
1919
using Microsoft.ML.Transforms.Onnx;
2020
using Microsoft.ML.TestFrameworkCommon.Attributes;
21-
using System.Runtime.InteropServices;
2221

2322
namespace Microsoft.ML.Tests
2423
{
@@ -202,11 +201,6 @@ void TestOldSavingAndLoading(int? gpuDeviceId, bool fallbackToCpu)
202201
[OnnxFact]
203202
public void OnnxWorkout()
204203
{
205-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
206-
{
207-
return;
208-
}
209-
210204
var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet", "00000001", "model.onnx");
211205

212206
var env = new MLContext();
@@ -397,11 +391,6 @@ public ImageDataPoint(Color color)
397391
[OnnxFact]
398392
public void OnnxModelInMemoryImage()
399393
{
400-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
401-
{
402-
return;
403-
}
404-
405394
// Path of ONNX model. It's a multiclass classifier. It consumes an input "data_0" and produces an output "softmaxout_1".
406395
var modelFile = "squeezenet/00000001/model.onnx";
407396

test/Microsoft.ML.Tests/ImagesTests.cs

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Drawing;
88
using System.IO;
99
using System.Linq;
10-
using System.Runtime.InteropServices;
1110
using Microsoft.ML.Data;
1211
using Microsoft.ML.Model;
1312
using Microsoft.ML.RunTests;
@@ -27,11 +26,6 @@ public ImageTests(ITestOutputHelper output) : base(output)
2726
[Fact]
2827
public void TestEstimatorChain()
2928
{
30-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
31-
{
32-
return;
33-
}
34-
3529
var env = new MLContext();
3630
var dataFile = GetDataPath("images/images.tsv");
3731
var imageFolder = Path.GetDirectoryName(dataFile);
@@ -107,11 +101,6 @@ public void TestEstimatorSaveLoad()
107101
[Fact]
108102
public void TestSaveImages()
109103
{
110-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
111-
{
112-
return;
113-
}
114-
115104
var env = new MLContext();
116105
var dataFile = GetDataPath("images/images.tsv");
117106
var imageFolder = Path.GetDirectoryName(dataFile);
@@ -147,11 +136,6 @@ public void TestSaveImages()
147136
[Fact]
148137
public void TestGreyscaleTransformImages()
149138
{
150-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
151-
{
152-
return;
153-
}
154-
155139
IHostEnvironment env = new MLContext();
156140
var imageHeight = 150;
157141
var imageWidth = 100;
@@ -203,11 +187,6 @@ public void TestGreyscaleTransformImages()
203187
[Fact]
204188
public void TestGrayScaleInMemory()
205189
{
206-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
207-
{
208-
return;
209-
}
210-
211190
// Create an image list.
212191
var images = new List<ImageDataPoint>(){ new ImageDataPoint(10, 10, Color.Blue), new ImageDataPoint(10, 10, Color.Red) };
213192

@@ -291,11 +270,6 @@ public ImageDataPoint(int width, int height, Color color)
291270
[Fact]
292271
public void TestBackAndForthConversionWithAlphaInterleave()
293272
{
294-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
295-
{
296-
return;
297-
}
298-
299273
IHostEnvironment env = new MLContext();
300274
const int imageHeight = 100;
301275
const int imageWidth = 130;
@@ -353,11 +327,6 @@ public void TestBackAndForthConversionWithAlphaInterleave()
353327
[Fact]
354328
public void TestBackAndForthConversionWithoutAlphaInterleave()
355329
{
356-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
357-
{
358-
return;
359-
}
360-
361330
IHostEnvironment env = new MLContext();
362331
const int imageHeight = 100;
363332
const int imageWidth = 130;
@@ -415,11 +384,6 @@ public void TestBackAndForthConversionWithoutAlphaInterleave()
415384
[Fact]
416385
public void TestBackAndForthConversionWithDifferentOrder()
417386
{
418-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
419-
{
420-
return;
421-
}
422-
423387
IHostEnvironment env = new MLContext();
424388
const int imageHeight = 100;
425389
const int imageWidth = 130;
@@ -479,11 +443,6 @@ public void TestBackAndForthConversionWithDifferentOrder()
479443
[Fact]
480444
public void TestBackAndForthConversionWithAlphaNoInterleave()
481445
{
482-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
483-
{
484-
return;
485-
}
486-
487446
IHostEnvironment env = new MLContext();
488447
const int imageHeight = 100;
489448
const int imageWidth = 130;
@@ -541,11 +500,6 @@ public void TestBackAndForthConversionWithAlphaNoInterleave()
541500
[Fact]
542501
public void TestBackAndForthConversionWithoutAlphaNoInterleave()
543502
{
544-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
545-
{
546-
return;
547-
}
548-
549503
IHostEnvironment env = new MLContext();
550504
const int imageHeight = 100;
551505
const int imageWidth = 130;
@@ -603,11 +557,6 @@ public void TestBackAndForthConversionWithoutAlphaNoInterleave()
603557
[Fact]
604558
public void TestBackAndForthConversionWithAlphaInterleaveNoOffset()
605559
{
606-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
607-
{
608-
return;
609-
}
610-
611560
IHostEnvironment env = new MLContext();
612561
const int imageHeight = 100;
613562
const int imageWidth = 130;
@@ -666,11 +615,6 @@ public void TestBackAndForthConversionWithAlphaInterleaveNoOffset()
666615
[Fact]
667616
public void TestBackAndForthConversionWithoutAlphaInterleaveNoOffset()
668617
{
669-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
670-
{
671-
return;
672-
}
673-
674618
IHostEnvironment env = new MLContext();
675619
const int imageHeight = 100;
676620
const int imageWidth = 130;
@@ -728,11 +672,6 @@ public void TestBackAndForthConversionWithoutAlphaInterleaveNoOffset()
728672
[Fact]
729673
public void TestBackAndForthConversionWithAlphaNoInterleaveNoOffset()
730674
{
731-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
732-
{
733-
return;
734-
}
735-
736675
IHostEnvironment env = new MLContext();
737676
const int imageHeight = 100;
738677
var imageWidth = 130;
@@ -791,11 +730,6 @@ public void TestBackAndForthConversionWithAlphaNoInterleaveNoOffset()
791730
[Fact]
792731
public void TestBackAndForthConversionWithoutAlphaNoInterleaveNoOffset()
793732
{
794-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
795-
{
796-
return;
797-
}
798-
799733
IHostEnvironment env = new MLContext();
800734
const int imageHeight = 100;
801735
const int imageWidth = 130;
@@ -852,11 +786,6 @@ public void TestBackAndForthConversionWithoutAlphaNoInterleaveNoOffset()
852786
[Fact]
853787
public void ImageResizerTransformResizingModeFill()
854788
{
855-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
856-
{
857-
return;
858-
}
859-
860789
var env = new MLContext();
861790
var dataFile = GetDataPath("images/fillmode.tsv");
862791
var imageFolder = Path.GetDirectoryName(dataFile);

test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ public class ImageNetPrediction
7373
[TensorFlowFact]
7474
public void TensorFlowTransforCifarEndToEndTest2()
7575
{
76-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
77-
{
78-
return;
79-
}
80-
8176
var imageHeight = 32;
8277
var imageWidth = 32;
8378
var model_location = "cifar_model/frozen_model.pb";
@@ -939,11 +934,6 @@ public class MNISTPrediction
939934
[TensorFlowFact]
940935
public void TensorFlowTransformCifar()
941936
{
942-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
943-
{
944-
return;
945-
}
946-
947937
var modelLocation = "cifar_model/frozen_model.pb";
948938
var mlContext = new MLContext(seed: 1);
949939
List<string> logMessages = new List<string>();
@@ -1033,11 +1023,6 @@ public void TensorFlowTransformCifar()
10331023
[TensorFlowFact]
10341024
public void TensorFlowTransformCifarSavedModel()
10351025
{
1036-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
1037-
{
1038-
return;
1039-
}
1040-
10411026
var modelLocation = "cifar_saved_model";
10421027
var mlContext = new MLContext(seed: 1);
10431028
var tensorFlowModel = mlContext.Model.LoadTensorFlowModel(modelLocation);
@@ -1092,11 +1077,6 @@ public void TensorFlowGettingSchemaMultipleTimes()
10921077
[TensorFlowFact]
10931078
public void TensorFlowTransformCifarInvalidShape()
10941079
{
1095-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
1096-
{
1097-
return;
1098-
}
1099-
11001080
var modelLocation = "cifar_model/frozen_model.pb";
11011081

11021082
var mlContext = new MLContext(seed: 1);

test/Microsoft.ML.Tests/TensorFlowEstimatorTests.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using Microsoft.ML.TensorFlow;
1515
using Xunit;
1616
using Xunit.Abstractions;
17-
using System.Runtime.InteropServices;
1817

1918
namespace Microsoft.ML.Tests
2019
{
@@ -144,11 +143,6 @@ void TestCommandLine()
144143
[TensorFlowFact]
145144
public void TestTensorFlow()
146145
{
147-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
148-
{
149-
return;
150-
}
151-
152146
var modelLocation = "cifar_model/frozen_model.pb";
153147

154148
var mlContext = new MLContext(seed: 1);
@@ -190,11 +184,6 @@ public void TestTensorFlow()
190184
[TensorFlowFact]
191185
public void TestTensorFlowWithSchema()
192186
{
193-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
194-
{
195-
return;
196-
}
197-
198187
const string modelLocation = "cifar_model/frozen_model.pb";
199188

200189
var mlContext = new MLContext(seed: 1);

0 commit comments

Comments
 (0)