Skip to content

Commit 659f1cc

Browse files
committed
C#: Add integration tests for dotnet run
1 parent cc09a79 commit 659f1cc

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Console.WriteLine(args.Length > 0 ? args[0] + ", " + args[1] : "");
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from create_database_utils import *
2+
3+
# no arguments
4+
run_codeql_database_create(['dotnet run'], test_db="test-db", db=None, lang="csharp")
5+
6+
# no arguments, but `--`
7+
run_codeql_database_create(['dotnet clean', 'rm -rf test-db obj bin', 'dotnet run --'], test_db="test2-db", db=None, lang="csharp")
8+
9+
# two arguments, no `--`
10+
run_codeql_database_create(['dotnet clean', 'rm -rf test2-db obj bin', 'dotnet run hello world'], test_db="test3-db", db=None, lang="csharp")
11+
12+
# two arguments, and `--`
13+
run_codeql_database_create(['dotnet clean', 'rm -rf test3-db obj bin', 'dotnet run -- hello world'], test_db="test4-db", db=None, lang="csharp")
14+
15+
# shared compilation enabled; tracer should override by changing the command
16+
# to `dotnet run -p:UseSharedCompilation=true -p:UseSharedCompilation=false -- hello world`
17+
run_codeql_database_create(['dotnet clean', 'rm -rf test4-db obj bin', 'dotnet run -p:UseSharedCompilation=true -- hello world'], test_db="test5-db", db=None, lang="csharp")

0 commit comments

Comments
 (0)