Skip to content

Commit

Permalink
[fix] style fixes for UTBot integration
Browse files Browse the repository at this point in the history
  • Loading branch information
MchKosticyn authored and dvvrd committed Nov 28, 2022
1 parent 0f15a8d commit 8e0369f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion VSharp.API/VSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void GenerateReport(TextWriter writer)
/// <summary>
/// Gets all generated '.vst' files
/// </summary>
internal IEnumerable<FileInfo> Results()
public IEnumerable<FileInfo> Results()
{
return OutputDir.GetFiles("*.vst");
}
Expand Down
1 change: 0 additions & 1 deletion VSharp.CSharpUtils/VSharp.CSharpUtils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="3.0.0" />
</ItemGroup>
Expand Down
13 changes: 9 additions & 4 deletions VSharp.TestRenderer/RendererTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,23 +471,28 @@ private static (SyntaxNode, SyntaxNode?, string, Assembly) RunTestsRenderer(
}

// Writing generated tests and mocks to files
private static void WriteResults(
private static List<string> WriteResults(
DirectoryInfo outputDir,
string typeName,
SyntaxNode testsProgram,
SyntaxNode? mocksProgram)
{
var files = new List<string>();
var testFilePath = Path.Combine(outputDir.FullName, $"{typeName}Tests.cs");
AddRenderedInFile(testFilePath, testsProgram);
files.Add(testFilePath);
if (mocksProgram != null)
{
var mocksFilePath = Path.Combine(outputDir.FullName, "Mocks.cs");
AddRenderedInFile(mocksFilePath, mocksProgram);
files.Add(mocksFilePath);
}

return files;
}

// API method for Rider extension
public static DirectoryInfo Render(
public static (DirectoryInfo, List<string>) Render(
IEnumerable<FileInfo> tests,
FileInfo testingProject,
Type declaringType,
Expand All @@ -500,9 +505,9 @@ public static DirectoryInfo Render(
var outputDir = testingProject.Directory?.Parent;
Debug.Assert(outputDir != null && outputDir.Exists);
var testProjectPath = GenerateTestProject(outputDir, testingProject, solutionForTests);
WriteResults(outputDir, typeName, testsProgram, mocksProgram);
var renderedFiles = WriteResults(outputDir, typeName, testsProgram, mocksProgram);

return testProjectPath;
return (testProjectPath, renderedFiles);
}

// API method for VSharp
Expand Down
8 changes: 1 addition & 7 deletions VSharp.TestRenderer/VSharp.TestRenderer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.2.0" />
<PackageReference Include="JetBrains.Roslyn.References.Repack" Version="42.42.20220228.125130" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
</ItemGroup>

Expand Down

0 comments on commit 8e0369f

Please sign in to comment.