Skip to content

Commit 967a89f

Browse files
author
Vladislav Kalugin
committed
Fix disable stubs
1 parent 6976172 commit 967a89f

File tree

5 files changed

+4
-25
lines changed

5 files changed

+4
-25
lines changed

server/src/Server.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ Status Server::TestsGenServiceImpl::ProcessBaseTestRequest(BaseTestGen &testGen,
209209
Synchronizer synchronizer(&testGen, &stubGen, &sizeContext);
210210
synchronizer.synchronize(typesHandler);
211211

212-
if(testGen.settingsContext.useStubs) {
213-
testsWriter->writeStubs(testGen.synchronizedStubs);
214-
}
215-
216212
std::shared_ptr<LineInfo> lineInfo = nullptr;
217213
auto lineTestGen = dynamic_cast<LineTestGen *>(&testGen);
218214

server/src/Synchronizer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ void Synchronizer::synchronize(const types::TypesHandler &typesHandler) {
114114
return;
115115
}
116116
auto outdatedSourcePaths = getOutdatedSourcePaths();
117-
auto outdatedStubs = getStubSetFromSources(outdatedSourcePaths);
118-
synchronizeStubs(outdatedStubs, typesHandler);
117+
if (testGen->settingsContext.useStubs) {
118+
auto outdatedStubs = getStubSetFromSources(outdatedSourcePaths);
119+
synchronizeStubs(outdatedStubs, typesHandler);
120+
}
119121
synchronizeWrappers(outdatedSourcePaths);
120122
}
121123

server/src/streams/tests/ServerTestsWriter.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,6 @@ void ServerTestsWriter::writeTestsWithProgress(tests::TestsMap &testMap,
2323
writeCompleted(testMap, totalTestsCounter);
2424
}
2525

26-
void ServerTestsWriter::writeStubs(const std::vector<Stubs> &synchronizedStubs) {
27-
testsgen::TestsResponse response;
28-
auto stubsResponse = std::make_unique<testsgen::StubsResponse>();
29-
for (auto const &synchronizedStub : synchronizedStubs) {
30-
auto sData = stubsResponse->add_stubsources();
31-
sData->set_filepath(synchronizedStub.filePath);
32-
if (synchronizeCode) {
33-
sData->set_code(synchronizedStub.code);
34-
}
35-
}
36-
response.set_allocated_stubs(stubsResponse.release());
37-
}
38-
3926
bool ServerTestsWriter::writeFileAndSendResponse(const tests::Tests &tests,
4027
const fs::path &testDirPath,
4128
const std::string &message,

server/src/streams/tests/ServerTestsWriter.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class ServerTestsWriter : public TestsWriter {
1818
const fs::path &testDirPath,
1919
std::function<void(tests::Tests &)> &&functor) override;
2020

21-
void writeStubs(const std::vector<Stubs> &synchronizedStubs) override;
22-
2321
private:
2422
[[nodiscard]] virtual bool writeFileAndSendResponse(const tests::Tests &tests,
2523
const fs::path &testDirPath,

server/src/streams/tests/TestsWriter.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ class TestsWriter : public utbot::ServerWriter<testsgen::TestsResponse> {
2020
const fs::path &testDirPath,
2121
std::function<void(tests::Tests &)> &&functor) = 0;
2222

23-
virtual void writeStubs(const std::vector<Stubs> &synchronizedStubs) {
24-
// Default implementation is empty.
25-
}
26-
2723
protected:
2824
void writeCompleted(tests::TestsMap const &testMap, int totalTestsCounter);
2925

0 commit comments

Comments
 (0)