split command line args for IndexerCommandCustom usages
* this seems to be required when using the new QProcess API. * this also required to remove quotes that were added to path args because otherwise the Python indexer would mistake absolute paths for relative paths.
This commit is contained in:
@@ -56,16 +56,18 @@ std::shared_ptr<TestStorage> parseCode(std::string code)
|
||||
const std::set<FilePathFilter> includeFilters;
|
||||
const FilePath workingDirectory(L".");
|
||||
|
||||
std::wstring args = L"";
|
||||
args += L" --source-file-path=%{SOURCE_FILE_PATH}";
|
||||
args += L" --database-file-path=%{DATABASE_FILE_PATH}";
|
||||
args += L" --shallow";
|
||||
std::vector<std::wstring> args;
|
||||
args.push_back(L"index");
|
||||
args.push_back(L"--source-file-path=%{SOURCE_FILE_PATH}");
|
||||
args.push_back(L"--database-file-path=%{DATABASE_FILE_PATH}");
|
||||
args.push_back(L"--shallow");
|
||||
|
||||
std::shared_ptr<IndexerCommandCustom> indexerCommand = std::make_shared<IndexerCommandCustom>(
|
||||
INDEXER_COMMAND_PYTHON,
|
||||
L"\"" +
|
||||
FilePath("../app").getConcatenated(ResourcePaths::getPythonPath()).makeAbsolute().wstr() +
|
||||
L"SourcetrailPythonIndexer\" index" + args,
|
||||
L"SourcetrailPythonIndexer\"",
|
||||
args,
|
||||
rootPath,
|
||||
tempDbPath,
|
||||
std::to_wstring(SqliteIndexStorage::getStorageVersion()),
|
||||
@@ -74,7 +76,12 @@ std::shared_ptr<TestStorage> parseCode(std::string code)
|
||||
|
||||
std::wstring errorMessage;
|
||||
const int result = utility::executeProcessAndGetExitCode(
|
||||
indexerCommand->getCustomCommand(), {}, rootPath, -1, true, &errorMessage);
|
||||
indexerCommand->getCommand(),
|
||||
indexerCommand->getArguments(),
|
||||
rootPath,
|
||||
-1,
|
||||
true,
|
||||
&errorMessage);
|
||||
|
||||
REQUIRE(result == 0);
|
||||
REQUIRE(errorMessage.empty());
|
||||
|
||||
Reference in New Issue
Block a user