Skip to content

Commit d6bafbd

Browse files
author
Unity Technologies
committed
com.unity.test-framework.performance@0.1.31-preview
## [0.1.31] - 2018-7-04 ### mark metadata tests with performance category ## [0.1.30] - 2018-6-27 ### fix Method measurement ## [0.1.29] - 2018-6-12 ### Moving back to json in xml due to multiple instabilities
1 parent 3d6ba78 commit d6bafbd

File tree

7 files changed

+18
-6
lines changed

7 files changed

+18
-6
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [0.1.31] - 2018-7-04
4+
5+
### mark metadata tests with performance category
6+
7+
## [0.1.30] - 2018-6-27
8+
9+
### fix Method measurement
10+
311
## [0.1.29] - 2018-6-12
412

513
### Moving back to json in xml due to multiple instabilities

Editor/EditmodeMetadataCollector.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using UnityEngine.TestTools;
99
using UnityEngine.XR;
1010

11+
[Category("Performance")]
1112
public class EditmodeMetadataCollector : IPrebuildSetup
1213
{
1314
private PerformanceTestRun m_TestRun;

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ YourProject/Packages/manifest.json
1111
``` json
1212
{
1313
"dependencies": {
14-
"com.unity.test-framework.performance": "0.1.29-preview"
14+
"com.unity.test-framework.performance": "0.1.31-preview"
1515
},
1616
"testables": [
1717
"com.unity.test-framework.performance"
18-
],
19-
"registry": "https://staging-packages.unity.com"
18+
]
2019
}
2120
```
2221

Runtime/Measurements/MethodMeasurement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private void RunForIterations(int iterations)
8383
{
8484
m_Action.Invoke();
8585
}
86-
executionTime = (Time.realtimeSinceStartup - executionTime) * 1000f;
86+
executionTime = (Time.realtimeSinceStartup - executionTime) * 1000f / iterations;
8787
Measure.Custom(m_Definition, Utils.ConvertSample(SampleUnit.Millisecond, m_Definition.SampleUnit, executionTime));
8888
}
8989

Runtime/PerformanceTest.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using NUnit.Framework.Interfaces;
77
using NUnit.Framework.Internal;
88
using Unity.PerformanceTesting.Exceptions;
9+
using UnityEditor;
910
using UnityEngine;
1011
using UnityEngine.TestRunner.NUnitExtensions;
1112

@@ -50,13 +51,14 @@ internal static void StartTest(ITest currentTest)
5051
internal static void EndTest(Test test)
5152
{
5253
if (test.IsSuite) return;
54+
if(test.FullName != Active.TestName) return;
5355
DisposeMeasurements();
5456
Active.CalculateStatisticalValues();
5557
Active.EndTime = Utils.DateToInt(DateTime.Now);
5658
if (OnTestEnded != null) OnTestEnded();
5759
Active.LogOutput();
5860

59-
TestContext.Out.Write("##performancetestresult:" + JsonUtility.ToJson(Active));
61+
TestContext.Out.WriteLine("##performancetestresult:" + JsonUtility.ToJson(Active));
6062
Active = null;
6163
}
6264

@@ -66,6 +68,7 @@ private static void DisposeMeasurements()
6668
{
6769
Disposables[i].Dispose();
6870
}
71+
Disposables.Clear();
6972
}
7073

7174
public static SampleGroup GetSampleGroup(SampleGroupDefinition definition)

Runtime/PlaymodeMetadataCollector.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#endif
1616

17+
[Category("Performance")]
1718
public class PlaymodeMetadataCollector : IPrebuildSetup
1819
{
1920
private PerformanceTestRun m_TestRun;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.unity.test-framework.performance",
33
"displayName":"Performance testing API",
4-
"version": "0.1.29-preview",
4+
"version": "0.1.31-preview",
55
"unity": "2018.1",
66
"description": "Performance testing API.",
77
"keywords": ["performance", "test"],

0 commit comments

Comments
 (0)