@@ -2033,8 +2033,8 @@ cradleTests = testGroup "cradle"
2034loadCradleOnlyonce :: TestTree
2034loadCradleOnlyonce :: TestTree
2035loadCradleOnlyonce = testGroup "load cradle only once"
2035loadCradleOnlyonce = testGroup "load cradle only once"
2036− [ testSessionTF "implicit" implicit
2036+ [ testSession' "implicit" implicit
2037− , testSessionTF "direct" direct
2037+ , testSession' "direct" direct
2040 direct dir = do
2040 direct dir = do
@@ -2143,10 +2143,7 @@ testSession :: String -> Session () -> TestTree
2143testSession name = testCase name . run
2143testSession name = testCase name . run
2145testSession' :: String -> (FilePath -> Session ()) -> TestTree
2145testSession' :: String -> (FilePath -> Session ()) -> TestTree
2146−testSession' name = testCase name . run' NoTestFlag
2146+testSession' name = testCase name . run'
2148−testSessionTF :: String -> (FilePath -> Session ()) -> TestTree
2149−testSessionTF name = testCase name . run' WithTestFlag
2151testSessionWait :: String -> Session () -> TestTree
2148testSessionWait :: String -> Session () -> TestTree
2152testSessionWait name = testSession name .
2149testSessionWait name = testSession name .
@@ -2177,16 +2174,13 @@ mkRange :: Int -> Int -> Int -> Int -> Range
2177mkRange a b c d = Range (Position a b) (Position c d)
2174mkRange a b c d = Range (Position a b) (Position c d)
2179run :: Session a -> IO a
2176run :: Session a -> IO a
2180−run s = withTempDir $ \dir -> runInDir NoTestFlag dir s
2177+run s = withTempDir $ \dir -> runInDir dir s
2182−run' :: WithTestFlag -> (FilePath -> Session a) -> IO a
2183−run' tf s = withTempDir $ \dir -> runInDir tf dir (s dir)
2185−-- Do we run the LSP executable with --test or not
2179+run' :: (FilePath -> Session a) -> IO a
2186−data WithTestFlag = WithTestFlag | NoTestFlag deriving (Show, Eq)
2180+run' s = withTempDir $ \dir -> runInDir dir (s dir)
2188−runInDir :: WithTestFlag -> FilePath -> Session a -> IO a
2182+runInDir :: FilePath -> Session a -> IO a
2189−runInDir withTestFlag dir s = do
2183+runInDir dir s = do
2190 ghcideExe <- locateGhcideExecutable
2184 ghcideExe <- locateGhcideExecutable
2192 -- Temporarily hack around https://github.com/mpickering/hie-bios/pull/56
2186 -- Temporarily hack around https://github.com/mpickering/hie-bios/pull/56
@@ -2199,8 +2193,7 @@ runInDir withTestFlag dir s = do
2199 createDirectoryIfMissing True $ dir </> takeDirectory f
2193 createDirectoryIfMissing True $ dir </> takeDirectory f
2200 copyFile ("test/data" </> f) (dir </> f)
2194 copyFile ("test/data" </> f) (dir </> f)
2202− let cmd = unwords ([ghcideExe, "--lsp", "--cwd", dir]
2196+ let cmd = unwords [ghcideExe, "--lsp", "--test", "--cwd", dir]
2203− ++ [ "--test" | WithTestFlag == withTestFlag ])
2204 -- HIE calls getXgdDirectory which assumes that HOME is set.
2197 -- HIE calls getXgdDirectory which assumes that HOME is set.
2205 -- Only sets HOME if it wasn't already set.
2198 -- Only sets HOME if it wasn't already set.
2206 setEnv "HOME" "/homeless-shelter" False
2199 setEnv "HOME" "/homeless-shelter" False