Skip to content

Commit d44d387

Browse files
committed
Fix PE create test to run only on Windows x64
1 parent 1ee8299 commit d44d387

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/LibObjectFile.Tests/PE/PEReaderTests.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Collections.Generic;
77
using System.Diagnostics;
88
using System.IO;
9+
using System.Runtime.InteropServices;
910
using System.Threading.Tasks;
1011
using LibObjectFile.Diagnostics;
1112
using LibObjectFile.PE;
@@ -152,10 +153,14 @@ public void TestCreatePE()
152153
var sourceFile = Path.Combine(AppContext.BaseDirectory, "PE", "RawNativeConsoleWin64_Generated.exe");
153154
File.WriteAllBytes(sourceFile, output.ToArray());
154155

155-
// Check the generated exe
156-
var process = Process.Start(sourceFile);
157-
process.WaitForExit();
158-
Assert.AreEqual(156, process.ExitCode);
156+
// Only try to run the generated exe on Windows x64
157+
if (OperatingSystem.IsWindows() && RuntimeInformation.OSArchitecture == Architecture.X64)
158+
{
159+
// Check the generated exe
160+
var process = Process.Start(sourceFile);
161+
process.WaitForExit();
162+
Assert.AreEqual(156, process.ExitCode);
163+
}
159164
}
160165

161166
[DataTestMethod]

0 commit comments

Comments
 (0)