Skip to content

Dev/sraroseck/draft/update tests/unit tests/dwarf attribute value#1171

Draft
Sasinkas wants to merge 11 commits intomainfrom
dev/sraroseck/draft/UpdateTests/UnitTests/DwarfAttributeValue
Draft

Dev/sraroseck/draft/update tests/unit tests/dwarf attribute value#1171
Sasinkas wants to merge 11 commits intomainfrom
dev/sraroseck/draft/UpdateTests/UnitTests/DwarfAttributeValue

Conversation

@Sasinkas
Copy link
Copy Markdown
Contributor

No description provided.


public AnalyzeCommandIntegrationTests()
{
_tempDir = Path.Combine(Path.GetTempPath(), "BinSkimIntegration", Guid.NewGuid().ToString("N"));

public void Dispose()
{
try { Directory.Delete(_tempDir, recursive: true); } catch { /* best-effort cleanup */ }
{
// BinSkim analyzing its own DLL — PDB is co-located so symbol loading should succeed.
string targetBinary = BinSkimRunner.GetBinSkimDllPath();
string sarifOutput = Path.Combine(_tempDir, "output.sarif");
public async Task Analyze_SelfScan_ProducesValidSarif()
{
string targetBinary = BinSkimRunner.GetBinSkimDllPath();
string sarifOutput = Path.Combine(_tempDir, "output.sarif");
[Fact]
public async Task Analyze_NoValidTargets_ExitsWithNonZero()
{
string nonExistentTarget = Path.Combine(_tempDir, "does_not_exist.dll");
public async Task Analyze_NoValidTargets_ExitsWithNonZero()
{
string nonExistentTarget = Path.Combine(_tempDir, "does_not_exist.dll");
string sarifOutput = Path.Combine(_tempDir, "output.sarif");
{
string assemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string binSkimDll = Path.GetFullPath(
Path.Combine(assemblyDir, "..", "..", "BinSkim.Driver", "release", "BinSkim.dll"));
}
catch (OperationCanceledException)
{
try { process.Kill(entireProcessTree: true); } catch { /* best-effort cleanup */ }
{
string failBinary = GetFunctionalTestDataPath(
"BA2016.MarkImageAsNXCompatible", "Fail", "ManagedFail.dll");
string sarifOutput = Path.Combine(_tempDir, "fail-output.sarif");
public async Task Analyze_RunOnlyRules_FiltersToSpecifiedRule()
{
string targetBinary = BinSkimRunner.GetBinSkimDllPath();
string sarifOutput = Path.Combine(_tempDir, "filtered.sarif");
[Fact]
public async Task ExportRules_ProducesValidSarifOutput()
{
string outputPath = Path.Combine(_tempDir, "rules.sarif");
[Fact]
public async Task ExportConfig_ProducesValidJsonOutput()
{
string outputPath = Path.Combine(_tempDir, "config.json");
Comment on lines +289 to +290
Path.Combine(assemblyDir, "..", "..", "..", "..", "src",
"Test.FunctionalTests.BinSkim.Rules", "FunctionalTestData"));
string testDataRoot = Path.GetFullPath(
Path.Combine(assemblyDir, "..", "..", "..", "..", "src",
"Test.FunctionalTests.BinSkim.Rules", "FunctionalTestData"));
string fullPath = Path.Combine(new[] { testDataRoot }.Concat(relativeParts).ToArray());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants