浏览代码

Adding CloudTest decorations

/with_cloud_tests
Jon Hogins 4 年前
当前提交
9a2a97a8
共有 9 个文件被更改,包括 152 次插入1 次删除
  1. 21
      com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureSensorSchedulingTests.cs
  2. 72
      com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureTests.cs
  3. 10
      com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetJsonUtilityTests.cs
  4. 6
      com.unity.perception/Tests/Runtime/GroundTruthTests/ObjectCountLabelerTests.cs
  5. 6
      com.unity.perception/Tests/Runtime/GroundTruthTests/PerceptionCameraIntegrationTests.cs
  6. 3
      com.unity.perception/Tests/Runtime/GroundTruthTests/RenderedObjectInfoTests.cs
  7. 15
      com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs
  8. 12
      com.unity.perception/Tests/Runtime/GroundTruthTests/VisualizationTests.cs
  9. 8
      com.unity.perception/Tests/Runtime/Unity.Perception.Runtime.Tests.asmdef

21
com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureSensorSchedulingTests.cs


}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator FramesScheduledBySensorConfig()
{
var ego = DatasetCapture.RegisterEgo("ego");

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator FramesScheduled_WithTimeScale_ResultsInProperDeltaTime()
{
var ego = DatasetCapture.RegisterEgo("ego");

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator ChangingTimeScale_CausesDebugError()
{
var ego = DatasetCapture.RegisterEgo("ego");

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator ChangingTimeScale_DuringStartNewSequence_Succeeds()
{
var ego = DatasetCapture.RegisterEgo("ego");

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator ResetSimulation_ResetsCaptureDeltaTime()
{
var ego = DatasetCapture.RegisterEgo("ego");

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator ShouldCaptureThisFrame_ReturnsTrueOnProperFrames()
{
var ego = DatasetCapture.RegisterEgo("ego");

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void Enabled_StartsTrue()
{
var sensor1 = DatasetCapture.RegisterSensor(DatasetCapture.RegisterEgo(""), "cam", "1", 1, 1);

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


public class DatasetCaptureTests
{
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void RegisterSensor_ReportsProperJson()
{
var egoDescription = @"the main car driving in simulation";

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ReportCapture_ReportsProperJson()
{
var filename = "my/file.png";

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator StartNewSequence_ProperlyIncrementsSequence()
{
var timingsExpected = new(int step, int timestamp, bool expectNewSequence)[]

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ReportAnnotation_AddsProperJsonToCapture()
{
var filename = "my/file.png";

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ReportAnnotationValues_ReportsProperJson()
{
var values = new[]

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ReportAnnotationFile_WhenCaptureNotExpected_Throws()
{
var ego = DatasetCapture.RegisterEgo("");

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ReportAnnotationValues_WhenCaptureNotExpected_Throws()
{
var ego = DatasetCapture.RegisterEgo("");

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ReportAnnotationAsync_WhenCaptureNotExpected_Throws()
{
var ego = DatasetCapture.RegisterEgo("");

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ResetSimulation_WithUnreportedAnnotationAsync_LogsError()
{
var ego = DatasetCapture.RegisterEgo("");

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ResetSimulation_CallsSimulationEnding()
{
int timesCalled = 0;

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void AnnotationAsyncIsValid_ReturnsProperValue()
{
LogAssert.ignoreFailingMessages = true; //we aren't worried about "Simulation ended with pending..."

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void AnnotationAsyncReportFile_ReportsProperJson()
{
var expectedAnnotation = $@" ""annotations"": [

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void AnnotationAsyncReportValues_ReportsProperJson()
{
var values = new[]

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void CreateAnnotation_MultipleTimes_WritesProperTypeOnce()
{
var annotationDefinitionGuid = new Guid(10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void CreateAnnotation_MultipleTimesWithDifferentParameters_WritesProperTypes()
{
var annotationDefinitionGuid = new Guid(10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ReportMetricValues_WhenCaptureNotExpected_Throws()
{
var ego = DatasetCapture.RegisterEgo("");

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ReportMetricAsync_WhenCaptureNotExpected_Throws()
{
var ego = DatasetCapture.RegisterEgo("");

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void ResetSimulation_WithUnreportedMetricAsync_LogsError()
{
var ego = DatasetCapture.RegisterEgo("");

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void MetricAsyncIsValid_ReturnsProperValue()
{
LogAssert.ignoreFailingMessages = true; //we aren't worried about "Simulation ended with pending..."

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator MetricReportValues_WithNoReportsInFrames_DoesNotIncrementStep()
{
var values = new[] { 1 };

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator SensorHandleReportMetric_BeforeReportCapture_ReportsProperJson()
{
var values = new[] { 1 };

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void MetricAsyncReportValues_ReportsProperJson(
[Values(MetricTarget.Global, MetricTarget.Capture, MetricTarget.Annotation)] MetricTarget metricTarget,
[Values(true, false)] bool async,

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void CreateMetric_MultipleTimesWithDifferentParameters_WritesProperTypes()
{
var metricDefinitionGuid = new Guid(10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void CreateAnnotationOrMetric_WithSpecValues_WritesProperTypes(
[Values(AdditionalInfoKind.Annotation, AdditionalInfoKind.Metric)] AdditionalInfoKind additionalInfoKind)
{

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


""NaN"",
""Infinity""
]")]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void Vector3ToJToken_ReturnsArrayFormat(float x, float y, float z, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(new Vector3(x, y, z));

""Infinity"",
""NaN""
]")]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
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(TestHelper.NormalizeJson(jsonExpected), TestHelper.NormalizeJson(jsonActual));
}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void Primitive_ReturnsValue(object o, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(o).ToString();

6
com.unity.perception/Tests/Runtime/GroundTruthTests/ObjectCountLabelerTests.cs


class ObjectCountLabelerTests : GroundTruthTestBase
{
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void NullLabelingConfiguration_ProducesInvalidOperationException()
{
// ReSharper disable once ObjectCreationAsStatement

#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator ProducesCorrectValuesWithChangingObjects()
{
var label = "label";

6
com.unity.perception/Tests/Runtime/GroundTruthTests/PerceptionCameraIntegrationTests.cs


{
[UnityTest]
[UnityPlatform(RuntimePlatform.LinuxPlayer, RuntimePlatform.WindowsPlayer)]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator EnableBoundingBoxes_GeneratesCorrectDataset()
{
//set resolution to ensure we don't have rounding in rendering leading to bounding boxes to change height/width

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator EnableSemanticSegmentation_GeneratesCorrectDataset()
{
SetupCamera(pc =>

3
com.unity.perception/Tests/Runtime/GroundTruthTests/RenderedObjectInfoTests.cs


}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator ProducesCorrectBoundingBoxes([ValueSource(nameof(ProducesCorrectBoundingBoxesTestCases))] ProducesCorrectObjectInfoData producesCorrectObjectInfoData)
{
var label = "label";

15
com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs


// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
// `yield return null;` to skip a frame.
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator SegmentationPassTestsWithEnumeratorPasses(
[Values(false, true)] bool useSkinnedMeshRenderer,
[Values(SegmentationKind.Instance, SegmentationKind.Semantic)] SegmentationKind segmentationKind)

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator SemanticSegmentationPass_WithLabeledButNotMatchingObject_ProducesBlack()
{
int timesSegmentationImageReceived = 0;

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator SemanticSegmentationPass_WithEmptyFrame_ProducesBlack([Values(false, true)] bool showVisualizations)
{
int timesSegmentationImageReceived = 0;

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator SemanticSegmentationPass_WithTextureOverride_RendersToOverride([Values(true, false)] bool showVisualizations)
{
var expectedPixelValue = new Color32(0, 0, 255, 255);

}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator SegmentationPassProducesCorrectValuesEachFrame(
[Values(SegmentationKind.Instance, SegmentationKind.Semantic)] SegmentationKind segmentationKind)
{

12
com.unity.perception/Tests/Runtime/GroundTruthTests/VisualizationTests.cs


public class VisualizationTests : GroundTruthTestBase
{
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void VisualizedCamera_SetsUpCanvasAndSecondCamera()
{
var object1 = new GameObject();

Assert.IsNotNull(GameObject.Find(nameof(VisualizedCamera_SetsUpCanvasAndSecondCamera) + "_VisualizationCanvas"));
}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void TwoCamerasVisualizing_CausesWarningAndDisablesVisualization()
{
var object1 = new GameObject();

object2.SetActive(true);
}
[UnityTest]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public IEnumerator DestroyCamera_RemovesVisualization()
{
var object1 = new GameObject();

Assert.IsNull(GameObject.Find(nameof(DestroyCamera_RemovesVisualization) + "_VisualizationCamera"));
}
[Test]
#if SIMULATION_TOOLS_PRESENT
[Unity.Simulation.Tools.CloudTest]
#endif
public void DestroyAndRecreateCamera_ProperlyVisualizes()
{
var object1 = new GameObject();

8
com.unity.perception/Tests/Runtime/Unity.Perception.Runtime.Tests.asmdef


"Unity.Perception.Editor",
"Unity.Simulation.Core",
"Unity.RenderPipelines.HighDefinition.Runtime",
"Unity.RenderPipelines.Universal.Runtime"
"Unity.RenderPipelines.Universal.Runtime",
"com.unity.simulation.tools"
],
"includePlatforms": [],
"excludePlatforms": [],

"name": "com.unity.render-pipelines.high-definition",
"expression": "",
"define": "HDRP_PRESENT"
},
{
"name": "com.unity.simulation.tools",
"expression": "",
"define": "SIMULATION_TOOLS_PRESENT"
}
],
"noEngineReferences": false
正在加载...
取消
保存