Skip to content

Commit d484819

Browse files
authored
Merge pull request #236 from AlamoEngine-Tools/public-testing
[WIP] Public Testing Frameworks
2 parents e9de12f + 4a285c9 commit d484819

160 files changed

Lines changed: 3838 additions & 2627 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ jobs:
2626
dotnet-version: '10.0.x'
2727

2828
- name: Build & Test in Release Mode
29-
run: dotnet test --configuration Release --logger "GitHubActions"
29+
run: dotnet test --configuration Release --report-github
30+
# Ignore exit code 8 on Linux (zero tests are now allowed)
31+
# TODO: Remove this when linux is supported
32+
env:
33+
TESTINGPLATFORM_EXITCODE_IGNORE: ${{ matrix.os == 'ubuntu-latest' && '8' || '' }}

Directory.Build.props

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99
<PropertyGroup>
1010
<Authors>Alamo Engine Tools and Contributors</Authors>
11-
<Copyright>Copyright © 2025 Alamo Engine Tools and contributors. All rights reserved.</Copyright>
11+
<Copyright>Copyright © 2026 Alamo Engine Tools and contributors. All rights reserved.</Copyright>
1212
<Company>Alamo Engine Tools</Company>
1313
<PackageTags>petroglyph, alamo, glyphx, foc, eaw</PackageTags>
1414
<PackageProjectUrl>https://github.com/AlamoEngine-Tools/PetroglyphGameInfrastructure</PackageProjectUrl>
@@ -32,8 +32,7 @@
3232
<Version>3.9.50</Version>
3333
</PackageReference>
3434
<PackageReference Include="SauceControl.InheritDoc" Version="2.0.2" PrivateAssets="all" />
35-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
36-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
35+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.102">
3736
<PrivateAssets>all</PrivateAssets>
3837
</PackageReference>
3938
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="" />

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Alamo Engine Tools
3+
Copyright (c) 2026 Alamo Engine Tools
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

PetroGlyphGameInfrastructure.slnx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
</Folder>
77
<Folder Name="/test/">
88
<Project Path="test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj" />
9-
<Project Path="test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj" />
109
<Project Path="test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj" />
1110
<Project Path="test/PG.StarWarsGame.Infrastructure.Test/PG.StarWarsGame.Infrastructure.Test.csproj" />
11+
</Folder>
12+
<Folder Name="/testing/">
13+
<Project Path="test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj" />
1214
<Project Path="test/PG.StarWarsGame.Infrastructure.Testing/PG.StarWarsGame.Infrastructure.Testing.csproj" />
13-
<Project Path="test/PG.TestingUtilities/PG.TestingUtilities.csproj" />
1415
</Folder>
1516
<Project Path="sampleApp/SampleApplication.csproj" />
1617
</Solution>

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test": {
3+
"runner": "Microsoft.Testing.Platform"
4+
}
5+
}

sampleApp/SampleApplication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.1" />
10+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.2" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/AET.SteamAbstraction/AET.SteamAbstraction.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
3+
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
44
<AssemblyName>AET.SteamAbstraction</AssemblyName>
55
</PropertyGroup>
66
<PropertyGroup>
@@ -21,16 +21,16 @@
2121
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2222
</PropertyGroup>
2323
<ItemGroup>
24-
<PackageReference Include="AnakinRaW.CommonUtilities.Registry" Version="12.3.9" />
25-
<PackageReference Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
26-
<PackageReference Include="AnakinRaW.CommonUtilities" Version="12.3.9" />
27-
<PackageReference Include="AnakinRaW.CommonUtilities.FileSystem" Version="12.3.9" />
28-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
29-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.1" />
30-
<PackageReference Include="Nullable" Version="1.3.1">
24+
<PackageReference Include="AnakinRaW.CommonUtilities.Registry" Version="13.0.1" />
25+
<PackageReference Include="AnakinRaW.CommonUtilities" Version="13.0.1" />
26+
<PackageReference Include="AnakinRaW.CommonUtilities.FileSystem" Version="13.0.1" />
27+
<PackageReference Include="System.Text.Json" Version="10.0.2" />
28+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.2" />
29+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.2" />
30+
<PackageReference Include="Microsoft.Bcl.HashCode" Version="6.0.0" Condition="$(TargetFramework) == 'netstandard2.0'" />
31+
<PackageReference Include="Nullable" Version="1.3.1" Condition="$(TargetFramework) == 'netstandard2.0'">
3132
<PrivateAssets>all</PrivateAssets>
3233
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3334
</PackageReference>
34-
<PackageReference Include="System.Text.Json" Version="10.0.1" />
3535
</ItemGroup>
3636
</Project>

src/AET.SteamAbstraction/Library/SteamLibrary.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ internal class SteamLibrary : ISteamLibrary
1919
TrailingDirectorySeparatorBehavior = TrailingDirectorySeparatorBehavior.Trim
2020
};
2121

22+
private readonly string _normalizedLocation;
2223
private readonly ILogger? _logger;
2324
private readonly ConcurrentDictionary<KnownLibraryLocations, IDirectoryInfo> _locations = new();
2425

26+
private protected readonly IFileSystem FileSystem;
27+
2528
private readonly Dictionary<KnownLibraryLocations, string[]> _locationsNames = new()
2629
{
2730
{ KnownLibraryLocations.SteamApps, ["steamapps"] },
2831
{ KnownLibraryLocations.Common, ["steamapps", "common"] },
2932
{ KnownLibraryLocations.Workshops, ["steamapps", "workshop"] }
3033
};
3134

32-
private readonly string _normalizedLocation;
33-
private readonly IFileSystem _fileSystem;
34-
3535
public IDirectoryInfo LibraryLocation { get; }
3636

3737
public IDirectoryInfo SteamAppsLocation => GetKnownLibraryLocation(KnownLibraryLocations.SteamApps);
@@ -46,9 +46,9 @@ public SteamLibrary(IDirectoryInfo libraryLocation, IServiceProvider serviceProv
4646
throw new ArgumentNullException(nameof(libraryLocation));
4747
if (serviceProvider == null)
4848
throw new ArgumentNullException(nameof(serviceProvider));
49-
_fileSystem = serviceProvider.GetRequiredService<IFileSystem>();
49+
FileSystem = serviceProvider.GetRequiredService<IFileSystem>();
5050
_logger = serviceProvider.GetService<ILoggerFactory>()?.CreateLogger(GetType());
51-
_normalizedLocation = PathNormalizer.Normalize(_fileSystem.Path.GetFullPath(libraryLocation.FullName), SteamLibraryPathNormalizeOptions);
51+
_normalizedLocation = PathNormalizer.Normalize(FileSystem.Path.GetFullPath(libraryLocation.FullName), SteamLibraryPathNormalizeOptions);
5252
LibraryLocation = libraryLocation;
5353
}
5454

@@ -91,7 +91,7 @@ public bool Equals(ISteamLibrary? other)
9191
if (ReferenceEquals(this, other))
9292
return true;
9393

94-
var normalizedOtherPath = PathNormalizer.Normalize(_fileSystem.Path.GetFullPath(other.LibraryLocation.FullName), SteamLibraryPathNormalizeOptions);
94+
var normalizedOtherPath = PathNormalizer.Normalize(FileSystem.Path.GetFullPath(other.LibraryLocation.FullName), SteamLibraryPathNormalizeOptions);
9595
return _normalizedLocation.Equals(normalizedOtherPath);
9696
}
9797

src/AET.SteamAbstraction/Linux/LinuxSteamRegistry.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO.Abstractions;
44
using AET.SteamAbstraction.Registry;
55
using AnakinRaW.CommonUtilities;
6+
using AnakinRaW.CommonUtilities.Registry;
67

78
namespace AET.SteamAbstraction;
89

@@ -16,4 +17,9 @@ internal class LinuxSteamRegistry(IServiceProvider serviceProvider) : Disposable
1617
public IDirectoryInfo? InstallationDirectory { get; }
1718

1819
public int? ProcessId { get; }
20+
21+
public IRegistryKey? OpenSteamRegistryKey()
22+
{
23+
throw new NotImplementedException();
24+
}
1925
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Runtime.CompilerServices;
22

33
[assembly: InternalsVisibleTo("AET.SteamAbstraction.Test")]
4-
[assembly: InternalsVisibleTo("AET.SteamAbstraction.TestingUtilities")]
4+
[assembly: InternalsVisibleTo("AET.SteamAbstraction.Testing")]
55

66
[assembly: InternalsVisibleTo("PG.StarWarsGame.Infrastructure.Clients.Steam.Test")]
77

0 commit comments

Comments
 (0)