1
- using System . Diagnostics ;
1
+ using System ;
2
+ using System . Diagnostics ;
2
3
using System . IO ;
3
4
using Xunit ;
4
5
@@ -30,16 +31,19 @@ public void ExecuteMSBuildScript_NetFull()
30
31
{
31
32
found = true ;
32
33
34
+ var log = Path . Combine (
35
+ Environment . GetEnvironmentVariable ( "BUILD_ARTIFACTSTAGINGDIRECTORY" ) ?? FileManager . GetTestDirectory ( ) ,
36
+ nameof ( ExecuteMSBuildScript_NetFull ) + ".binlog" ) ;
33
37
var processStartInfo = new ProcessStartInfo (
34
38
paths [ i ] ,
35
- $ "MsBuildTestScript.proj /p:Configuration={ configuration } ")
39
+ $ "MsBuildTestScript.proj /p:Configuration={ configuration } /bl: { log } ")
36
40
{
37
41
WorkingDirectory = FileManager . GetTestDirectory ( ) ,
38
42
RedirectStandardOutput = true
39
43
} ;
40
44
41
45
var process = Process . Start ( processStartInfo ) ;
42
- process . WaitForExit ( ) ;
46
+ Assert . True ( process . WaitForExit ( 5000 ) ) ;
43
47
44
48
Assert . True ( 0 == process . ExitCode , process . StandardOutput . ReadToEnd ( ) ) ;
45
49
@@ -59,16 +63,19 @@ public void ExecuteMSBuildScript_NetCore()
59
63
configuration = "Debug" ;
60
64
#endif
61
65
66
+ var log = Path . Combine (
67
+ Environment . GetEnvironmentVariable ( "BUILD_ARTIFACTSTAGINGDIRECTORY" ) ?? FileManager . GetTestDirectory ( ) ,
68
+ nameof ( ExecuteMSBuildScript_NetCore ) + ".binlog" ) ;
62
69
var processStartInfo = new ProcessStartInfo (
63
70
"dotnet" ,
64
- $ "msbuild MsBuildTestScript_NetCore.proj /p:Configuration={ configuration } ")
71
+ $ "msbuild MsBuildTestScript_NetCore.proj /p:Configuration={ configuration } /bl: { log } ")
65
72
{
66
73
WorkingDirectory = FileManager . GetTestDirectory ( ) ,
67
74
RedirectStandardOutput = true
68
75
} ;
69
76
70
77
var process = Process . Start ( processStartInfo ) ;
71
- process . WaitForExit ( ) ;
78
+ Assert . True ( process . WaitForExit ( 5000 ) ) ;
72
79
73
80
Assert . True ( 0 == process . ExitCode , process . StandardOutput . ReadToEnd ( ) ) ;
74
81
}
0 commit comments