Skip to content

Commit ff766fc

Browse files
add ASTContext symbol-graph arg in unit tests
1 parent 85fabb2 commit ff766fc

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

unittests/AST/TestContext.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ static Decl *createOptionalType(ASTContext &ctx, SourceFile *fileForLookups,
3636

3737
TestContext::TestContext(ShouldDeclareOptionalTypes optionals)
3838
: Ctx(*ASTContext::get(LangOpts, TypeCheckerOpts, SearchPathOpts,
39-
ClangImporterOpts, SourceMgr, Diags)) {
39+
ClangImporterOpts, SymbolGraphOpts,
40+
SourceMgr, Diags)) {
4041
registerParseRequestFunctions(Ctx.evaluator);
4142
registerTypeCheckerRequestFunctions(Ctx.evaluator);
4243
auto stdlibID = Ctx.getIdentifier(STDLIB_NAME);

unittests/AST/TestContext.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "swift/AST/SourceFile.h"
1717
#include "swift/Basic/LangOptions.h"
1818
#include "swift/Basic/SourceManager.h"
19+
#include "swift/SymbolGraphGen/SymbolGraphOptions.h"
1920

2021
#include "llvm/Support/Host.h"
2122

@@ -32,6 +33,7 @@ class TestContextBase {
3233
TypeCheckerOptions TypeCheckerOpts;
3334
SearchPathOptions SearchPathOpts;
3435
ClangImporterOptions ClangImporterOpts;
36+
symbolgraphgen::SymbolGraphOptions SymbolGraphOpts;
3537
SourceManager SourceMgr;
3638
DiagnosticEngine Diags;
3739

unittests/ClangImporter/ClangImporterTests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "swift/Basic/LangOptions.h"
77
#include "swift/Basic/SourceManager.h"
88
#include "swift/ClangImporter/ClangImporter.h"
9+
#include "swift/SymbolGraphGen/SymbolGraphOptions.h"
910
#include "llvm/Support/FileSystem.h"
1011
#include "llvm/Support/Path.h"
1112
#include "llvm/Support/raw_ostream.h"
@@ -72,11 +73,12 @@ TEST(ClangImporterTest, emitPCHInMemory) {
7273
swift::TypeCheckerOptions typeckOpts;
7374
INITIALIZE_LLVM();
7475
swift::SearchPathOptions searchPathOpts;
76+
swift::symbolgraphgen::SymbolGraphOptions symbolGraphOpts;
7577
swift::SourceManager sourceMgr;
7678
swift::DiagnosticEngine diags(sourceMgr);
7779
std::unique_ptr<ASTContext> context(
7880
ASTContext::get(langOpts, typeckOpts, searchPathOpts, options,
79-
sourceMgr, diags));
81+
symbolGraphOpts, sourceMgr, diags));
8082
auto importer = ClangImporter::create(*context);
8183

8284
std::string PCH = createFilename(cache, "bridging.h.pch");

unittests/FrontendTool/ModuleLoadingTests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "swift/Frontend/ModuleInterfaceLoader.h"
1818
#include "swift/Frontend/PrintingDiagnosticConsumer.h"
1919
#include "swift/Serialization/Validation.h"
20+
#include "swift/SymbolGraphGen/SymbolGraphOptions.h"
2021
#include "llvm/ADT/SmallString.h"
2122
#include "llvm/Support/VirtualFileSystem.h"
2223

@@ -100,10 +101,11 @@ class ModuleInterfaceLoaderTest : public testing::Test {
100101
langOpts.Target = llvm::Triple(llvm::sys::getDefaultTargetTriple());
101102
SearchPathOptions searchPathOpts;
102103
ClangImporterOptions clangImpOpts;
104+
symbolgraphgen::SymbolGraphOptions symbolGraphOpts;
103105
SILOptions silOpts;
104106
auto ctx =
105107
ASTContext::get(langOpts, typeckOpts, searchPathOpts, clangImpOpts,
106-
sourceMgr, diags);
108+
symbolGraphOpts, sourceMgr, diags);
107109

108110
ctx->addModuleInterfaceChecker(
109111
std::make_unique<ModuleInterfaceCheckerImpl>(*ctx, cacheDir,

unittests/Sema/SemaFixture.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ using namespace swift::constraints::inference;
3030

3131
SemaTest::SemaTest()
3232
: Context(*ASTContext::get(LangOpts, TypeCheckerOpts, SearchPathOpts,
33-
ClangImporterOpts, SourceMgr, Diags)) {
33+
ClangImporterOpts, SymbolGraphOpts,
34+
SourceMgr, Diags)) {
3435
INITIALIZE_LLVM();
3536

3637
registerParseRequestFunctions(Context.evaluator);

unittests/Sema/SemaFixture.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "swift/Basic/Platform.h"
2121
#include "swift/Basic/SourceManager.h"
2222
#include "swift/Sema/ConstraintSystem.h"
23+
#include "swift/SymbolGraphGen/SymbolGraphOptions.h"
2324
#include "llvm/ADT/SmallString.h"
2425
#include "llvm/ADT/StringRef.h"
2526
#include "llvm/Support/Host.h"
@@ -39,6 +40,7 @@ class SemaTestBase : public ::testing::Test {
3940
TypeCheckerOptions TypeCheckerOpts;
4041
SearchPathOptions SearchPathOpts;
4142
ClangImporterOptions ClangImporterOpts;
43+
symbolgraphgen::SymbolGraphOptions SymbolGraphOpts;
4244
SourceManager SourceMgr;
4345
DiagnosticEngine Diags;
4446

0 commit comments

Comments
 (0)