From 8c7cced302e66354218959358b94d0badb497d8a Mon Sep 17 00:00:00 2001 From: Vladislav Kalugin Date: Fri, 16 Sep 2022 15:17:07 +0300 Subject: [PATCH] Update KLEE, fix small bugs --- server/src/Server.cpp | 2 +- server/src/building/Linker.cpp | 3 ++- server/test/framework/Syntax_Tests.cpp | 8 +------- submodules/klee | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/server/src/Server.cpp b/server/src/Server.cpp index 6d9a50935..1448564bf 100644 --- a/server/src/Server.cpp +++ b/server/src/Server.cpp @@ -423,7 +423,7 @@ Status Server::TestsGenServiceImpl::provideLoggingCallbacks( */ using namespace std::chrono_literals; while (holdLockFlag[callbackName].exchange(true, std::memory_order_acquire)) { - std::this_thread::sleep_for(100ms); + std::this_thread::sleep_for(1ms); } loguru::remove_callback(callbackName.c_str()); if (openFiles) { diff --git a/server/src/building/Linker.cpp b/server/src/building/Linker.cpp index 17032ec51..3496a860d 100644 --- a/server/src/building/Linker.cpp +++ b/server/src/building/Linker.cpp @@ -141,7 +141,8 @@ Result Linker::linkWholeTarget(const fs::path &target) { insideFolder = false; } } - if (!CollectionUtils::contains(testedFiles, objectInfo->getSourcePath()) && insideFolder) { + if ( CollectionUtils::contains(testGen.tests, objectInfo->getSourcePath()) && + !CollectionUtils::contains(testedFiles, objectInfo->getSourcePath()) && insideFolder) { fs::path bitcodeFile = objectInfo->kleeFilesInfo->getKleeBitcodeFile(); filesToLink.emplace(objectFile, bitcodeFile); } else { diff --git a/server/test/framework/Syntax_Tests.cpp b/server/test/framework/Syntax_Tests.cpp index 47ab243b9..1fca3a23e 100644 --- a/server/test/framework/Syntax_Tests.cpp +++ b/server/test/framework/Syntax_Tests.cpp @@ -1464,7 +1464,7 @@ namespace { } TEST_F(Syntax_Test, Correct_CodeText_For_Regression_And_Error) { - auto [testGen, status] = createTestForFunction(linked_list_c, 3); + auto [testGen, status] = createTestForFunction(structs_with_pointers_c, 78); const std::string code = testGen.tests.begin()->second.code; const std::string beginRegressionRegion = "#pragma region " + Tests::DEFAULT_SUITE_NAME + NL; const std::string endRegion = std::string("#pragma endregion") + NL; @@ -1982,9 +1982,6 @@ namespace { { [] (const tests::Tests::MethodTestCase& testCase) { return stoi(testCase.returnValue.view->getEntryValue(nullptr)) == -1; - }, - [] (const tests::Tests::MethodTestCase& testCase) { - return stoi(testCase.returnValue.view->getEntryValue(nullptr)) > -1; } }) ); @@ -2676,9 +2673,6 @@ namespace { testGen.tests.at(linked_list_c).methods.begin().value().testCases, std::vector( { - [] (const tests::Tests::MethodTestCase& testCase) { - return stoi(testCase.returnValue.view->getEntryValue(nullptr)) == 0; - }, [] (const tests::Tests::MethodTestCase& testCase) { return stoi(testCase.returnValue.view->getEntryValue(nullptr)) == 1; }, diff --git a/submodules/klee b/submodules/klee index 5bc031231..9a117e933 160000 --- a/submodules/klee +++ b/submodules/klee @@ -1 +1 @@ -Subproject commit 5bc03123155ed2adee6fa52ebad0c51c1c1e907e +Subproject commit 9a117e93371048b24a9433bebc219b8bd62eb884