File tree Expand file tree Collapse file tree 9 files changed +16
-61
lines changed Expand file tree Collapse file tree 9 files changed +16
-61
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -725,3 +725,11 @@ fs::path BuildDatabase::newDirForFile(const fs::path &file) const {
725
725
this ->projectContext .projectPath );
726
726
return Paths::createNewDirForFile (file, base, this ->serverBuildDir );
727
727
}
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
+ }
Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ class BuildDatabase {
203
203
fs::path buildCommandsJsonPath;
204
204
fs::path linkCommandsJsonPath;
205
205
fs::path compileCommandsJsonPath;
206
+ std::optional<std::string> target;
206
207
CollectionUtils::MapFileTo<std::vector<std::shared_ptr<ObjectFileInfo>>> sourceFileInfos;
207
208
CollectionUtils::MapFileTo<std::shared_ptr<ObjectFileInfo>> objectFileInfos;
208
209
CollectionUtils::MapFileTo<std::shared_ptr<TargetInfo>> targetInfos;
@@ -227,6 +228,7 @@ class BuildDatabase {
227
228
void mergeLibraryOptions (std::vector<std::string> &jsonArguments) const ;
228
229
fs::path newDirForFile (fs::path const & file) const ;
229
230
fs::path createExplicitObjectFileCompilationCommand (const std::shared_ptr<ObjectFileInfo> &objectInfo);
231
+ CollectionUtils::FileSet getSourceFilesForTarget (const std::string &_target);
230
232
231
233
using sharedLibrariesMap = std::unordered_map<std::string, CollectionUtils::MapFileTo<fs::path>>;
232
234
Original file line number Diff line number Diff line change 2
2
#define UNITTESTBOT_BASETESTGEN_H
3
3
4
4
#include " ProjectContext.h"
5
- #include " ProjectTarget.h"
6
5
#include " SettingsContext.h"
7
6
#include " Tests.h"
8
7
#include " building/BuildDatabase.h"
@@ -33,7 +32,6 @@ class BaseTestGen {
33
32
std::vector<Stubs> synchronizedStubs;
34
33
types::TypeMaps types;
35
34
36
- std::optional<fs::path> targetPath;
37
35
CollectionUtils::FileSet targetSources;
38
36
39
37
virtual std::string toString () = 0;
@@ -42,9 +40,9 @@ class BaseTestGen {
42
40
43
41
bool isBatched () const ;
44
42
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);
48
46
49
47
virtual ~BaseTestGen () = default ;
50
48
protected:
@@ -55,7 +53,7 @@ class BaseTestGen {
55
53
56
54
void setInitializedTestsMap ();
57
55
58
- virtual void setTargetForSource (fs::path const & sourcePath) = 0;
56
+ // virtual void setTargetForSource(fs::path const& sourcePath) = 0;
59
57
60
58
void updateTargetSources ();
61
59
};
Original file line number Diff line number Diff line change 2
2
#define UNITTESTBOT_PROJECTTESTGEN_H
3
3
4
4
#include " BaseTestGen.h"
5
- #include " ProjectTarget.h"
6
5
7
6
#include < optional>
8
7
@@ -19,7 +18,7 @@ class ProjectTestGen : public BaseTestGen {
19
18
20
19
const testsgen::ProjectRequest *getRequest () const ;
21
20
22
- void setTargetForSource (fs::path const &sourcePath) override ;
21
+ // void setTargetForSource(fs::path const &sourcePath) override;
23
22
24
23
private:
25
24
testsgen::ProjectRequest const *const request;
Original file line number Diff line number Diff line change 2
2
3
3
namespace GrpcUtils {
4
4
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");
6
6
static inline const std::string UTBOT_AUTO_TARGET_DESCRIPTION = " Finds any target that contains the code under testing" ;
7
7
8
8
std::unique_ptr<testsgen::SnippetRequest>
Original file line number Diff line number Diff line change 2
2
#define UNITTESTBOT_GRPCUTILS_H
3
3
4
4
#include " ProjectContext.h"
5
- #include " ProjectTarget.h"
6
5
#include " utils/path/FileSystemPath.h"
7
6
8
7
#include < protobuf/testgen.grpc.pb.h>
Original file line number Diff line number Diff line change 3
3
4
4
#include " gtest/gtest.h"
5
5
6
- #include " ProjectTarget.h"
7
6
#include " Server.h"
8
7
#include " Tests.h"
9
8
#include " coverage/Coverage.h"
You can’t perform that action at this time.
0 commit comments