Skip to content
Merged
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
1 change: 0 additions & 1 deletion src/ProfileTool/ProfileTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<PackAsTool>true</PackAsTool>
<ToolCommandName>asynkron-profiler</ToolCommandName>
<PackageId>asynkron-profiler</PackageId>
<Version>0.1.10</Version>
<Authors>Asynkron</Authors>
<Description>Lightweight CLI for CPU, memory allocation, exception, lock contention, and heap profiling of .NET commands.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
40 changes: 40 additions & 0 deletions tests/Asynkron.Profiler.Tests/ProfileToolProjectTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.IO;
using System.Xml.Linq;
using Xunit;

namespace Asynkron.Profiler.Tests;

public sealed class ProfileToolProjectTests
{
[Fact]
public void ToolProjectDoesNotHardcodeVersion()
{
var repoRoot = FindRepoRoot();
var projectPath = Path.Combine(repoRoot, "src", "ProfileTool", "ProfileTool.csproj");

Assert.True(File.Exists(projectPath), $"Missing tool project at {projectPath}.");

var document = XDocument.Load(projectPath);
var rootNamespace = document.Root?.Name.Namespace ?? XNamespace.None;
var versionElements = document.Descendants(rootNamespace + "Version");

Assert.Empty(versionElements);
}

private static string FindRepoRoot()
{
var current = new DirectoryInfo(AppContext.BaseDirectory);
while (current != null)
{
if (File.Exists(Path.Combine(current.FullName, "Asynkron.Profiler.sln")))
{
return current.FullName;
}

current = current.Parent;
}

throw new InvalidOperationException("Could not locate repo root from test output directory.");
}
}