File tree 1 file changed +9
-4
lines changed
src/LibObjectFile.Tests/PE
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 6
6
using System . Collections . Generic ;
7
7
using System . Diagnostics ;
8
8
using System . IO ;
9
+ using System . Runtime . InteropServices ;
9
10
using System . Threading . Tasks ;
10
11
using LibObjectFile . Diagnostics ;
11
12
using LibObjectFile . PE ;
@@ -152,10 +153,14 @@ public void TestCreatePE()
152
153
var sourceFile = Path . Combine ( AppContext . BaseDirectory , "PE" , "RawNativeConsoleWin64_Generated.exe" ) ;
153
154
File . WriteAllBytes ( sourceFile , output . ToArray ( ) ) ;
154
155
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
+ }
159
164
}
160
165
161
166
[ DataTestMethod ]
You can’t perform that action at this time.
0 commit comments