Skip to content

Commit 465c934

Browse files
author
Vladislav Kalugin
committed
not end
1 parent 2881544 commit 465c934

File tree

9 files changed

+16
-61
lines changed

9 files changed

+16
-61
lines changed

server/src/ProjectTarget.cpp

Lines changed: 0 additions & 21 deletions
This file was deleted.

server/src/ProjectTarget.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

server/src/building/BuildDatabase.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,3 +725,11 @@ fs::path BuildDatabase::newDirForFile(const fs::path &file) const {
725725
this->projectContext.projectPath);
726726
return Paths::createNewDirForFile(file, base, this->serverBuildDir);
727727
}
728+
729+
CollectionUtils::FileSet BuildDatabase::getSourceFilesForTarget(const std::string &_target) {
730+
return CollectionUtils::transformTo<CollectionUtils::FileSet>(
731+
getArchiveObjectFiles(_target),
732+
[this](fs::path const &objectPath) {
733+
return getClientCompilationUnitInfo(objectPath)->getSourcePath();
734+
});
735+
}

server/src/building/BuildDatabase.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ class BuildDatabase {
203203
fs::path buildCommandsJsonPath;
204204
fs::path linkCommandsJsonPath;
205205
fs::path compileCommandsJsonPath;
206+
std::optional<std::string> target;
206207
CollectionUtils::MapFileTo<std::vector<std::shared_ptr<ObjectFileInfo>>> sourceFileInfos;
207208
CollectionUtils::MapFileTo<std::shared_ptr<ObjectFileInfo>> objectFileInfos;
208209
CollectionUtils::MapFileTo<std::shared_ptr<TargetInfo>> targetInfos;
@@ -227,6 +228,7 @@ class BuildDatabase {
227228
void mergeLibraryOptions(std::vector<std::string> &jsonArguments) const;
228229
fs::path newDirForFile(fs::path const& file) const;
229230
fs::path createExplicitObjectFileCompilationCommand(const std::shared_ptr<ObjectFileInfo> &objectInfo);
231+
CollectionUtils::FileSet getSourceFilesForTarget(const std::string &_target);
230232

231233
using sharedLibrariesMap = std::unordered_map<std::string, CollectionUtils::MapFileTo<fs::path>>;
232234

server/src/testgens/BaseTestGen.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define UNITTESTBOT_BASETESTGEN_H
33

44
#include "ProjectContext.h"
5-
#include "ProjectTarget.h"
65
#include "SettingsContext.h"
76
#include "Tests.h"
87
#include "building/BuildDatabase.h"
@@ -33,7 +32,6 @@ class BaseTestGen {
3332
std::vector<Stubs> synchronizedStubs;
3433
types::TypeMaps types;
3534

36-
std::optional<fs::path> targetPath;
3735
CollectionUtils::FileSet targetSources;
3836

3937
virtual std::string toString() = 0;
@@ -42,9 +40,9 @@ class BaseTestGen {
4240

4341
bool isBatched() const;
4442

45-
bool hasAutoTarget() const;
46-
fs::path const &getTargetPath() const;
47-
void setTargetPath(fs::path _targetPath);
43+
// bool hasAutoTarget() const;
44+
// fs::path const &getTargetPath() const;
45+
// void setTargetPath(fs::path _targetPath);
4846

4947
virtual ~BaseTestGen() = default;
5048
protected:
@@ -55,7 +53,7 @@ class BaseTestGen {
5553

5654
void setInitializedTestsMap();
5755

58-
virtual void setTargetForSource(fs::path const& sourcePath) = 0;
56+
// virtual void setTargetForSource(fs::path const& sourcePath) = 0;
5957

6058
void updateTargetSources();
6159
};

server/src/testgens/ProjectTestGen.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define UNITTESTBOT_PROJECTTESTGEN_H
33

44
#include "BaseTestGen.h"
5-
#include "ProjectTarget.h"
65

76
#include <optional>
87

@@ -19,7 +18,7 @@ class ProjectTestGen : public BaseTestGen {
1918

2019
const testsgen::ProjectRequest *getRequest() const;
2120

22-
void setTargetForSource(fs::path const &sourcePath) override;
21+
// void setTargetForSource(fs::path const &sourcePath) override;
2322

2423
private:
2524
testsgen::ProjectRequest const *const request;

server/src/utils/GrpcUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace GrpcUtils {
44
static const std::string UTBOT_AUTO_TARGET = "UTBot: auto";
5-
const std::string UTBOT_AUTO_TARGET_PATH = fs::path("/utbot/auto/target/path");
5+
// const std::string UTBOT_AUTO_TARGET_PATH = fs::path("/utbot/auto/target/path");
66
static inline const std::string UTBOT_AUTO_TARGET_DESCRIPTION = "Finds any target that contains the code under testing";
77

88
std::unique_ptr<testsgen::SnippetRequest>

server/src/utils/GrpcUtils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define UNITTESTBOT_GRPCUTILS_H
33

44
#include "ProjectContext.h"
5-
#include "ProjectTarget.h"
65
#include "utils/path/FileSystemPath.h"
76

87
#include <protobuf/testgen.grpc.pb.h>

server/test/framework/TestUtils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include "gtest/gtest.h"
55

6-
#include "ProjectTarget.h"
76
#include "Server.h"
87
#include "Tests.h"
98
#include "coverage/Coverage.h"

0 commit comments

Comments
 (0)