forked from facebookincubator/Glean
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: 1. new test case `cpp-xlang` contains manually annotated C++ and thrift files. Generated test output contains correct thrift xrefs 2. added new test runner which runs two indexers, the one in the test driver + an extra-one supplied as parameter 3. added new routing rules in repomapping, as we need to route cpp and thrift requests to different dbs 4. revert the thrift annotations from `fbcode/glean/lang/codemarkup/tests/clang/glass/namespace1/`, as it's subsumed by `cpp-xlang` For 2, I initially tried to generalize the Driver type so it supports a list of indexers but I couldn't find a satisfying solution, and it would have required a lot of refactoring. Reviewed By: simonmar Differential Revision: D56188923 fbshipit-source-id: d480c5d2f65aa988f19c7b52985607b168e9d332
- Loading branch information
1 parent
f1ecc67
commit a69dada
Showing
95 changed files
with
2,088 additions
and
3,955 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
glean/glass/test/regression/Glean/Glass/Regression/CppXLang.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{- | ||
Copyright (c) Meta Platforms, Inc. and affiliates. | ||
All rights reserved. | ||
This source code is licensed under the BSD-style license found in the | ||
LICENSE file in the root directory of this source tree. | ||
-} | ||
|
||
module Glean.Glass.Regression.CppXLang (main) where | ||
|
||
import qualified Glean.Clang.Test.DerivePass as DerivePass | ||
|
||
import qualified Glean.Regression.Driver.DeriveForCodemarkup as Code | ||
import Glean.Indexer.Fbthrift as Fbthrift (indexer) | ||
import Glean.Glass.Regression.Snapshot (mainGlassSnapshotXLang) | ||
|
||
main :: IO () | ||
main = mainGlassSnapshotXLang | ||
testName | ||
testPath (d, "test-xlang-source") (Fbthrift.indexer, "test-xlang-target") | ||
where | ||
d = DerivePass.driver Code.codemarkupDerivePasses | ||
testName = "glass-regression-cpp-xlang" | ||
testPath = "glean/glass/test/regression/tests/cpp-xlang" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
286 changes: 286 additions & 0 deletions
286
glean/glass/test/regression/tests/cpp-xlang/documentSymbolIndex.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,286 @@ | ||
[ | ||
"@generated", | ||
{ | ||
"digest": { | ||
"hash": "c19eedb242a1867935300bf022d4b8ab3d92ae00", | ||
"size": 420 | ||
}, | ||
"referenced_file_digests": { | ||
"test-xlang": { | ||
"test.cpp": { | ||
"hash": "c19eedb242a1867935300bf022d4b8ab3d92ae00", | ||
"size": 420 | ||
}, | ||
"test.h": { | ||
"hash": "d31759d38b8e2df1b27e81d34d0d077bf3c73c8d", | ||
"size": 324 | ||
} | ||
} | ||
}, | ||
"revision": "testhash", | ||
"size": 7, | ||
"symbols": { | ||
"12": [ | ||
{ | ||
"attributes": { | ||
"symbolDefinitionType": { | ||
"aInteger": 2 | ||
}, | ||
"symbolKind": { | ||
"aInteger": 14 | ||
}, | ||
"symbolLanguage": { | ||
"aInteger": 1 | ||
}, | ||
"symbolName": { | ||
"aString": "thrift1" | ||
}, | ||
"symbolParent": { | ||
"aString": "" | ||
}, | ||
"symbolSignature": { | ||
"aString": "void thrift1()" | ||
} | ||
}, | ||
"range": { | ||
"columnBegin": 6, | ||
"columnEnd": 13, | ||
"lineBegin": 12, | ||
"lineEnd": 12 | ||
}, | ||
"sym": "test-xlang/cpp//thrift1/.f//.decl" | ||
} | ||
], | ||
"15": [ | ||
{ | ||
"attributes": { | ||
"symbolDefinitionType": { | ||
"aInteger": 1 | ||
}, | ||
"symbolKind": { | ||
"aInteger": 14 | ||
}, | ||
"symbolLanguage": { | ||
"aInteger": 1 | ||
}, | ||
"symbolName": { | ||
"aString": "thriftCaller" | ||
}, | ||
"symbolParent": { | ||
"aString": "" | ||
}, | ||
"symbolSignature": { | ||
"aString": "void thriftCaller()" | ||
} | ||
}, | ||
"range": { | ||
"columnBegin": 6, | ||
"columnEnd": 18, | ||
"lineBegin": 15, | ||
"lineEnd": 15 | ||
}, | ||
"sym": "test-xlang/cpp//thriftCaller/.f/" | ||
} | ||
], | ||
"16": [ | ||
{ | ||
"attributes": { | ||
"symbolDefinitionType": { | ||
"aInteger": 2 | ||
}, | ||
"symbolKind": { | ||
"aInteger": 14 | ||
}, | ||
"symbolLanguage": { | ||
"aInteger": 1 | ||
}, | ||
"symbolName": { | ||
"aString": "thrift1" | ||
}, | ||
"symbolParent": { | ||
"aString": "" | ||
}, | ||
"symbolSignature": { | ||
"aString": "void thrift1()" | ||
} | ||
}, | ||
"range": { | ||
"columnBegin": 3, | ||
"columnEnd": 10, | ||
"lineBegin": 16, | ||
"lineEnd": 16 | ||
}, | ||
"sym": "test-xlang/cpp//thrift1/.f//.decl", | ||
"target": { | ||
"filepath": "test.cpp", | ||
"range": { | ||
"columnBegin": 6, | ||
"columnEnd": 13, | ||
"lineBegin": 12, | ||
"lineEnd": 12 | ||
}, | ||
"repository": "test-xlang" | ||
} | ||
}, | ||
{ | ||
"attributes": { | ||
"crossLanguage": { | ||
"aString": "thrift" | ||
}, | ||
"symbolIdl": { | ||
"aString": "thrift" | ||
}, | ||
"symbolLanguage": { | ||
"aInteger": 9 | ||
}, | ||
"symbolName": { | ||
"aString": "thrift1" | ||
}, | ||
"symbolParent": { | ||
"aString": "TestService" | ||
}, | ||
"symbolSignature": { | ||
"aString": "function test::TestService::thrift1" | ||
} | ||
}, | ||
"range": { | ||
"columnBegin": 3, | ||
"columnEnd": 10, | ||
"lineBegin": 16, | ||
"lineEnd": 16 | ||
}, | ||
"sym": "test-xlang/thrift/test.thrift/TestService/thrift1", | ||
"target": { | ||
"filepath": "test.thrift", | ||
"range": { | ||
"columnBegin": 3, | ||
"columnEnd": 5, | ||
"lineBegin": 39, | ||
"lineEnd": 41 | ||
}, | ||
"repository": "test-xlang" | ||
} | ||
} | ||
], | ||
"17": [ | ||
{ | ||
"attributes": { | ||
"symbolDefinitionType": { | ||
"aInteger": 2 | ||
}, | ||
"symbolKind": { | ||
"aInteger": 14 | ||
}, | ||
"symbolLanguage": { | ||
"aInteger": 1 | ||
}, | ||
"symbolName": { | ||
"aString": "thrift2" | ||
}, | ||
"symbolParent": { | ||
"aString": "" | ||
}, | ||
"symbolSignature": { | ||
"aString": "void thrift2()" | ||
} | ||
}, | ||
"range": { | ||
"columnBegin": 3, | ||
"columnEnd": 10, | ||
"lineBegin": 17, | ||
"lineEnd": 17 | ||
}, | ||
"sym": "test-xlang/cpp//thrift2/.f//.decl", | ||
"target": { | ||
"filepath": "test.h", | ||
"range": { | ||
"columnBegin": 6, | ||
"columnEnd": 13, | ||
"lineBegin": 11, | ||
"lineEnd": 11 | ||
}, | ||
"repository": "test-xlang" | ||
} | ||
}, | ||
{ | ||
"attributes": { | ||
"crossLanguage": { | ||
"aString": "thrift" | ||
}, | ||
"symbolIdl": { | ||
"aString": "thrift" | ||
}, | ||
"symbolLanguage": { | ||
"aInteger": 9 | ||
}, | ||
"symbolName": { | ||
"aString": "thrift2" | ||
}, | ||
"symbolParent": { | ||
"aString": "TestService" | ||
}, | ||
"symbolSignature": { | ||
"aString": "function test::TestService::thrift2" | ||
} | ||
}, | ||
"range": { | ||
"columnBegin": 3, | ||
"columnEnd": 10, | ||
"lineBegin": 17, | ||
"lineEnd": 17 | ||
}, | ||
"sym": "test-xlang/thrift/test.thrift/TestService/thrift2", | ||
"target": { | ||
"filepath": "test.thrift", | ||
"range": { | ||
"columnBegin": 3, | ||
"columnEnd": 5, | ||
"lineBegin": 43, | ||
"lineEnd": 45 | ||
}, | ||
"repository": "test-xlang" | ||
} | ||
} | ||
], | ||
"9": [ | ||
{ | ||
"attributes": { | ||
"symbolDefinitionType": { | ||
"aInteger": 1 | ||
}, | ||
"symbolKind": { | ||
"aInteger": 4 | ||
}, | ||
"symbolLanguage": { | ||
"aInteger": 8 | ||
}, | ||
"symbolName": { | ||
"aString": "test.h" | ||
}, | ||
"symbolParent": { | ||
"aString": "" | ||
} | ||
}, | ||
"range": { | ||
"columnBegin": 1, | ||
"columnEnd": 18, | ||
"lineBegin": 9, | ||
"lineEnd": 9 | ||
}, | ||
"sym": "test-xlang/pp/test.h", | ||
"target": { | ||
"filepath": "test.h", | ||
"range": { | ||
"columnBegin": 1, | ||
"columnEnd": 1, | ||
"lineBegin": 1, | ||
"lineEnd": 1 | ||
}, | ||
"repository": "test-xlang" | ||
} | ||
} | ||
] | ||
}, | ||
"truncated": false | ||
} | ||
] |
2 changes: 2 additions & 0 deletions
2
glean/glass/test/regression/tests/cpp-xlang/documentSymbolIndex.query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
action: documentSymbolIndex | ||
args: {"include_refs":true,"filepath":"test.cpp","repository":"test-xlang"} |
Oops, something went wrong.