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 {
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+ }
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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 ;
5048protected: 
@@ -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};
Original file line number Diff line number Diff line change 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
2423private: 
2524    testsgen::ProjectRequest const  *const  request;
Original file line number Diff line number Diff line change 22
33namespace  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>
Original file line number Diff line number Diff line change 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> 
Original file line number Diff line number Diff line change 33
44#include  " gtest/gtest.h" 
55
6- #include  " ProjectTarget.h" 
76#include  " Server.h" 
87#include  " Tests.h" 
98#include  " coverage/Coverage.h" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments