Skip to content

Commit ff1aa07

Browse files
committed
Added math header for lazy instntiated objects if required. Increased bcov timelimit.
1 parent 931c948 commit ff1aa07

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

server/src/KleeRunner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,13 @@ KleeRunner::createKleeParams(const tests::TestMethod &testMethod,
222222
"--libc=klee",
223223
"--utbot",
224224
"--posix-runtime",
225+
"--type-system=CXX",
225226
"--fp-runtime",
226227
"--only-output-states-covering-new",
227228
"--allocate-determ",
228229
"--external-calls=all",
229230
"--timer-interval=1000ms",
230-
"--bcov-check-interval=6s",
231+
"--bcov-check-interval=8s",
231232
"-istats-write-interval=5s",
232233
"--disable-verify",
233234
"--check-div-zero=false",

server/src/printers/TestsPrinter.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,34 @@ using printer::TestsPrinter;
1818
TestsPrinter::TestsPrinter(const types::TypesHandler *typesHandler, utbot::Language srcLanguage) : Printer(srcLanguage) , typesHandler(typesHandler) {
1919
}
2020

21+
bool TestsPrinter::paramNeedsMathHeader(const Tests::TestCaseParamValue &paramValue) {
22+
if (paramValue.view->containsFPSpecialValue()) {
23+
return true;
24+
}
25+
for (const auto &lazyParamValue : paramValue.lazyValues) {
26+
if (paramNeedsMathHeader(lazyParamValue)) {
27+
return true;
28+
}
29+
}
30+
return false;
31+
}
32+
2133
//we need this header for tests with generated NAN and INFINITY parameters to be compilable
2234
bool TestsPrinter::needsMathHeader(const Tests &tests) {
2335
for (const auto &[methodName, methodDescription] : tests.methods) {
2436
for (const auto &methodTestCase : methodDescription.testCases) {
2537
for (const auto &paramValue : methodTestCase.paramValues) {
26-
if (paramValue.view->containsFPSpecialValue()) {
38+
if (paramNeedsMathHeader(paramValue)) {
2739
return true;
2840
}
2941
}
3042
for (const auto &paramValue : methodTestCase.globalPreValues) {
31-
if (paramValue.view->containsFPSpecialValue()) {
43+
if (paramNeedsMathHeader(paramValue)) {
3244
return true;
3345
}
3446
}
3547
for (const auto &paramValue : methodTestCase.globalPostValues) {
36-
if (paramValue.view->containsFPSpecialValue()) {
48+
if (paramNeedsMathHeader(paramValue)) {
3749
return true;
3850
}
3951
}

server/src/printers/TestsPrinter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ namespace printer {
115115
private:
116116
types::TypesHandler const *typesHandler;
117117

118+
static bool paramNeedsMathHeader(const Tests::TestCaseParamValue &paramValue);
119+
118120
void
119121
parametrizedInitializeGlobalVariables(const Tests::MethodDescription &methodDescription,
120122
const Tests::MethodTestCase &testCase);

0 commit comments

Comments
 (0)