From 9aee2dc0027ecb9e8376530eb97b0385cf150a1d Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Thu, 23 May 2024 15:54:25 +0200 Subject: [PATCH] C#: Adjust compiler argument integration test --- .../compiler_args/CompilerArgs.expected | 20 +++++++++++++++++++ .../linux-only/compiler_args/CompilerArgs.ql | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/csharp/ql/integration-tests/linux-only/compiler_args/CompilerArgs.expected b/csharp/ql/integration-tests/linux-only/compiler_args/CompilerArgs.expected index c877d01a695..888a4be5409 100644 --- a/csharp/ql/integration-tests/linux-only/compiler_args/CompilerArgs.expected +++ b/csharp/ql/integration-tests/linux-only/compiler_args/CompilerArgs.expected @@ -1,9 +1,14 @@ | 0 | /noconfig | | 1 | /unsafe- | | 2 | /checked- | +| 3 | /nowarn:1701,1702,1701,1702 | | 4 | /fullpaths | | 5 | /nostdlib+ | +| 6 | /errorreport:prompt | +| 7 | /warn:8 | +| 8 | /define:TRACE;DEBUG;NET;NET8_0;NETCOREAPP;NET5_0_OR_GREATER;NET6_0_OR_GREATER;NET7_0_OR_GREATER;NET8_0_OR_GREATER;NETCOREAPP1_0_OR_GREATER;NETCOREAPP1_1_OR_GREATER;NETCOREAPP2_0_OR_GREATER;NETCOREAPP2_1_OR_GREATER;NETCOREAPP2_2_OR_GREATER;NETCOREAPP3_0_OR_GREATER;NETCOREAPP3_1_OR_GREATER | | 9 | /highentropyva+ | +| 10 | /nullable:enable | | 11 | /reference:[...]/8.0.1/ref/net8.0/Microsoft.CSharp.dll | | 12 | /reference:[...]/8.0.1/ref/net8.0/Microsoft.VisualBasic.Core.dll | | 13 | /reference:[...]/8.0.1/ref/net8.0/Microsoft.VisualBasic.dll | @@ -168,10 +173,24 @@ | 172 | /reference:[...]/8.0.1/ref/net8.0/System.Xml.XPath.XDocument.dll | | 173 | /reference:[...]/8.0.1/ref/net8.0/WindowsBase.dll | | 174 | /debug+ | +| 175 | /debug:portable | +| 176 | /filealign:512 | +| 177 | /generatedfilesout:obj/Debug/net8.0//generated | | 178 | /optimize- | +| 179 | /out:obj/Debug/net8.0/test.dll | +| 180 | /refout:obj/Debug/net8.0/refint/test.dll | +| 181 | /target:exe | | 182 | /warnaserror- | | 183 | /utf8output | | 184 | /deterministic+ | +| 185 | /sourcelink:obj/Debug/net8.0/test.sourcelink.json | +| 186 | /langversion:12.0 | +| 187 | /embed:Program.cs | +| 188 | /embed:obj/Debug/net8.0/test.GlobalUsings.g.cs | +| 189 | /embed:"obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs" | +| 190 | /embed:obj/Debug/net8.0/test.AssemblyInfo.cs | +| 191 | /analyzerconfig:/home/runner/work/semmle-code/semmle-code/.editorconfig | +| 192 | /analyzerconfig:obj/Debug/net8.0/test.GeneratedMSBuildEditorConfig.editorconfig | | 193 | /analyzerconfig:[...]/8.0.101/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_8_default.globalconfig | | 194 | /analyzer:[...]/8.0.101/Sdks/Microsoft.NET.Sdk/targets/../analyzers/Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll | | 195 | /analyzer:[...]/8.0.101/Sdks/Microsoft.NET.Sdk/targets/../analyzers/Microsoft.CodeAnalysis.NetAnalyzers.dll | @@ -185,3 +204,4 @@ | 203 | obj/Debug/net8.0/test.GlobalUsings.g.cs | | 204 | obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | | 205 | obj/Debug/net8.0/test.AssemblyInfo.cs | +| 206 | /warnaserror+:NU1605,SYSLIB0011 | diff --git a/csharp/ql/integration-tests/linux-only/compiler_args/CompilerArgs.ql b/csharp/ql/integration-tests/linux-only/compiler_args/CompilerArgs.ql index 774388896e9..f2aa5c8c4a0 100644 --- a/csharp/ql/integration-tests/linux-only/compiler_args/CompilerArgs.ql +++ b/csharp/ql/integration-tests/linux-only/compiler_args/CompilerArgs.ql @@ -3,7 +3,8 @@ import semmle.code.csharp.commons.Compilation bindingset[arg] private string normalize(string arg) { - not exists(arg.indexOf(":")) and result = arg + (not exists(arg.indexOf(":")) or not exists(arg.indexOf("/8.0"))) and + result = arg or exists(int i, int j | i = arg.indexOf(":") and