-
-
Notifications
You must be signed in to change notification settings - Fork 367
/
Main.hs
104 lines (90 loc) · 3.09 KB
/
Main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
{-
NOTE On enforcing determinism
The tests below use two mechanisms to enforce deterministic LSP sequences:
1. Progress reporting: waitForProgress(Begin|Done)
2. Diagnostics: expectDiagnostics
Either is fine, but diagnostics are generally more reliable.
Mixing them both in the same test is NOT FINE as it will introduce race
conditions since multiple interleavings are possible. In other words,
the sequence of diagnostics and progress reports is not deterministic.
For example:
< do something >
waitForProgressDone
expectDiagnostics [...]
- When the diagnostics arrive after the progress done message, as they usually do, the test will pass
- When the diagnostics arrive before the progress done msg, when on a slow machine occasionally, the test will timeout
Therefore, avoid mixing both progress reports and diagnostics in the same test
-}
module Main (main) where
import qualified HieDbRetry
import Test.Tasty
import Test.Tasty.Ingredients.Rerun
import AsyncTests
import BootTests
import ClientSettingsTests
import CodeLensTests
import CompletionTests
import CPPTests
import CradleTests
import DependentFileTest
import DiagnosticTests
import ExceptionTests
import FindDefinitionAndHoverTests
import FindImplementationAndHoverTests
import GarbageCollectionTests
import HaddockTests
import HighlightTests
import IfaceTests
import InitializeResponseTests
import LogType ()
import NonLspCommandLine
import OpenCloseTest
import OutlineTests
import PluginSimpleTests
import PositionMappingTests
import PreprocessorTests
import ReferenceTests
import RootUriTests
import SafeTests
import SymlinkTests
import THTests
import UnitTests
import WatchedFileTests
main :: IO ()
main = do
-- We mess with env vars so run single-threaded.
defaultMainWithRerun $ testGroup "ghcide"
[ OpenCloseTest.tests
, InitializeResponseTests.tests
, CompletionTests.tests
, CPPTests.tests
, DiagnosticTests.tests
, CodeLensTests.tests
, OutlineTests.tests
, HighlightTests.tests
, FindDefinitionAndHoverTests.tests
, FindImplementationAndHoverTests.tests
, PluginSimpleTests.tests
, PreprocessorTests.tests
, THTests.tests
, SymlinkTests.tests
, SafeTests.tests
, UnitTests.tests
, HaddockTests.tests
, PositionMappingTests.tests
, WatchedFileTests.tests
, CradleTests.tests
, DependentFileTest.tests
, NonLspCommandLine.tests
, IfaceTests.tests
, BootTests.tests
, RootUriTests.tests
, AsyncTests.tests
, ClientSettingsTests.tests
, ReferenceTests.tests
, GarbageCollectionTests.tests
, HieDbRetry.tests
, ExceptionTests.tests
]