diff --git a/csharp/ql/integration-tests/all-platforms/dotnet_pack/Program.cs b/csharp/ql/integration-tests/all-platforms/dotnet_pack/Program.cs new file mode 100644 index 00000000000..3751555cbd3 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/dotnet_pack/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/csharp/ql/integration-tests/all-platforms/dotnet_pack/dotnet_pack.csproj b/csharp/ql/integration-tests/all-platforms/dotnet_pack/dotnet_pack.csproj new file mode 100644 index 00000000000..74abf5c9766 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/dotnet_pack/dotnet_pack.csproj @@ -0,0 +1,10 @@ + + + + Exe + net6.0 + enable + enable + + + diff --git a/csharp/ql/integration-tests/all-platforms/dotnet_pack/test.py b/csharp/ql/integration-tests/all-platforms/dotnet_pack/test.py new file mode 100644 index 00000000000..9eac6efe388 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/dotnet_pack/test.py @@ -0,0 +1,8 @@ +import os +from create_database_utils import * + +run_codeql_database_create(['dotnet pack'], test_db="default-db", db=None, lang="csharp") + +## Check that the NuGet package is created. +if not os.path.isfile("bin/Debug/dotnet_pack.1.0.0.nupkg"): + raise Exception("The NuGet package was not created.") diff --git a/csharp/ql/integration-tests/all-platforms/dotnet_publish/Program.cs b/csharp/ql/integration-tests/all-platforms/dotnet_publish/Program.cs new file mode 100644 index 00000000000..3751555cbd3 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/dotnet_publish/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/csharp/ql/integration-tests/all-platforms/dotnet_publish/dotnet_publish.csproj b/csharp/ql/integration-tests/all-platforms/dotnet_publish/dotnet_publish.csproj new file mode 100644 index 00000000000..74abf5c9766 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/dotnet_publish/dotnet_publish.csproj @@ -0,0 +1,10 @@ + + + + Exe + net6.0 + enable + enable + + + diff --git a/csharp/ql/integration-tests/all-platforms/dotnet_publish/test.py b/csharp/ql/integration-tests/all-platforms/dotnet_publish/test.py new file mode 100644 index 00000000000..ad040a8932b --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/dotnet_publish/test.py @@ -0,0 +1,8 @@ +import os +from create_database_utils import * + +run_codeql_database_create(['dotnet publish'], test_db="default-db", db=None, lang="csharp") + +## Check that the publish folder is created. +if not os.path.isdir("bin/Debug/net6.0/publish/"): + raise Exception("The publish artifact folder was not created.") diff --git a/csharp/ql/integration-tests/posix-only/dotnet_test/UnitTest1.cs b/csharp/ql/integration-tests/posix-only/dotnet_test/UnitTest1.cs new file mode 100644 index 00000000000..4a8e236a7a0 --- /dev/null +++ b/csharp/ql/integration-tests/posix-only/dotnet_test/UnitTest1.cs @@ -0,0 +1,17 @@ +using NUnit.Framework; + +namespace dotnet_test; + +public class Tests +{ + [SetUp] + public void Setup() + { + } + + [Test] + public void Test1() + { + Assert.Pass(); + } +} \ No newline at end of file diff --git a/csharp/ql/integration-tests/posix-only/dotnet_test/dotnet_test.csproj b/csharp/ql/integration-tests/posix-only/dotnet_test/dotnet_test.csproj new file mode 100644 index 00000000000..50852359bb8 --- /dev/null +++ b/csharp/ql/integration-tests/posix-only/dotnet_test/dotnet_test.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + + false + + + + + + + + + + diff --git a/csharp/ql/integration-tests/posix-only/dotnet_test/test.py b/csharp/ql/integration-tests/posix-only/dotnet_test/test.py new file mode 100644 index 00000000000..6e3cdab30f7 --- /dev/null +++ b/csharp/ql/integration-tests/posix-only/dotnet_test/test.py @@ -0,0 +1,3 @@ +from create_database_utils import * + +run_codeql_database_create(['dotnet test'], test_db="default-db", db=None, lang="csharp") \ No newline at end of file diff --git a/csharp/ql/integration-tests/all-platforms/qlpack.yml b/csharp/ql/integration-tests/qlpack.yml similarity index 100% rename from csharp/ql/integration-tests/all-platforms/qlpack.yml rename to csharp/ql/integration-tests/qlpack.yml