Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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