@@ -27,7 +27,7 @@ namespace {
2727
2828 std::pair<FunctionTestGen, Status>
2929 createTestForFunction (const fs::path &pathToFile, int lineNum, bool verbose = true ) {
30- auto lineRequest = createLineRequest (projectName, suitePath, buildDirRelativePath,
30+ auto lineRequest = testUtils:: createLineRequest (projectName, suitePath, buildDirRelativePath,
3131 srcPaths, pathToFile, lineNum, false , verbose, 0 );
3232 auto request = GrpcUtils::createFunctionRequest (std::move (lineRequest));
3333 auto testGen = FunctionTestGen (*request, writer.get (), TESTMODE);
@@ -36,6 +36,18 @@ namespace {
3636 Status status = Server::TestsGenServiceImpl::ProcessBaseTestRequest (testGen, writer.get ());
3737 return { testGen, status };
3838 }
39+
40+ std::pair<FolderTestGen, Status>
41+ createTestForFolder (const fs::path &pathToFolder, bool useStubs = true , bool verbose = true ) {
42+ auto folderRequest = testUtils::createProjectRequest (projectName, suitePath, buildDirRelativePath,
43+ srcPaths, useStubs, verbose, 0 );
44+ auto request = GrpcUtils::createFolderRequest (std::move (folderRequest), pathToFolder);
45+ auto testGen = FolderTestGen (*request, writer.get (), TESTMODE);
46+ testGen.setTargetPath (GrpcUtils::UTBOT_AUTO_TARGET_PATH);
47+
48+ Status status = Server::TestsGenServiceImpl::ProcessBaseTestRequest (testGen, writer.get ());
49+ return {testGen, status};
50+ }
3951 };
4052
4153 // uint_32t parameters/return values and call external printf
@@ -328,4 +340,11 @@ namespace {
328340 } }),
329341 " f4" );
330342 }
343+
344+ TEST_F (Regression_Test, Generate_Folder) {
345+ fs::path folderPath = getTestFilePath (" ISSUE-140" );
346+ auto [testGen, status] = createTestForFolder (folderPath, true , true );
347+ ASSERT_TRUE (status.ok ()) << status.error_message ();
348+ testUtils::checkMinNumberOfTests (testGen.tests , 1 );
349+ }
331350}
0 commit comments