This commit is contained in:
2026-11-24 15:51:02 +01:00
parent cca4d73e41
commit f4aa17114a
22092 changed files with 5042406 additions and 0 deletions
@@ -0,0 +1,64 @@
using NUnit.Framework;
using UnityEditor.Il2Cpp;
/// <summary>
/// EditMode tests for the Linux x86_64 sysroot package.
/// </summary>
/// <remarks>
/// Verifies construction, a non-null payload path, and that compiler/linker flags
/// include the expected target triple—without requiring the payload to be installed.
/// </remarks>
/// <seealso cref="SysrootLinuxX86_64"/>
class SysrootTestX64
{
/// <summary>
/// Expected Clang/LLVM target triple for the Linux x86_64 sysroot.
/// </summary>
private string targetTriplet = "x86_64-unity-linux-gnu";
/// <summary>
/// Verifies the sysroot package can be instantiated without throwing.
/// </summary>
[Test]
public void TestPackageInitialization()
{
Assert.NotNull(new SysrootLinuxX86_64());
}
/// <summary>
/// Ensures the package reports a payload path string.
/// </summary>
/// <remarks>
/// This test only checks that a non-null string is returned; it does not assert the path exists on disk.
/// </remarks>
[Test]
public void TestPayloadExtracted()
{
var sysrootPackage = new SysrootLinuxX86_64();
Assert.NotNull(sysrootPackage.PathToPayload());
}
/// <summary>
/// Confirms the IL2CPP compiler flags include the expected target triple.
/// </summary>
[Test]
public void TestIL2CPPCompilerFlags()
{
var sysrootPackage = new SysrootLinuxX86_64();
Assert.IsTrue(
string.Equals($"-target {targetTriplet}", sysrootPackage.GetIl2CppCompilerFlags()),
"Compiler flags should exactly match the expected target triple.");
}
/// <summary>
/// Confirms the IL2CPP linker flags include the expected target triple.
/// </summary>
[Test]
public void TestIL2CPPLinkerFlags()
{
var sysrootPackage = new SysrootLinuxX86_64();
Assert.IsTrue(
string.Equals($"-target {targetTriplet}", sysrootPackage.GetIl2CppLinkerFlags()),
"Linker flags should exactly match the expected target triple.");
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 212bed8f12609449899f3f2b7646db0f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
{
"name": "Unity.Sysroot.Linux_x86_64.EditorTests",
"references": [
"Unity.SysrootPackage.Editor",
"Unity.Sysroot.Linux.x86_64",
"Unity.Sysroot.Linux_x86_64"
],
"optionalUnityReferences": [
"TestAssemblies"
],
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": []
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f4dbd28d8bf434681a7afa0d464d1159
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: