From 42fca7bf1f63fcc33284c4b57cf427342d2f9c94 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 10 Oct 2023 10:03:12 +0200 Subject: [PATCH] C#: Disable CIL extraction for testing purposes. --- .../Semmle.Extraction.CSharp/Extractor/Analyser.cs | 4 ++-- csharp/extractor/Semmle.Extraction.Tests/Options.cs | 6 +++--- csharp/extractor/Semmle.Extraction/Options.cs | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Analyser.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Analyser.cs index 69fa75d8b2c4..a53c75ed9b0d 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Analyser.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Analyser.cs @@ -67,8 +67,8 @@ public void AnalyseReferences() foreach (var assembly in compilation.References.OfType()) { // CIL first - it takes longer. - if (options.CIL) - extractionTasks.Add(() => DoExtractCIL(assembly)); + // if (options.CIL) + // extractionTasks.Add(() => DoExtractCIL(assembly)); extractionTasks.Add(() => DoAnalyseReferenceAssembly(assembly)); } } diff --git a/csharp/extractor/Semmle.Extraction.Tests/Options.cs b/csharp/extractor/Semmle.Extraction.Tests/Options.cs index 226af193eb1f..5296fd211f88 100644 --- a/csharp/extractor/Semmle.Extraction.Tests/Options.cs +++ b/csharp/extractor/Semmle.Extraction.Tests/Options.cs @@ -22,7 +22,7 @@ public void DefaultOptions() { options = CSharp.Options.CreateWithEnvironment(Array.Empty()); Assert.True(options.Cache); - Assert.True(options.CIL); + // Assert.True(options.CIL); Assert.Null(options.Framework); Assert.Null(options.CompilerName); Assert.Empty(options.CompilerArguments); @@ -48,7 +48,7 @@ public void Cache() Assert.False(options.Cache); } - [Fact] + // [Fact] public void CIL() { options = CSharp.Options.CreateWithEnvironment(Array.Empty()); @@ -114,7 +114,7 @@ public void Console() public void PDB() { options = CSharp.Options.CreateWithEnvironment(new string[] { "--pdb" }); - Assert.True(options.PDB); + // Assert.True(options.PDB); } [Fact] diff --git a/csharp/extractor/Semmle.Extraction/Options.cs b/csharp/extractor/Semmle.Extraction/Options.cs index 798cc73432b5..3b7134873891 100644 --- a/csharp/extractor/Semmle.Extraction/Options.cs +++ b/csharp/extractor/Semmle.Extraction/Options.cs @@ -28,7 +28,7 @@ public abstract class CommonOptions : ICommandLineOptions /// /// Holds if CIL should be extracted. /// - public bool CIL { get; private set; } = true; + public bool CIL { get; private set; } = false; /// /// Holds if assemblies shouldn't be extracted twice. @@ -73,7 +73,7 @@ public virtual bool HandleOption(string key, string value) } return false; case "cil": - CIL = Boolean.Parse(value); + // CIL = Boolean.Parse(value); return true; default: return false; @@ -100,11 +100,11 @@ public virtual bool HandleFlag(string flag, bool value) Cache = value; return true; case "pdb": - PDB = value; - CIL = true; + // PDB = value; + // CIL = true; return true; case "fast": - CIL = !value; + // CIL = !value; Fast = value; return true; case "qltest":