mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
C#: Add integration test with file added multiple times in the same compilation
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| Generated/x.cs:2:7:2:7 | CS0101: The namespace '<global namespace>' already contains a definition for 'X' |
|
||||
@@ -0,0 +1,4 @@
|
||||
import csharp
|
||||
import semmle.code.csharp.commons.Diagnostics
|
||||
|
||||
query predicate test2(CompilerError e) { any() }
|
||||
@@ -0,0 +1,6 @@
|
||||
| Generated/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs:0:0:0:0 | Generated/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs |
|
||||
| Generated/x.cs:0:0:0:0 | Generated/x.cs |
|
||||
| Program.cs:0:0:0:0 | Program.cs |
|
||||
| obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs:0:0:0:0 | obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs |
|
||||
| obj/Debug/net8.0/test.AssemblyInfo.cs:0:0:0:0 | obj/Debug/net8.0/test.AssemblyInfo.cs |
|
||||
| obj/Debug/net8.0/test.GlobalUsings.g.cs:0:0:0:0 | obj/Debug/net8.0/test.GlobalUsings.g.cs |
|
||||
@@ -0,0 +1,5 @@
|
||||
import csharp
|
||||
|
||||
from File f
|
||||
where f.fromSource()
|
||||
select f
|
||||
@@ -0,0 +1,4 @@
|
||||
// File added to the Generated folder. This is not a source generator output file.
|
||||
class X
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
Console.WriteLine("Hello, World!");
|
||||
|
||||
partial class Test
|
||||
{
|
||||
[GeneratedRegex("abc|def", RegexOptions.IgnoreCase, "en-US")]
|
||||
private static partial Regex AbcOrDefGeneratedRegex();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "8.0.101"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<!-- Add source generated files into the Generated folder. -->
|
||||
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,3 @@
|
||||
from create_database_utils import *
|
||||
|
||||
run_codeql_database_create(['dotnet build'], lang="csharp")
|
||||
Reference in New Issue
Block a user