@@ -401,12 +401,12 @@ public void TestDefaultCSharpAutoBuilder()
401401 [ Fact ]
402402 public void TestLinuxCSharpAutoBuilder ( )
403403 {
404- Actions . RunProcess [ "dotnet --info" ] = 0 ;
405- Actions . RunProcess [ "dotnet clean test.csproj" ] = 0 ;
406- Actions . RunProcess [ "dotnet restore test.csproj" ] = 0 ;
407404 Actions . RunProcess [ "dotnet --list-runtimes" ] = 0 ;
408405 Actions . RunProcessOut [ "dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
409406Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
407+ Actions . RunProcess [ "dotnet --info" ] = 0 ;
408+ Actions . RunProcess [ "dotnet clean test.csproj" ] = 0 ;
409+ Actions . RunProcess [ "dotnet restore test.csproj" ] = 0 ;
410410 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj" ] = 0 ;
411411 Actions . RunProcess [ @"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ." ] = 0 ;
412412 Actions . RunProcess [ @"C:\odasa/tools/odasa index --xml --extensions config csproj props xml" ] = 0 ;
@@ -601,6 +601,8 @@ void TestAutobuilderScript(Autobuilder autobuilder, int expectedOutput, int comm
601601 [ Fact ]
602602 public void TestLinuxBuildCommand ( )
603603 {
604+ Actions . RunProcess [ "dotnet --list-runtimes" ] = 1 ;
605+ Actions . RunProcessOut [ "dotnet --list-runtimes" ] = "" ;
604606 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto ""./build.sh --skip-tests""" ] = 0 ;
605607 Actions . RunProcess [ @"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ." ] = 0 ;
606608 Actions . RunProcess [ @"C:\odasa/tools/odasa index --xml --extensions config csproj props xml" ] = 0 ;
@@ -613,7 +615,7 @@ public void TestLinuxBuildCommand()
613615 SkipVsWhere ( ) ;
614616
615617 var autobuilder = CreateAutoBuilder ( "csharp" , false , buildCommand : "./build.sh --skip-tests" ) ;
616- TestAutobuilderScript ( autobuilder , 0 , 3 ) ;
618+ TestAutobuilderScript ( autobuilder , 0 , 4 ) ;
617619 }
618620
619621 [ Fact ]
@@ -624,14 +626,16 @@ public void TestLinuxBuildSh()
624626 Actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_TRAP_DIR" ] = "" ;
625627 Actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR" ] = "" ;
626628 Actions . RunProcess [ "/bin/chmod u+x build/build.sh" ] = 0 ;
629+ Actions . RunProcess [ "dotnet --list-runtimes" ] = 1 ;
630+ Actions . RunProcessOut [ "dotnet --list-runtimes" ] = "" ;
627631 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto build/build.sh" ] = 0 ;
628632 Actions . RunProcessWorkingDirectory [ @"C:\odasa/tools/odasa index --auto build/build.sh" ] = "build" ;
629633 Actions . RunProcess [ @"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ." ] = 0 ;
630634 Actions . RunProcess [ @"C:\odasa/tools/odasa index --xml --extensions config csproj props xml" ] = 0 ;
631635 Actions . FileExists [ "csharp.log" ] = true ;
632636
633637 var autobuilder = CreateAutoBuilder ( "csharp" , false ) ;
634- TestAutobuilderScript ( autobuilder , 0 , 4 ) ;
638+ TestAutobuilderScript ( autobuilder , 0 , 5 ) ;
635639 }
636640
637641 [ Fact ]
@@ -643,12 +647,14 @@ public void TestLinuxBuildShCSharpLogMissing()
643647 Actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR" ] = "" ;
644648
645649 Actions . RunProcess [ "/bin/chmod u+x build.sh" ] = 0 ;
650+ Actions . RunProcess [ "dotnet --list-runtimes" ] = 1 ;
651+ Actions . RunProcessOut [ "dotnet --list-runtimes" ] = "" ;
646652 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto build.sh" ] = 0 ;
647653 Actions . RunProcessWorkingDirectory [ @"C:\odasa/tools/odasa index --auto build.sh" ] = "" ;
648654 Actions . FileExists [ "csharp.log" ] = false ;
649655
650656 var autobuilder = CreateAutoBuilder ( "csharp" , false ) ;
651- TestAutobuilderScript ( autobuilder , 1 , 2 ) ;
657+ TestAutobuilderScript ( autobuilder , 1 , 3 ) ;
652658 }
653659
654660 [ Fact ]
@@ -660,12 +666,14 @@ public void TestLinuxBuildShFailed()
660666 Actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR" ] = "" ;
661667
662668 Actions . RunProcess [ "/bin/chmod u+x build.sh" ] = 0 ;
669+ Actions . RunProcess [ "dotnet --list-runtimes" ] = 1 ;
670+ Actions . RunProcessOut [ "dotnet --list-runtimes" ] = "" ;
663671 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto build.sh" ] = 5 ;
664672 Actions . RunProcessWorkingDirectory [ @"C:\odasa/tools/odasa index --auto build.sh" ] = "" ;
665673 Actions . FileExists [ "csharp.log" ] = true ;
666674
667675 var autobuilder = CreateAutoBuilder ( "csharp" , false ) ;
668- TestAutobuilderScript ( autobuilder , 1 , 2 ) ;
676+ TestAutobuilderScript ( autobuilder , 1 , 3 ) ;
669677 }
670678
671679 [ Fact ]
@@ -874,12 +882,12 @@ public void TestSkipNugetBuildless()
874882 [ Fact ]
875883 public void TestSkipNugetDotnet ( )
876884 {
877- Actions . RunProcess [ "dotnet --info" ] = 0 ;
878- Actions . RunProcess [ "dotnet clean test.csproj" ] = 0 ;
879- Actions . RunProcess [ "dotnet restore test.csproj" ] = 0 ;
880885 Actions . RunProcess [ "dotnet --list-runtimes" ] = 0 ;
881886 Actions . RunProcessOut [ "dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
882887Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
888+ Actions . RunProcess [ "dotnet --info" ] = 0 ;
889+ Actions . RunProcess [ "dotnet clean test.csproj" ] = 0 ;
890+ Actions . RunProcess [ "dotnet restore test.csproj" ] = 0 ;
883891 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false --no-restore test.csproj" ] = 0 ;
884892 Actions . RunProcess [ @"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ." ] = 0 ;
885893 Actions . RunProcess [ @"C:\odasa/tools/odasa index --xml --extensions config csproj props xml" ] = 0 ;
@@ -912,12 +920,12 @@ public void TestDotnetVersionNotInstalled()
912920 Actions . RunProcess [ @"chmod u+x dotnet-install.sh" ] = 0 ;
913921 Actions . RunProcess [ @"./dotnet-install.sh --channel release --version 2.1.3 --install-dir C:\Project/.dotnet" ] = 0 ;
914922 Actions . RunProcess [ @"rm dotnet-install.sh" ] = 0 ;
915- Actions . RunProcess [ @"C:\Project/.dotnet/dotnet --info" ] = 0 ;
916- Actions . RunProcess [ @"C:\Project/.dotnet/dotnet clean test.csproj" ] = 0 ;
917- Actions . RunProcess [ @"C:\Project/.dotnet/dotnet restore test.csproj" ] = 0 ;
918923 Actions . RunProcess [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = 0 ;
919924 Actions . RunProcessOut [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
920925Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
926+ Actions . RunProcess [ @"C:\Project/.dotnet/dotnet --info" ] = 0 ;
927+ Actions . RunProcess [ @"C:\Project/.dotnet/dotnet clean test.csproj" ] = 0 ;
928+ Actions . RunProcess [ @"C:\Project/.dotnet/dotnet restore test.csproj" ] = 0 ;
921929 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental test.csproj" ] = 0 ;
922930 Actions . RunProcess [ @"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ." ] = 0 ;
923931 Actions . RunProcess [ @"C:\odasa/tools/odasa index --xml --extensions config csproj props xml" ] = 0 ;
@@ -952,14 +960,14 @@ public void TestDotnetVersionAlreadyInstalled()
952960 Actions . RunProcess [ @"chmod u+x dotnet-install.sh" ] = 0 ;
953961 Actions . RunProcess [ @"./dotnet-install.sh --channel release --version 2.1.3 --install-dir C:\Project/.dotnet" ] = 0 ;
954962 Actions . RunProcess [ @"rm dotnet-install.sh" ] = 0 ;
955- Actions . RunProcess [ @"C:\Project/.dotnet/dotnet --info" ] = 0 ;
956- Actions . RunProcess [ @"C:\Project/.dotnet/dotnet clean test.csproj" ] = 0 ;
957- Actions . RunProcess [ @"C:\Project/.dotnet/dotnet restore test.csproj" ] = 0 ;
958963 Actions . RunProcess [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = 0 ;
959964 Actions . RunProcessOut [ @"C:\Project/.dotnet/dotnet --list-runtimes" ] = @"Microsoft.AspNetCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
960965Microsoft.AspNetCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
961966Microsoft.NETCore.App 2.1.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
962967Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]" ;
968+ Actions . RunProcess [ @"C:\Project/.dotnet/dotnet --info" ] = 0 ;
969+ Actions . RunProcess [ @"C:\Project/.dotnet/dotnet clean test.csproj" ] = 0 ;
970+ Actions . RunProcess [ @"C:\Project/.dotnet/dotnet restore test.csproj" ] = 0 ;
963971 Actions . RunProcess [ @"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj" ] = 0 ;
964972 Actions . RunProcess [ @"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ." ] = 0 ;
965973 Actions . RunProcess [ @"C:\odasa/tools/odasa index --xml --extensions config csproj props xml" ] = 0 ;
0 commit comments