1
1
mirror of https://github.com/github/semantic.git synced 2024-12-03 13:56:04 +03:00

Last shims.

This commit is contained in:
Patrick Thomson 2020-07-01 15:16:57 -04:00
parent 0e0b897b2e
commit af7b4b578a
8 changed files with 32 additions and 14 deletions

View File

@ -48,6 +48,8 @@ common haskell
-Wno-star-is-type
if (impl(ghc >= 8.8))
ghc-options: -Wno-missing-deriving-strategies
cpp-options:
-DBAZEL_BUILD=0
library
import: haskell

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications, ImplicitParams #-}
{-# LANGUAGE CPP, DisambiguateRecordFields, OverloadedStrings, TypeApplications, ImplicitParams #-}
module Main (main) where
@ -8,16 +8,18 @@ import AST.TestHelpers
import AST.Unmarshal
import qualified System.Path as Path
import Test.Tasty
import qualified Bazel.Runfiles as Runfiles
import qualified System.Path.Fixture as Fixture
main :: IO ()
main = do
rf <- Runfiles.create
-- dirs <- Path.absDir <$> Go.getTestCorpusDir
#if BAZEL_BUILD
rf <- Fixture.create
let ?project = Path.relDir "external/tree-sitter-go"
?runfiles = rf
let dirs = Fixture.absRelDir "corpus"
#else
dirs <- Path.absRel <$> Go.getTestCorpusDir
#endif
readCorpusFiles' dirs
>>= traverse (testCorpus parse)

View File

@ -48,6 +48,8 @@ common haskell
-Wno-star-is-type
if (impl(ghc >= 8.8))
ghc-options: -Wno-missing-deriving-strategies
cpp-options:
-DBAZEL_BUILD=0
library
import: haskell

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
@ -9,7 +10,6 @@ where
import AST.TestHelpers
import AST.Unmarshal
import qualified Bazel.Runfiles as Runfiles
import qualified Language.Java.AST as Java
import qualified System.Path as Path
import qualified System.Path.Fixture as Fixture
@ -18,11 +18,15 @@ import TreeSitter.Java
main :: IO ()
main = do
rf <- Runfiles.create
-- dirs <- Path.absDir <$> Java.getTestCorpusDir
#if BAZEL_BUILD
rf <- Fixture.create
--
let ?project = Path.relDir "external/tree-sitter-java"
?runfiles = rf
let dirs = Fixture.absRelDir "corpus"
#else
dirs <- Path.absRel <$> Java.getTestCorpusDir
#endif
readCorpusFiles' dirs
>>= traverse (testCorpus parse)
>>= defaultMain . tests

View File

@ -48,6 +48,8 @@ common haskell
-Wno-star-is-type
if (impl(ghc >= 8.8))
ghc-options: -Wno-missing-deriving-strategies
cpp-options:
-DBAZEL_BUILD=0
library
import: haskell

View File

@ -8,16 +8,18 @@ import AST.Unmarshal
import qualified Language.TSX.AST as Tsx
import qualified System.Path as Path
import Test.Tasty
import qualified Bazel.Runfiles as Runfiles
import qualified System.Path.Fixture as Fixture
main :: IO ()
main = do
rf <- Runfiles.create
-- dirs <- Path.absDir <$> Typescript.getTestCorpusDir
#if BAZEL_BUILD
rf <- Fixture.create
let ?project = Path.relDir "external/semantic-typescript"
?runfiles = rf
let dirs = Fixture.absRelDir "tsx/corpus"
#else
dirs <- Path.absRel <$> Typescript.getTestCorpusDir
#endif
readCorpusFiles' dirs
>>= traverse (testCorpus parse)

View File

@ -48,6 +48,8 @@ common haskell
-Wno-star-is-type
if (impl(ghc >= 8.8))
ghc-options: -Wno-missing-deriving-strategies
cpp-options:
-DBAZEL_BUILD=0
library
import: haskell

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DisambiguateRecordFields, OverloadedStrings, TypeApplications, ImplicitParams #-}
{-# LANGUAGE CPP, DisambiguateRecordFields, OverloadedStrings, TypeApplications, ImplicitParams #-}
module Main (main) where
import TreeSitter.TypeScript
@ -7,16 +7,18 @@ import AST.Unmarshal
import qualified Language.TypeScript.AST as Ts
import qualified System.Path as Path
import Test.Tasty
import qualified Bazel.Runfiles as Runfiles
import qualified System.Path.Fixture as Fixture
main :: IO ()
main = do
rf <- Runfiles.create
-- dirs <- Path.absDir <$> Typescript.getTestCorpusDir
#if BAZEL_BUILD
rf <- Fixture.create
let ?project = Path.relDir "external/tree-sitter-typescript"
?runfiles = rf
let dirs = Fixture.absRelDir "typescript/corpus"
#else
dirs <- Path.absRel <$> Ts.getTestCorpusDir
#endif
readCorpusFiles' dirs
>>= traverse (testCorpus parse)