Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by tonyDai · Nov 28, 2017 at 09:22 AM · unity 5command-lineoptions

Command Line Test Runner option editorTestsCategories not working.

Unity 5.6.4f1 Pro

Command Line Test Runner option editorTestsCategories not working.

My Input: (Window)
Unity.exe -runEditorTests -projectPath D:\TestProject -editorTestsResultFile D:\TestProject\Reoprt.xml -editorTestsCategories LongRunning -testPlatform editmode

My Input: (Mac )
Unity -runEditorTests -projectPath /Users/user/Documents/TestProject -editorTestsResultFile /Users/user/Documents/TestProject/Reoprt.xml -editorTestsExcludeCategories LongRunning -testPlatform editmode

PlayerTest.cs

 using System;
 using NUnit.Framework;
 
 public class PlayerTest
 {
     [Test]
     [Category("LongRunning")]
     public void TestHealth(){
 
         Player player = new Player ();
         player.Health = 1000.0f;
 
         player.Damage (200);
         Assert.AreEqual (800, player.Health);
 
         player.Recover (150);
         Assert.AreEqual (950, player.Health);
     }
 }





Monster.cs

 using UnityEngine;
 using UnityEditor;
 using UnityEngine.TestTools;
 using NUnit.Framework;
 using System.Collections;
 
 public class Monster {
 
     [Test]
     public void Test001() {
 
         Assert.IsNull (null);
     }
 
     [UnityTest]
     public IEnumerator Test002() {
         Assert.IsNull (null);
         yield return null;
     }
 
     [Test]
     [Category("Log")]
     public void Add(){
         Assert.IsNull (null);
     }
 
     [Test]
     [Category("FunTest")]
     public void Clear(){
         Assert.IsNull (null);
     }
 
 }





Reoprt.xml

 <?xml version="1.0" encoding="utf-8"?>
 <test-suite type="TestSuite" id="1018" name="fff" fullname="fff" runstate="Runnable" testcasecount="5" result="Passed" start-time="2017-11-28 03:19:39Z" end-time="2017-11-28 03:19:39Z" duration="0.161594" total="5" passed="5" failed="0" inconclusive="0" skipped="0" asserts="6">
   <test-suite type="Assembly" id="1026" name="Assembly-CSharp-Editor.dll" fullname="D:/CompanyProject/TestCI/fff/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll" runstate="Runnable" testcasecount="5" result="Passed" start-time="2017-11-28 03:19:39Z" end-time="2017-11-28 03:19:39Z" duration="0.118299" total="5" passed="5" failed="0" inconclusive="0" skipped="0" asserts="6">
     <properties>
       <property name="_PID" value="8484" />
       <property name="_APPDOMAIN" value="Unity Child Domain" />
     </properties>
     <test-suite type="TestFixture" id="1019" name="Monster" fullname="Monster" classname="Monster" runstate="Runnable" testcasecount="4" result="Passed" start-time="2017-11-28 03:19:39Z" end-time="2017-11-28 03:19:39Z" duration="0.076698" total="4" passed="4" failed="0" inconclusive="0" skipped="0" asserts="4">
       <test-case id="1022" name="Add" fullname="Monster.Add" methodname="Add" classname="Monster" runstate="Runnable" seed="126888637" result="Passed" start-time="2017-11-28 03:19:39Z" end-time="2017-11-28 03:19:39Z" duration="0.005874" asserts="1">
         <properties>
           <property name="Category" value="Log" />
         </properties>
       </test-case>
       <test-case id="1023" name="Clear" fullname="Monster.Clear" methodname="Clear" classname="Monster" runstate="Runnable" seed="1009024871" result="Passed" start-time="2017-11-28 03:19:39Z" end-time="2017-11-28 03:19:39Z" duration="0.005717" asserts="1">
         <properties>
           <property name="Category" value="FunTest" />
         </properties>
       </test-case>
       <test-case id="1020" name="Test001" fullname="Monster.Test001" methodname="Test001" classname="Monster" runstate="Runnable" seed="1271642661" result="Passed" start-time="2017-11-28 03:19:39Z" end-time="2017-11-28 03:19:39Z" duration="0.005910" asserts="1" />
       <test-case id="1021" name="Test002" fullname="Monster.Test002" methodname="Test002" classname="Monster" runstate="Runnable" seed="1504737957" result="Passed" start-time="2017-11-28 03:19:39Z" end-time="2017-11-28 03:19:39Z" duration="0.009725" asserts="1">
         <properties>
           <property name="_JOINTYPE" value="UnityCombinatorial" />
         </properties>
       </test-case>
     </test-suite>
     <test-suite type="TestFixture" id="1024" name="PlayerTest" fullname="PlayerTest" classname="PlayerTest" runstate="Runnable" testcasecount="1" result="Passed" start-time="2017-11-28 03:19:39Z" end-time="2017-11-28 03:19:39Z" duration="0.017838" total="1" passed="1" failed="0" inconclusive="0" skipped="0" asserts="2">
       <test-case id="1025" name="TestHealth" fullname="PlayerTest.TestHealth" methodname="TestHealth" classname="PlayerTest" runstate="Runnable" seed="1655231227" result="Passed" start-time="2017-11-28 03:19:39Z" end-time="2017-11-28 03:19:39Z" duration="0.013572" asserts="2">
         <properties>
           <property name="Category" value="LongRunning" />
         </properties>
       </test-case>
     </test-suite>
   </test-suite>
 </test-suite>



Should only one record by Category LongRunning.

I need help.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by diegoalejogm · Dec 10, 2017 at 02:51 AM

Hi. I have the same problem in Mac OS X 13.

Any ideas on how to solve this bug? Any response yet from Unity?,I am going through the same scenario!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Dneprokos · Aug 14, 2018 at 08:56 AM

Does anybody have some workaround for this issue?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by MohanadHamed · Sep 13, 2018 at 07:36 AM

Categories per class worked with me but method categories did not work.

Try adding it like this:

  [TestFixture]
  [Category("LongRunning")]
  public class PlayerTest
  {
    ...
  }

And add quotations to category names in command line:

Unity.exe -runEditorTests -projectPath D:\TestProject -editorTestsResultFile D:\TestProject\Reoprt.xml -editorTestsCategories "LongRunning" -testPlatform editmode

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

196 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Accessing my 'Options' panel from another script. 1 Answer

How can i add a new item in dropdown options ? 1 Answer

Loading a scene with script loads multiple copies of another scene, the crashes Unity 0 Answers

List update 0 Answers

Grenade damage script error 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges