Skip to content

Commit

Permalink
Added math header for lazy instntiated objects if required. Increased…
Browse files Browse the repository at this point in the history
… bcov timelimit.
  • Loading branch information
S1eGa committed Sep 6, 2022
1 parent 931c948 commit ff1aa07
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
3 changes: 2 additions & 1 deletion server/src/KleeRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,13 @@ KleeRunner::createKleeParams(const tests::TestMethod &testMethod,
"--libc=klee",
"--utbot",
"--posix-runtime",
"--type-system=CXX",
"--fp-runtime",
"--only-output-states-covering-new",
"--allocate-determ",
"--external-calls=all",
"--timer-interval=1000ms",
"--bcov-check-interval=6s",
"--bcov-check-interval=8s",
"-istats-write-interval=5s",
"--disable-verify",
"--check-div-zero=false",
Expand Down
18 changes: 15 additions & 3 deletions server/src/printers/TestsPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,34 @@ using printer::TestsPrinter;
TestsPrinter::TestsPrinter(const types::TypesHandler *typesHandler, utbot::Language srcLanguage) : Printer(srcLanguage) , typesHandler(typesHandler) {
}

bool TestsPrinter::paramNeedsMathHeader(const Tests::TestCaseParamValue &paramValue) {
if (paramValue.view->containsFPSpecialValue()) {
return true;
}
for (const auto &lazyParamValue : paramValue.lazyValues) {
if (paramNeedsMathHeader(lazyParamValue)) {
return true;
}
}
return false;
}

//we need this header for tests with generated NAN and INFINITY parameters to be compilable
bool TestsPrinter::needsMathHeader(const Tests &tests) {
for (const auto &[methodName, methodDescription] : tests.methods) {
for (const auto &methodTestCase : methodDescription.testCases) {
for (const auto &paramValue : methodTestCase.paramValues) {
if (paramValue.view->containsFPSpecialValue()) {
if (paramNeedsMathHeader(paramValue)) {
return true;
}
}
for (const auto &paramValue : methodTestCase.globalPreValues) {
if (paramValue.view->containsFPSpecialValue()) {
if (paramNeedsMathHeader(paramValue)) {
return true;
}
}
for (const auto &paramValue : methodTestCase.globalPostValues) {
if (paramValue.view->containsFPSpecialValue()) {
if (paramNeedsMathHeader(paramValue)) {
return true;
}
}
Expand Down
2 changes: 2 additions & 0 deletions server/src/printers/TestsPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ namespace printer {
private:
types::TypesHandler const *typesHandler;

static bool paramNeedsMathHeader(const Tests::TestCaseParamValue &paramValue);

void
parametrizedInitializeGlobalVariables(const Tests::MethodDescription &methodDescription,
const Tests::MethodTestCase &testCase);
Expand Down

0 comments on commit ff1aa07

Please sign in to comment.