@@ -185,7 +185,7 @@ public class BuildScriptTests
185185 // Records the arguments passed to StartCallback.
186186 IList < string > StartCallbackIn = new List < string > ( ) ;
187187
188- void StartCallback ( string s )
188+ void StartCallback ( string s , bool silent )
189189 {
190190 StartCallbackIn . Add ( s ) ;
191191 }
@@ -194,7 +194,7 @@ void StartCallback(string s)
194194 IList < string > EndCallbackIn = new List < string > ( ) ;
195195 IList < int > EndCallbackReturn = new List < int > ( ) ;
196196
197- void EndCallback ( int ret , string s )
197+ void EndCallback ( int ret , string s , bool silent )
198198 {
199199 EndCallbackReturn . Add ( ret ) ;
200200 EndCallbackIn . Add ( s ) ;
@@ -203,7 +203,7 @@ void EndCallback(int ret, string s)
203203 [ Fact ]
204204 public void TestBuildCommand ( )
205205 {
206- var cmd = BuildScript . Create ( "abc" , "def ghi" , null , null ) ;
206+ var cmd = BuildScript . Create ( "abc" , "def ghi" , false , null , null ) ;
207207
208208 Actions . RunProcess [ "abc def ghi" ] = 1 ;
209209 cmd . Run ( Actions , StartCallback , EndCallback ) ;
@@ -216,7 +216,7 @@ public void TestBuildCommand()
216216 [ Fact ]
217217 public void TestAnd1 ( )
218218 {
219- var cmd = BuildScript . Create ( "abc" , "def ghi" , null , null ) & BuildScript . Create ( "odasa" , null , null , null ) ;
219+ var cmd = BuildScript . Create ( "abc" , "def ghi" , false , null , null ) & BuildScript . Create ( "odasa" , null , false , null , null ) ;
220220
221221 Actions . RunProcess [ "abc def ghi" ] = 1 ;
222222 cmd . Run ( Actions , StartCallback , EndCallback ) ;
@@ -230,7 +230,7 @@ public void TestAnd1()
230230 [ Fact ]
231231 public void TestAnd2 ( )
232232 {
233- var cmd = BuildScript . Create ( "odasa" , null , null , null ) & BuildScript . Create ( "abc" , "def ghi" , null , null ) ;
233+ var cmd = BuildScript . Create ( "odasa" , null , false , null , null ) & BuildScript . Create ( "abc" , "def ghi" , false , null , null ) ;
234234
235235 Actions . RunProcess [ "abc def ghi" ] = 1 ;
236236 Actions . RunProcess [ "odasa " ] = 0 ;
@@ -250,7 +250,7 @@ public void TestAnd2()
250250 [ Fact ]
251251 public void TestOr1 ( )
252252 {
253- var cmd = BuildScript . Create ( "odasa" , null , null , null ) | BuildScript . Create ( "abc" , "def ghi" , null , null ) ;
253+ var cmd = BuildScript . Create ( "odasa" , null , false , null , null ) | BuildScript . Create ( "abc" , "def ghi" , false , null , null ) ;
254254
255255 Actions . RunProcess [ "abc def ghi" ] = 1 ;
256256 Actions . RunProcess [ "odasa " ] = 0 ;
@@ -266,7 +266,7 @@ public void TestOr1()
266266 [ Fact ]
267267 public void TestOr2 ( )
268268 {
269- var cmd = BuildScript . Create ( "abc" , "def ghi" , null , null ) | BuildScript . Create ( "odasa" , null , null , null ) ;
269+ var cmd = BuildScript . Create ( "abc" , "def ghi" , false , null , null ) | BuildScript . Create ( "odasa" , null , false , null , null ) ;
270270
271271 Actions . RunProcess [ "abc def ghi" ] = 1 ;
272272 Actions . RunProcess [ "odasa " ] = 0 ;
@@ -375,7 +375,7 @@ public void TestDefaultCSharpAutoBuilder()
375375 Actions . RunProcess [ "cmd.exe /C dotnet --info" ] = 0 ;
376376 Actions . RunProcess [ "cmd.exe /C dotnet clean test.csproj" ] = 0 ;
377377 Actions . RunProcess [ "cmd.exe /C dotnet restore test.csproj" ] = 0 ;
378- Actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj" ] = 0 ;
378+ Actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --auto dotnet build --no-incremental test.csproj" ] = 0 ;
379379 Actions . RunProcess [ @"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ." ] = 0 ;
380380 Actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml" ] = 0 ;
381381 Actions . FileExists [ "csharp.log" ] = true ;
@@ -404,6 +404,9 @@ public void TestLinuxCSharpAutoBuilder()
404404 Actions . RunProcess [ "dotnet --info" ] = 0 ;
405405 Actions . RunProcess [ "dotnet clean test.csproj" ] = 0 ;
406406 Actions . RunProcess [ "dotnet restore test.csproj" ] = 0 ;
407+ Actions . RunProcess [ "dotnet --list-runtimes" ] = 0 ;
408+ Actions . RunProcessOut [ "dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
409+ Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
407410 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj" ] = 0 ;
408411 Actions . RunProcess [ @"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ." ] = 0 ;
409412 Actions . RunProcess [ @"C:\odasa/tools/odasa index --xml --extensions config csproj props xml" ] = 0 ;
@@ -424,7 +427,7 @@ public void TestLinuxCSharpAutoBuilder()
424427 Actions . LoadXml [ "test.csproj" ] = xml ;
425428
426429 var autobuilder = CreateAutoBuilder ( "csharp" , false ) ;
427- TestAutobuilderScript ( autobuilder , 0 , 6 ) ;
430+ TestAutobuilderScript ( autobuilder , 0 , 7 ) ;
428431 }
429432
430433 [ Fact ]
@@ -748,7 +751,7 @@ public void TestWindowCSharpMsBuild()
748751 TestAutobuilderScript ( autobuilder , 0 , 6 ) ;
749752 }
750753
751- [ Fact ]
754+ [ Fact ]
752755 public void TestWindowCSharpMsBuildMultipleSolutions ( )
753756 {
754757 Actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore test1.csproj" ] = 0 ;
@@ -874,6 +877,9 @@ public void TestSkipNugetDotnet()
874877 Actions . RunProcess [ "dotnet --info" ] = 0 ;
875878 Actions . RunProcess [ "dotnet clean test.csproj" ] = 0 ;
876879 Actions . RunProcess [ "dotnet restore test.csproj" ] = 0 ;
880+ Actions . RunProcess [ "dotnet --list-runtimes" ] = 0 ;
881+ Actions . RunProcessOut [ "dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
882+ Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
877883 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false --no-restore test.csproj" ] = 0 ;
878884 Actions . RunProcess [ @"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ." ] = 0 ;
879885 Actions . RunProcess [ @"C:\odasa/tools/odasa index --xml --extensions config csproj props xml" ] = 0 ;
@@ -894,7 +900,7 @@ public void TestSkipNugetDotnet()
894900 Actions . LoadXml [ "test.csproj" ] = xml ;
895901
896902 var autobuilder = CreateAutoBuilder ( "csharp" , false , dotnetArguments : "--no-restore" ) ; // nugetRestore=false does not work for now.
897- TestAutobuilderScript ( autobuilder , 0 , 6 ) ;
903+ TestAutobuilderScript ( autobuilder , 0 , 7 ) ;
898904 }
899905
900906 [ Fact ]
@@ -909,7 +915,10 @@ public void TestDotnetVersionNotInstalled()
909915 Actions . RunProcess [ @"C:\Project/.dotnet/dotnet --info" ] = 0 ;
910916 Actions . RunProcess [ @"C:\Project/.dotnet/dotnet clean test.csproj" ] = 0 ;
911917 Actions . RunProcess [ @"C:\Project/.dotnet/dotnet restore test.csproj" ] = 0 ;
912- Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj" ] = 0 ;
918+ Actions . RunProcess [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = 0 ;
919+ Actions . RunProcessOut [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
920+ Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
921+ Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental test.csproj" ] = 0 ;
913922 Actions . RunProcess [ @"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ." ] = 0 ;
914923 Actions . RunProcess [ @"C:\odasa/tools/odasa index --xml --extensions config csproj props xml" ] = 0 ;
915924 Actions . FileExists [ "csharp.log" ] = true ;
@@ -930,21 +939,27 @@ public void TestDotnetVersionNotInstalled()
930939 Actions . LoadXml [ "test.csproj" ] = xml ;
931940
932941 var autobuilder = CreateAutoBuilder ( "csharp" , false , dotnetVersion : "2.1.3" ) ;
933- TestAutobuilderScript ( autobuilder , 0 , 11 ) ;
942+ TestAutobuilderScript ( autobuilder , 0 , 12 ) ;
934943 }
935944
936945 [ Fact ]
937946 public void TestDotnetVersionAlreadyInstalled ( )
938947 {
939948 Actions . RunProcess [ "dotnet --list-sdks" ] = 0 ;
940- Actions . RunProcessOut [ "dotnet --list-sdks" ] = "2.1.3 [C:\\ Program Files\\ dotnet\\ sdks]\n 2.1.4 [C:\\ Program Files\\ dotnet\\ sdks]" ;
949+ Actions . RunProcessOut [ "dotnet --list-sdks" ] = @"2.1.3 [C:\Program Files\dotnet\sdks]
950+ 2.1.4 [C:\Program Files\dotnet\sdks]" ;
941951 Actions . RunProcess [ @"curl -L -sO https://dot.net/v1/dotnet-install.sh" ] = 0 ;
942952 Actions . RunProcess [ @"chmod u+x dotnet-install.sh" ] = 0 ;
943953 Actions . RunProcess [ @"./dotnet-install.sh --channel release --version 2.1.3 --install-dir C:\Project/.dotnet" ] = 0 ;
944954 Actions . RunProcess [ @"rm dotnet-install.sh" ] = 0 ;
945955 Actions . RunProcess [ @"C:\Project/.dotnet/dotnet --info" ] = 0 ;
946956 Actions . RunProcess [ @"C:\Project/.dotnet/dotnet clean test.csproj" ] = 0 ;
947957 Actions . RunProcess [ @"C:\Project/.dotnet/dotnet restore test.csproj" ] = 0 ;
958+ Actions . RunProcess [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = 0 ;
959+ Actions . RunProcessOut [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
960+ Microsoft.AspNetCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
961+ Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
962+ Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
948963 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj" ] = 0 ;
949964 Actions . RunProcess [ @"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ." ] = 0 ;
950965 Actions . RunProcess [ @"C:\odasa/tools/odasa index --xml --extensions config csproj props xml" ] = 0 ;
@@ -966,7 +981,7 @@ public void TestDotnetVersionAlreadyInstalled()
966981 Actions . LoadXml [ "test.csproj" ] = xml ;
967982
968983 var autobuilder = CreateAutoBuilder ( "csharp" , false , dotnetVersion : "2.1.3" ) ;
969- TestAutobuilderScript ( autobuilder , 0 , 11 ) ;
984+ TestAutobuilderScript ( autobuilder , 0 , 12 ) ;
970985 }
971986
972987 [ Fact ]
@@ -979,7 +994,7 @@ public void TestDotnetVersionWindows()
979994 Actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet --info" ] = 0 ;
980995 Actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet clean test.csproj" ] = 0 ;
981996 Actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet restore test.csproj" ] = 0 ;
982- Actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\.dotnet\dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj" ] = 0 ;
997+ Actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\.dotnet\dotnet build --no-incremental test.csproj" ] = 0 ;
983998 Actions . RunProcess [ @"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ." ] = 0 ;
984999 Actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml" ] = 0 ;
9851000 Actions . FileExists [ "csharp.log" ] = true ;
0 commit comments