Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C#: Disable CIL extraction for testing purposes. #14422

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public void AnalyseReferences()
foreach (var assembly in compilation.References.OfType<PortableExecutableReference>())
{
// CIL first - it takes longer.
if (options.CIL)
extractionTasks.Add(() => DoExtractCIL(assembly));
// if (options.CIL)
// extractionTasks.Add(() => DoExtractCIL(assembly));
extractionTasks.Add(() => DoAnalyseReferenceAssembly(assembly));
}
}
Expand Down
6 changes: 3 additions & 3 deletions csharp/extractor/Semmle.Extraction.Tests/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{
options = CSharp.Options.CreateWithEnvironment(Array.Empty<string>());
Assert.True(options.Cache);
Assert.True(options.CIL);
// Assert.True(options.CIL);
Assert.Null(options.Framework);
Assert.Null(options.CompilerName);
Assert.Empty(options.CompilerArguments);
Expand All @@ -48,8 +48,8 @@
Assert.False(options.Cache);
}

[Fact]
// [Fact]
public void CIL()

Check warning on line 52 in csharp/extractor/Semmle.Extraction.Tests/Options.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build

Public method 'CIL' on test class 'OptionsTests' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)

Check warning on line 52 in csharp/extractor/Semmle.Extraction.Tests/Options.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build

Public method 'CIL' on test class 'OptionsTests' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)

Check warning on line 52 in csharp/extractor/Semmle.Extraction.Tests/Options.cs

View workflow job for this annotation

GitHub Actions / unit-tests (ubuntu-latest)

Public method 'CIL' on test class 'OptionsTests' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method. (https://xunit.net/xunit.analyzers/rules/xUnit1013)

Check warning on line 52 in csharp/extractor/Semmle.Extraction.Tests/Options.cs

View workflow job for this annotation

GitHub Actions / unit-tests (windows-2019)

Public method 'CIL' on test class 'OptionsTests' should be marked as a Fact. Reduce the visibility of the method, or add a Fact attribute to the method.
{
options = CSharp.Options.CreateWithEnvironment(Array.Empty<string>());
Assert.True(options.CIL);
Expand Down Expand Up @@ -114,7 +114,7 @@
public void PDB()
{
options = CSharp.Options.CreateWithEnvironment(new string[] { "--pdb" });
Assert.True(options.PDB);
// Assert.True(options.PDB);
}

[Fact]
Expand Down
10 changes: 5 additions & 5 deletions csharp/extractor/Semmle.Extraction/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class CommonOptions : ICommandLineOptions
/// <summary>
/// Holds if CIL should be extracted.
/// </summary>
public bool CIL { get; private set; } = true;
public bool CIL { get; private set; } = false;

/// <summary>
/// Holds if assemblies shouldn't be extracted twice.
Expand Down Expand Up @@ -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;
Expand All @@ -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":
Expand Down
Loading