From df4818f8e7b0b3219972bbc584275cf9d17072f5 Mon Sep 17 00:00:00 2001 From: Vladislav Kalugin Date: Fri, 14 Jun 2024 16:25:24 +0300 Subject: [PATCH] Add logs to lcov (#685) * Add logs --- server/src/KleeRunner.cpp | 2 ++ server/src/coverage/LlvmCoverageTool.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/server/src/KleeRunner.cpp b/server/src/KleeRunner.cpp index 87d8897f..ad82bc84 100644 --- a/server/src/KleeRunner.cpp +++ b/server/src/KleeRunner.cpp @@ -125,6 +125,8 @@ void KleeRunner::runKlee(const std::vector &testMethods, projectContext.getTestDirAbsPath(), std::move(prepareTests), std::move(prepareTotal)); + + fs::remove_all(kleeOutDir); } static void processMethod(MethodKtests &ktestChunk, diff --git a/server/src/coverage/LlvmCoverageTool.cpp b/server/src/coverage/LlvmCoverageTool.cpp index ac0571ed..b018dd28 100644 --- a/server/src/coverage/LlvmCoverageTool.cpp +++ b/server/src/coverage/LlvmCoverageTool.cpp @@ -102,6 +102,9 @@ LlvmCoverageTool::getCoverageCommands(const std::vector &testsToLaunch mergeArguments.emplace_back("-o"); mergeArguments.emplace_back(mainProfdataPath); auto mergeTask = ShellExecTask::getShellCommandTask(Paths::getLLVMprofdata(), mergeArguments); + + LOG_S(MAX) << "Merge coverage info command: " << mergeTask.toString(); + fs::path coverageJsonPath = Paths::getCoverageJsonPath(projectContext); fs::create_directories(coverageJsonPath.parent_path()); std::vector exportArguments = { "export" }; @@ -147,6 +150,9 @@ LlvmCoverageTool::getCoverageCommands(const std::vector &testsToLaunch auto exportTask = ShellExecTask::getShellCommandTask(Paths::getLLVMcov(), exportArguments); exportTask.setLogFilePath(coverageJsonPath); exportTask.setRetainOutputFile(true); + + LOG_S(MAX) << "Export coverage command: " << exportTask.toString(); + return { mergeTask, exportTask }; }