Skip to content

fix: Get rid of the testcases spamming mode #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2024
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
1 change: 0 additions & 1 deletion include/klee/Core/TerminationTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ enum Reason {
CovCheck,
NoMoreStates,
ReachedTarget,
UnreachedTarget,
ErrorOnWhichShouldExit,
Interrupt,
MaxDepth,
Expand Down
13 changes: 1 addition & 12 deletions lib/Core/Executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,6 @@ cl::opt<HaltExecution::Reason> DumpStatesOnHalt(
cl::values(
clEnumValN(HaltExecution::Reason::NotHalt, "none",
"Do not dump test cases for all active states on exit."),
clEnumValN(HaltExecution::Reason::UnreachedTarget, "unreached",
"Dump test cases for all active states on exit if error not "
"reached."),
clEnumValN(HaltExecution::Reason::Unspecified, "all",
"Dump test cases for all active states on exit (default)")),
cl::cat(TestGenCat));
Expand Down Expand Up @@ -4451,19 +4448,11 @@ void Executor::decreaseConfidenceFromStoppedStates(

void Executor::doDumpStates() {
auto &states = objectManager->getStates();
if (DumpStatesOnHalt == HaltExecution::Reason::NotHalt ||
(DumpStatesOnHalt == HaltExecution::Reason::UnreachedTarget &&
haltExecution == HaltExecution::Reason::ReachedTarget) ||
states.empty()) {
if (DumpStatesOnHalt == HaltExecution::Reason::NotHalt || states.empty()) {
interpreterHandler->incPathsExplored(states.size());
return;
}

if (FunctionCallReproduce != "" &&
haltExecution != HaltExecution::Reason::ReachedTarget) {
haltExecution = HaltExecution::UnreachedTarget;
}

klee_message("halting execution, dumping remaining states");
for (const auto &state : objectManager->getStates()) {
terminateStateEarly(*state, "Execution halting.",
Expand Down
2 changes: 1 addition & 1 deletion scripts/kleef
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def klee_options(
"--function-call-reproduce=reach_error",
# "--max-cycles=0",
# "--tc-type=bug",
"--dump-states-on-halt=unreached", # Explicitly do not dump states
"--dump-states-on-halt=none", # Explicitly do not dump states
"--exit-on-error-type=Assert", # Only generate test cases of type assert
# "--dump-test-case-type=Assert", # Only dump test cases of type assert
"--search=dfs",
Expand Down
5 changes: 1 addition & 4 deletions tools/klee/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,7 @@ void KleeHandler::processTestCase(const ExecutionState &state,
unsigned id = ++m_numTotalTests;
if (!WriteNone &&
(FunctionCallReproduce == "" || strcmp(suffix, "assert.err") == 0 ||
strcmp(suffix, "reachable.err") == 0 ||
(DumpStatesOnHalt == HaltExecution::Reason::UnreachedTarget &&
m_interpreter->getHaltExecution() ==
HaltExecution::Reason::UnreachedTarget))) {
strcmp(suffix, "reachable.err") == 0)) {
KTest ktest;
ktest.numArgs = m_argc;
ktest.args = m_argv;
Expand Down
Loading