Skip to content

Commit fe37460

Browse files
authored
Updated conditional compilation flags (#1479)
1 parent e92d55a commit fe37460

4 files changed

Lines changed: 18 additions & 48 deletions

File tree

Assets/Tests/InputSystem/APIVerificationTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ public void API_DocsDoNotHaveXMLDocErrors()
476476
[Test]
477477
[Category("API")]
478478
[Ignore("Still needs a lot of documentation work to happen")]
479+
#if UNITY_EDITOR_OSX
480+
[Explicit] // Fails due to file system permissions on yamato, but works locally.
481+
#endif
479482
#if !HAVE_DOCTOOLS_INSTALLED
480483
//[Ignore("Must install com.unity.package-manager-doctools package to be able to run this test")]
481484
#endif
@@ -567,6 +570,9 @@ public void API_PrecompiledLayoutsAreUpToDate(string layoutName, string filePath
567570

568571
[Test]
569572
[Category("API")]
573+
#if UNITY_EDITOR_OSX
574+
[Explicit] // Fails due to file system permissions on yamato, but works locally.
575+
#endif
570576
public void API_MonoBehavioursHaveHelpUrls()
571577
{
572578
// We exclude abstract MonoBehaviours as these can't show up in the Unity inspector.

Assets/Tests/InputSystem/Plugins/OnScreenTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ public void Devices_DisablingLastOnScreenControlRemovesCreatedDevice()
162162
Assert.That(InputSystem.devices, Has.None.InstanceOf<Keyboard>());
163163
}
164164

165-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
166165
// https://fogbugz.unity3d.com/f/cases/1271942
167166
[UnityTest]
168167
[Category("Devices")]
@@ -264,8 +263,6 @@ public IEnumerator Devices_CanHaveOnScreenJoystickControls()
264263
Assert.That(Gamepad.all[0].buttonSouth.isPressed, Is.False);
265264
}
266265

267-
#endif
268-
269266
// https://fogbugz.unity3d.com/f/cases/1305016/
270267
[Test]
271268
[Category("Devices")]

Assets/Tests/InputSystem/Plugins/UITests.cs

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ public void UI_InputModuleHasDefaultActions()
232232
// click like the docs say) and also has some questionable behaviors that we opt to do different (for example, we perform
233233
// click detection *before* invoking click handlers so that clickCount and clickTime correspond to the current click instead
234234
// of to the previous click).
235-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
236235
[UnityTest]
237236
[Category("UI")]
238237
#if UNITY_IOS || UNITY_TVOS
@@ -1111,10 +1110,7 @@ public IEnumerator UI_CanDriveUIFromPointer(string deviceLayout, UIPointerType p
11111110
}
11121111
}
11131112

1114-
#endif
1115-
11161113
// https://fogbugz.unity3d.com/f/cases/1232705/
1117-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
11181114
[UnityTest]
11191115
[Category("UI")]
11201116
public IEnumerator UI_CanReceivePointerExitsWhenChangingUIStateWithoutMovingPointer()
@@ -1147,9 +1143,6 @@ public IEnumerator UI_CanReceivePointerExitsWhenChangingUIStateWithoutMovingPoin
11471143
);
11481144
}
11491145

1150-
#endif
1151-
1152-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
11531146
[UnityTest]
11541147
[Category("UI")]
11551148
[TestCase(UIPointerBehavior.SingleUnifiedPointer, ExpectedResult = -1)]
@@ -1368,9 +1361,6 @@ public IEnumerator UI_CanDriveUIFromMultiplePointers(UIPointerBehavior pointerBe
13681361
}
13691362
}
13701363

1371-
#endif
1372-
1373-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
13741364
[UnityTest]
13751365
[Category("UI")]
13761366
public IEnumerator UI_CanDriveUIFromMultipleTouches()
@@ -1575,10 +1565,7 @@ public IEnumerator UI_CanDriveUIFromMultipleTouches()
15751565
Assert.That(scene.leftChildReceiver.events, Is.Empty);
15761566
}
15771567

1578-
#endif
1579-
15801568
// https://fogbugz.unity3d.com/f/cases/1190150/
1581-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
15821569
[UnityTest]
15831570
[Category("UI")]
15841571
public IEnumerator UI_CanUseTouchSimulationWithUI()
@@ -1700,8 +1687,6 @@ public IEnumerator UI_CanUseTouchSimulationWithUI()
17001687
}
17011688
}
17021689

1703-
#endif
1704-
17051690
#if UNITY_IOS || UNITY_TVOS
17061691
[Ignore("Failing on iOS https://jira.unity3d.com/browse/ISX-448")]
17071692
#endif
@@ -1886,7 +1871,6 @@ public IEnumerator UI_CanDriveUIFromMultipleTrackedDevices()
18861871
// from non-pointer devices, we need to decide what to do. What the UI input module does is try to find a pointer (classic
18871872
// or tracked) into which to route the input. Only if it can't find an existing pointer to route the input into will it
18881873
// resort to turning the non-pointer device into a (likely non-functional) pointer.
1889-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
18901874
[UnityTest]
18911875
[Category("UI")]
18921876
public IEnumerator UI_CanTriggerPointerClicksFromNonPointerDevices()
@@ -1925,10 +1909,7 @@ public IEnumerator UI_CanTriggerPointerClicksFromNonPointerDevices()
19251909
.Matches((UICallbackReceiver.Event eventRecord) => eventRecord.pointerData.clickCount == 0));
19261910
}
19271911

1928-
#endif
1929-
19301912
// https://fogbugz.unity3d.com/f/cases/1317239/
1931-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
19321913
[UnityTest]
19331914
[Category("UI")]
19341915
public IEnumerator UI_CanDetectClicks_WithSuccessiveClicksReflectedInClickCount()
@@ -2102,14 +2083,11 @@ public IEnumerator UI_CanDetectClicks_WithSuccessiveClicksReflectedInClickCount(
21022083
);
21032084
}
21042085

2105-
#endif
2106-
21072086
// The UI input module needs to return true from IsPointerOverGameObject() for touches
21082087
// that have ended in the current frame. I.e. even though the touch is already concluded
21092088
// at the InputDevice level, the UI module needs to maintain state for one more frame.
21102089
//
21112090
// https://fogbugz.unity3d.com/f/cases/1347048/
2112-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
21132091
[UnityTest]
21142092
[Category("UI")]
21152093
public IEnumerator UI_TouchPointersAreKeptForOneFrameAfterRelease()
@@ -2145,8 +2123,6 @@ public IEnumerator UI_TouchPointersAreKeptForOneFrameAfterRelease()
21452123
Assert.That(EventSystem.current.IsPointerOverGameObject(), Is.False);
21462124
}
21472125

2148-
#endif
2149-
21502126
[UnityTest]
21512127
[Category("UI")]
21522128
public IEnumerator UI_CallingIsPointerOverGameObject_FromActionCallback_ResultsInWarning()
@@ -2373,7 +2349,6 @@ public void UI_ClickDraggingMouseDoesNotAllocateGCMemory()
23732349
}, Is.Not.AllocatingGCMemory());
23742350
}
23752351

2376-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
23772352
[UnityTest]
23782353
[Category("UI")]
23792354
// Check that two players can have separate UI, and that both selections will stay active when
@@ -2455,8 +2430,6 @@ public IEnumerator UI_CanOperateMultiplayerUIGloballyUsingMouse()
24552430
Assert.That(players[1].eventSystem.currentSelectedGameObject, Is.SameAs(players[1].rightGameObject));
24562431
}
24572432

2458-
#endif
2459-
24602433
// Check that two players can have separate UI and control it using separate gamepads, using
24612434
// MultiplayerEventSystem.
24622435
[UnityTest]
@@ -2774,7 +2747,6 @@ public void UI_CanReassignUIActions()
27742747
Assert.That(uiModule.point?.action, Is.Null);
27752748
}
27762749

2777-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
27782750
[UnityTest]
27792751
[Category("UI")]
27802752
public IEnumerator UI_CanChangeControlsOnActions()
@@ -2819,8 +2791,6 @@ public IEnumerator UI_CanChangeControlsOnActions()
28192791
.Matches((UICallbackReceiver.Event e) => e.pointerData.device == mouse));
28202792
}
28212793

2822-
#endif
2823-
28242794
private class InputSystemUIInputModuleTestScene_Setup : IPrebuildSetup, IPostBuildCleanup
28252795
{
28262796
public void Setup()
@@ -3094,7 +3064,6 @@ public void UI_MovingAndClickingMouseDoesNotAllocateGCMemory()
30943064
}
30953065

30963066
// https://forum.unity.com/threads/feature-request-option-to-disable-deselect-in-ui-input-module.761531
3097-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
30983067
[UnityTest]
30993068
[Category("UI")]
31003069
public IEnumerator UI_CanPreventAutomaticDeselectionOfGameObjects()
@@ -3155,9 +3124,6 @@ public IEnumerator UI_CanPreventAutomaticDeselectionOfGameObjects()
31553124
Assert.That(scene.eventSystem.currentSelectedGameObject, Is.SameAs(scene.leftGameObject));
31563125
}
31573126

3158-
#endif
3159-
3160-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
31613127
[UnityTest]
31623128
[Category("UI")]
31633129
public IEnumerator UI_WhenBindingsAreReResolved_PointerStatesAreKeptInSync()
@@ -3208,8 +3174,6 @@ public IEnumerator UI_WhenBindingsAreReResolved_PointerStatesAreKeptInSync()
32083174
Assert.That(EventSystem.current.IsPointerOverGameObject(), Is.True);
32093175
}
32103176

3211-
#endif
3212-
32133177
////REVIEW: While `deselectOnBackgroundClick` does solve the problem of breaking keyboard and gamepad navigation, the question
32143178
//// IMO is whether navigation should even be affected that way by not having a current selection. Seems to me that the
32153179
//// the system should remember the last selected object and start up navigation from there when nothing is selected.
@@ -3447,11 +3411,16 @@ public void UI_CanDriveVirtualMouseCursorFromGamepad()
34473411
// to our manifest without breaking test runs with previous versions of Unity. However, in 2021.2, all the UITK functionality
34483412
// has moved into the com.unity.modules.uielements module which is also available in previous versions of Unity. This way we
34493413
// can have a reference to UITK that doesn't break things in previous versions of Unity.
3450-
#if UNITY_2021_2_OR_NEWER && !TEMP_DISABLE_UI_TESTS_ON_TRUNK
3414+
#if UNITY_2021_2_OR_NEWER
34513415
[UnityTest]
34523416
[Category("UI")]
34533417
[TestCase(UIPointerBehavior.AllPointersAsIs, ExpectedResult = 1)]
3454-
[TestCase(UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack, ExpectedResult = 1)]
3418+
[TestCase(UIPointerBehavior.SingleMouseOrPenButMultiTouchAndTrack, ExpectedResult = 1
3419+
#if UNITY_STANDALONE_OSX && TEMP_DISABLE_UITOOLKIT_TEST
3420+
// temporarily disable this test case on OSX player for 2021.2. It only intermittently works and I don't know why!
3421+
, Ignore = "Currently fails on OSX IL2CPP player on Unity version 2021.2"
3422+
#endif
3423+
)]
34553424
[TestCase(UIPointerBehavior.SingleUnifiedPointer, ExpectedResult = 1)]
34563425
#if UNITY_ANDROID || UNITY_IOS || UNITY_TVOS
34573426
[Ignore("Currently fails on the farm but succeeds locally on Note 10+; needs looking into.")]
@@ -3602,7 +3571,6 @@ public void Setup()
36023571
}
36033572
#endif
36043573

3605-
#if !TEMP_DISABLE_UI_TESTS_ON_TRUNK
36063574
static bool[] canRunInBackgroundValueSource = new[] { false, true };
36073575

36083576
[UnityTest]
@@ -3697,8 +3665,6 @@ public IEnumerator UI_WhenAppLosesAndRegainsFocus_WhileUIButtonIsPressed_UIButto
36973665
Assert.That(clicked, Is.EqualTo(canRunInBackground));
36983666
}
36993667

3700-
#endif
3701-
37023668
public class MyButton : UnityEngine.UI.Button
37033669
{
37043670
public bool receivedPointerDown;

Assets/Tests/InputSystem/Unity.InputSystem.Tests.asmdef

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "Unity.InputSystem.Tests",
3+
"rootNamespace": "",
34
"references": [
45
"Unity.InputSystem",
56
"Unity.InputSystem.TestFramework",
@@ -31,13 +32,13 @@
3132
},
3233
{
3334
"name": "Unity",
34-
"expression": "[2022.1.0a12,2022.1.0a17)",
35-
"define": "TEMP_DISABLE_UI_TESTS_ON_TRUNK"
35+
"expression": "[2022.2.0a1,2022.2.0a10)",
36+
"define": "TEMP_DISABLE_EDITOR_TESTS_ON_TRUNK"
3637
},
3738
{
3839
"name": "Unity",
39-
"expression": "[2022.1.0a15,2022.1.0a17)",
40-
"define": "TEMP_DISABLE_EDITOR_TESTS_ON_TRUNK"
40+
"expression": "[2021.2,2021.3)",
41+
"define": "TEMP_DISABLE_UITOOLKIT_TEST"
4142
}
4243
],
4344
"noEngineReferences": false

0 commit comments

Comments
 (0)