|
|
|
|
@@ -340,6 +340,9 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
string nugetRestore = null, string allSolutions = null,
|
|
|
|
|
string cwd = @"C:\Project")
|
|
|
|
|
{
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_AUTOBUILDER_CSHARP_NO_INDEXING"] = "false";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_ROOT"] = @"C:\codeql\csharp";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_JAVA_HOME"] = @"C:\codeql\tools\java";
|
|
|
|
|
Actions.GetEnvironmentVariable["SEMMLE_DIST"] = @"C:\odasa";
|
|
|
|
|
Actions.GetEnvironmentVariable["SEMMLE_JAVA_HOME"] = @"C:\odasa\tools\java";
|
|
|
|
|
Actions.GetEnvironmentVariable["LGTM_PROJECT_LANGUAGE"] = lgtmLanguage;
|
|
|
|
|
@@ -373,12 +376,12 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.RunProcess["cmd.exe /C dotnet clean test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess["cmd.exe /C dotnet restore test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\java\bin\java -jar C:\odasa\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists["test.csproj"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\nbar.cs\ntest.csproj";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
var xml = new XmlDocument();
|
|
|
|
|
@@ -402,12 +405,12 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.RunProcess["dotnet clean test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess["dotnet restore test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools\java/bin/java -jar C:\odasa/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists["test.csproj"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.cs\ntest.csproj";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
var xml = new XmlDocument();
|
|
|
|
|
@@ -428,8 +431,8 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
public void TestLinuxCSharpAutoBuilderExtractorFailed()
|
|
|
|
|
{
|
|
|
|
|
Actions.FileExists["csharp.log"] = false;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.cs";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -454,7 +457,7 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestCppAutobuilderSuccess()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore C:\Project\test.sln"] = 1;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\csharp\tools\nuget.exe restore C:\Project\test.sln"] = 1;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C CALL ^""C:\Program Files ^(x86^)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat^"" && C:\odasa\tools\odasa index --auto msbuild C:\Project\test.sln /p:UseSharedCompilation=false /t:rebuild /p:Platform=""x86"" /p:Configuration=""Release"" /p:MvcBuildViews=true"] = 0;
|
|
|
|
|
Actions.RunProcessOut[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -prerelease -legacy -property installationPath"] = "";
|
|
|
|
|
Actions.RunProcess[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -prerelease -legacy -property installationPath"] = 1;
|
|
|
|
|
@@ -522,11 +525,11 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
public void TestLinuxBuildlessExtractionSuccess()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools/csharp/Semmle.Extraction.CSharp.Standalone --references:."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools\java/bin/java -jar C:\odasa/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.sln";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -539,8 +542,8 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools/csharp/Semmle.Extraction.CSharp.Standalone --references:."] = 10;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.sln";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -552,11 +555,11 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
public void TestLinuxBuildlessExtractionSolution()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools/csharp/Semmle.Extraction.CSharp.Standalone foo.sln --references:."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools\java/bin/java -jar C:\odasa/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.sln";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -596,11 +599,11 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
public void TestLinuxBuildCommand()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto ""./build.sh --skip-tests"""] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools\java/bin/java -jar C:\odasa/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.sln";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -615,12 +618,12 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
{
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\nbuild/build.sh";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.RunProcess["/bin/chmod u+x build/build.sh"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto build/build.sh"] = 0;
|
|
|
|
|
Actions.RunProcessWorkingDirectory[@"C:\odasa/tools/odasa index --auto build/build.sh"] = "build";
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools\java/bin/java -jar C:\odasa/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
|
|
|
|
|
@@ -633,8 +636,8 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
{
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\nbuild.sh";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
|
|
|
|
|
Actions.RunProcess["/bin/chmod u+x build.sh"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto build.sh"] = 0;
|
|
|
|
|
@@ -650,8 +653,8 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
{
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\nbuild.sh";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
|
|
|
|
|
Actions.RunProcess["/bin/chmod u+x build.sh"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto build.sh"] = 5;
|
|
|
|
|
@@ -667,11 +670,11 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
{
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\nbuild.bat";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto build.bat"] = 0;
|
|
|
|
|
Actions.RunProcessWorkingDirectory[@"cmd.exe /C C:\odasa\tools\odasa index --auto build.bat"] = "";
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\java\bin\java -jar C:\odasa\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
|
|
|
|
|
@@ -684,11 +687,11 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
{
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\nbuild.bat";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto build.bat"] = 1;
|
|
|
|
|
Actions.RunProcessWorkingDirectory[@"cmd.exe /C C:\odasa\tools\odasa index --auto build.bat"] = "";
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\java\bin\java -jar C:\odasa\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
|
|
|
|
|
@@ -700,13 +703,13 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
public void TestWindowsCmdIgnoreErrors()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess["cmd.exe /C C:\\odasa\\tools\\odasa index --auto ^\"build.cmd --skip-tests^\""] = 3;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\java\bin\java -jar C:\odasa\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
SkipVsWhere();
|
|
|
|
|
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.sln";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -717,11 +720,11 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestWindowCSharpMsBuild()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore C:\Project\test1.sln"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\csharp\tools\nuget.exe restore C:\Project\test1.sln"] = 0;
|
|
|
|
|
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test1.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore C:\Project\test2.sln"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\csharp\tools\nuget.exe restore C:\Project\test2.sln"] = 0;
|
|
|
|
|
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test2.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\java\bin\java -jar C:\odasa\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"] = false;
|
|
|
|
|
@@ -730,8 +733,8 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"] = false;
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"] = true;
|
|
|
|
|
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest1.cs\ntest2.cs";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -748,11 +751,11 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestWindowCSharpMsBuildMultipleSolutions()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore test1.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\csharp\tools\nuget.exe restore test1.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && C:\\odasa\\tools\\odasa index --auto msbuild test1.csproj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore test2.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\csharp\tools\nuget.exe restore test2.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && C:\\odasa\\tools\\odasa index --auto msbuild test2.csproj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\java\bin\java -jar C:\odasa\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists[@"test1.csproj"] = true;
|
|
|
|
|
@@ -763,8 +766,8 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"] = false;
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"] = true;
|
|
|
|
|
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "test1.csproj\ntest2.csproj\ntest1.cs\ntest2.cs";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -795,7 +798,7 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestWindowCSharpMsBuildFailed()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore C:\Project\test1.sln"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\csharp\tools\nuget.exe restore C:\Project\test1.sln"] = 0;
|
|
|
|
|
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test1.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 1;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"] = false;
|
|
|
|
|
@@ -803,8 +806,8 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"] = true;
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"] = false;
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest1.cs\ntest2.cs";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -824,7 +827,7 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test1.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
|
|
|
|
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && C:\\odasa\\tools\\odasa index --auto msbuild C:\\Project\\test2.sln /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\java\bin\java -jar C:\odasa\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"] = false;
|
|
|
|
|
@@ -832,8 +835,8 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"] = true;
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"] = false;
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest1.cs\ntest2.cs";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -852,11 +855,11 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
public void TestSkipNugetBuildless()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools/csharp/Semmle.Extraction.CSharp.Standalone foo.sln --references:. --skip-nuget"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools\java/bin/java -jar C:\odasa/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.sln";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -872,12 +875,12 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.RunProcess["dotnet clean test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess["dotnet restore test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto dotnet build --no-incremental /p:UseSharedCompilation=false --no-restore test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools\java/bin/java -jar C:\odasa/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists["test.csproj"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.cs\ntest.csproj";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
var xml = new XmlDocument();
|
|
|
|
|
@@ -907,12 +910,12 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.RunProcess[@"C:\Project/.dotnet/dotnet clean test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\Project/.dotnet/dotnet restore test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools\java/bin/java -jar C:\odasa/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists["test.csproj"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["PATH"] = "/bin:/usr/bin";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.cs\ntest.csproj";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
@@ -943,12 +946,12 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.RunProcess[@"C:\Project/.dotnet/dotnet clean test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\Project/.dotnet/dotnet restore test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto C:\Project/.dotnet/dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools\java/bin/java -jar C:\odasa/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists["test.csproj"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["PATH"] = "/bin:/usr/bin";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\nbar.cs\ntest.csproj";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
@@ -977,12 +980,12 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\Project\.dotnet\dotnet clean test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\Project\.dotnet\dotnet restore test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\.dotnet\dotnet build --no-incremental /p:UseSharedCompilation=false test.csproj"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\java\bin\java -jar C:\odasa\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists["test.csproj"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["PATH"] = "/bin:/usr/bin";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "foo.cs\ntest.cs\ntest.csproj";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
@@ -1003,9 +1006,9 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestDirsProjWindows()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\csharp\nuget\nuget.exe restore dirs.proj"] = 1;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\csharp\tools\nuget.exe restore dirs.proj"] = 1;
|
|
|
|
|
Actions.RunProcess["cmd.exe /C CALL ^\"C:\\Program Files ^(x86^)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat^\" && C:\\odasa\\tools\\odasa index --auto msbuild dirs.proj /p:UseSharedCompilation=false /t:Windows /p:Platform=\"x86\" /p:Configuration=\"Debug\" /p:MvcBuildViews=true /P:Fu=Bar"] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\java\bin\java -jar C:\odasa\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\codeql\tools\java\bin\java -jar C:\codeql\csharp\tools\extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"cmd.exe /C C:\odasa\tools\odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists[@"a\test.csproj"] = true;
|
|
|
|
|
@@ -1016,8 +1019,8 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"] = false;
|
|
|
|
|
Actions.FileExists[@"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"] = true;
|
|
|
|
|
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "a\\test.cs\na\\test.csproj\ndirs.proj";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -1046,15 +1049,15 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestDirsProjLinux()
|
|
|
|
|
{
|
|
|
|
|
Actions.RunProcess[@"mono C:\odasa\tools/csharp/nuget/nuget.exe restore dirs.proj"] = 1;
|
|
|
|
|
Actions.RunProcess[@"mono C:\codeql\csharp/tools/nuget.exe restore dirs.proj"] = 1;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --auto msbuild dirs.proj /p:UseSharedCompilation=false /t:rebuild /p:MvcBuildViews=true"] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa\tools\java/bin/java -jar C:\odasa/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\codeql\tools\java/bin/java -jar C:\codeql\csharp/tools/extractor-asp.jar ."] = 0;
|
|
|
|
|
Actions.RunProcess[@"C:\odasa/tools/odasa index --xml --extensions config csproj props xml"] = 0;
|
|
|
|
|
Actions.FileExists["csharp.log"] = true;
|
|
|
|
|
Actions.FileExists["a/test.csproj"] = true;
|
|
|
|
|
Actions.FileExists["dirs.proj"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "a/test.cs\na/test.csproj\ndirs.proj";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|
|
|
|
|
@@ -1083,8 +1086,8 @@ namespace Semmle.Extraction.Tests
|
|
|
|
|
public void TestCyclicDirsProj()
|
|
|
|
|
{
|
|
|
|
|
Actions.FileExists["dirs.proj"] = true;
|
|
|
|
|
Actions.GetEnvironmentVariable["TRAP_FOLDER"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["SOURCE_ARCHIVE"] = null;
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_TRAP_DIR"] = "";
|
|
|
|
|
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR"] = "";
|
|
|
|
|
Actions.FileExists["csharp.log"] = false;
|
|
|
|
|
Actions.EnumerateFiles[@"C:\Project"] = "dirs.proj";
|
|
|
|
|
Actions.EnumerateDirectories[@"C:\Project"] = "";
|
|
|
|
|
|