@@ -249,10 +249,10 @@ cl::opt<bool> CoverOnTheFly(
249249 " (default=false, i.e. one per (error,instruction) pair)" ),
250250 cl::cat(TestGenCat));
251251
252- cl::opt<unsigned > DelayCoverOnTheFly (
253- " delay-cover-on-the-fly" , cl::init(10000 ),
254- cl::desc(" Start on the fly tests generation after this many instructions "
255- " (default=10000 )" ),
252+ cl::opt<std::string > DelayCoverOnTheFly (
253+ " delay-cover-on-the-fly" , cl::init(" 0s " ),
254+ cl::desc(" Start on the fly tests generation after the specified duration. "
255+ " Set to 0s to disable (default=0s )" ),
256256 cl::cat(TestGenCat));
257257
258258cl::opt<unsigned > UninitMemoryTestMultiplier (
@@ -487,15 +487,23 @@ Executor::Executor(LLVMContext &ctx, const InterpreterOptions &opts,
487487 targetedExecutionManager(
488488 new TargetedExecutionManager(*codeGraphInfo, *targetManager)),
489489 replayKTest(0 ), replayPath(0 ), usingSeeds(0 ), atMemoryLimit(false ),
490- inhibitForking(false ), haltExecution(HaltExecution::NotHalt),
491- ivcEnabled(false ), debugLogBuffer(debugBufferString) {
490+ inhibitForking(false ), coverOnTheFly(false ),
491+ haltExecution(HaltExecution::NotHalt), ivcEnabled(false ),
492+ debugLogBuffer(debugBufferString) {
492493 const time::Span maxTime{MaxTime};
493494 if (maxTime)
494495 timers.add (std::make_unique<Timer>(maxTime, [&] {
495496 klee_message (" HaltTimer invoked" );
496497 setHaltExecution (HaltExecution::MaxTime);
497498 }));
498499
500+ if (CoverOnTheFly && guidanceKind != GuidanceKind::ErrorGuidance) {
501+ const time::Span delayTime{DelayCoverOnTheFly};
502+ if (delayTime)
503+ timers.add (
504+ std::make_unique<Timer>(delayTime, [&] { coverOnTheFly = true ; }));
505+ }
506+
499507 coreSolverTimeout = time::Span{MaxCoreSolverTime};
500508 if (coreSolverTimeout)
501509 UseForkedCoreSolver = true ;
@@ -4381,8 +4389,8 @@ static std::string terminationTypeFileExtension(StateTerminationType type) {
43814389
43824390void Executor::executeStep (ExecutionState &state) {
43834391 KFunction *initKF = state.initPC ->parent ->parent ;
4384- if (CoverOnTheFly && guidanceKind != GuidanceKind::ErrorGuidance &&
4385- stats::instructions > DelayCoverOnTheFly && shouldWriteTest (state)) {
4392+
4393+ if (coverOnTheFly && shouldWriteTest (state)) {
43864394 state.clearCoveredNew ();
43874395 interpreterHandler->processTestCase (
43884396 state, nullptr ,
0 commit comments