浏览代码

Attempting to fix linux builds. Fixing line ending mismatches when checking out with linux file endings.

/aisv647_visualizations
Jon Hogins 4 年前
当前提交
71186008
共有 4 个文件被更改,包括 17 次插入7 次删除
  1. 4
      .yamato/upm-ci-testprojects.yml
  2. 8
      com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureTests.cs
  3. 8
      com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetJsonUtilityTests.cs
  4. 4
      com.unity.perception/Tests/Runtime/GroundTruthTests/TestHelper.cs

4
.yamato/upm-ci-testprojects.yml


type: Unity::VM::GPU
image: cds-ops/ubuntu-18.04-base:latest
flavor: b1.large
variables:
PATH: /root/.local/bin:/home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
- sudo unity-downloader-cli -u {{ editor.version }} -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
- unity-downloader-cli -u {{ editor.version }} -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
{% if suite.name == "standalone" %}
- DISPLAY=:0.0 utr/utr --testproject=./TestProjects/{{project.name}} --editor-location=.Editor --artifacts_path=test-results --stdout-filter=minimal --extra-editor-arg="--force-vulkan" {{suite.args}}StandaloneLinux64
{% else %}

8
com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureTests.cs


var capturesPath = Path.Combine(DatasetCapture.OutputDirectory, "captures_000.json");
FileAssert.Exists(capturesPath);
StringAssert.Contains(expectedAnnotation, EscapeGuids(File.ReadAllText(capturesPath)));
StringAssert.Contains(TestHelper.NormalizeJson(expectedAnnotation), EscapeGuids(File.ReadAllText(capturesPath)));
}
public struct TestValues

var capturesPath = Path.Combine(DatasetCapture.OutputDirectory, "captures_000.json");
FileAssert.Exists(capturesPath);
StringAssert.Contains(expectedAnnotation, EscapeGuids(File.ReadAllText(capturesPath)));
StringAssert.Contains(TestHelper.NormalizeJson(expectedAnnotation), EscapeGuids(File.ReadAllText(capturesPath)));
}
[Test]

jsonExpected = Regex.Replace(jsonExpected, "^\\s*", "", RegexOptions.Multiline);
}
jsonActual = TestHelper.NormalizeJson(jsonActual);
jsonExpected = TestHelper.NormalizeJson(jsonExpected);
Assert.AreEqual(jsonExpected, jsonActual, $"Expected:\n{jsonExpected}\nActual:\n{jsonActual}");
}

result = TestHelper.NormalizeJson(result);
return result;
}
}

8
com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetJsonUtilityTests.cs


public void Vector3ToJToken_ReturnsArrayFormat(float x, float y, float z, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(new Vector3(x, y, z));
Assert.AreEqual(jsonExpected, jsonActual.ToString());
Assert.AreEqual(TestHelper.NormalizeJson(jsonExpected), TestHelper.NormalizeJson(jsonActual.ToString()));
}
[Test]

public void QuaternionToJToken_ReturnsArrayFormat(float x, float y, float z, float w, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(new Quaternion(x, y, z, w)).ToString();
Assert.AreEqual(jsonExpected, jsonActual);
Assert.AreEqual(TestHelper.NormalizeJson(jsonExpected), TestHelper.NormalizeJson(jsonActual));
}
[Test]

public void Float3x3ToJToken_ReturnsArrayFormat(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(new float3x3(m00, m01, m02, m10, m11, m12, m20, m21, m22)).ToString();
Assert.AreEqual(jsonExpected, jsonActual);
Assert.AreEqual(TestHelper.NormalizeJson(jsonExpected), TestHelper.NormalizeJson(jsonActual));
}
[TestCase(1, "1")]

public void Primitive_ReturnsValue(object o, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(o).ToString();
Assert.AreEqual(jsonExpected, jsonActual);
Assert.AreEqual(TestHelper.NormalizeJson(jsonExpected), TestHelper.NormalizeJson(jsonActual));
}
}
}

4
com.unity.perception/Tests/Runtime/GroundTruthTests/TestHelper.cs


}
#endif
public static string NormalizeJson(string json)
{
return json.Replace("\r\n", "\n");
}
}
}
正在加载...
取消
保存