src/jvm/main/org/jetbrains/kotlinx/lincheck/strategy/managed/modelchecking/ModelCheckingStrategyConfiguration.kt [40:123]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - class ModelCheckingOptions : ManagedOptions() { override fun createTestConfigurations(testClass: Class<*>): ModelCheckingCTestConfiguration { return ModelCheckingCTestConfiguration( testClass = testClass, iterations = iterations, threads = threads, actorsPerThread = actorsPerThread, actorsBefore = actorsBefore, actorsAfter = actorsAfter, generatorClass = executionGenerator, verifierClass = verifier, checkObstructionFreedom = checkObstructionFreedom, hangingDetectionThreshold = hangingDetectionThreshold, invocationsPerIteration = invocationsPerIteration, guarantees = guarantees, minimizeFailedScenario = minimizeFailedScenario, sequentialSpecification = chooseSequentialSpecification(sequentialSpecification, testClass), timeoutMs = timeoutMs, customScenarios = customScenarios, stdLibAnalysisEnabled = stdLibAnalysisEnabled, ) } } /** * Configuration for the model checking strategy. */ class ModelCheckingCTestConfiguration( testClass: Class<*>, iterations: Int, threads: Int, actorsPerThread: Int, actorsBefore: Int, actorsAfter: Int, generatorClass: Class, verifierClass: Class, checkObstructionFreedom: Boolean, hangingDetectionThreshold: Int, invocationsPerIteration: Int, guarantees: List, minimizeFailedScenario: Boolean, sequentialSpecification: Class<*>, timeoutMs: Long, customScenarios: List, stdLibAnalysisEnabled: Boolean, ) : ManagedCTestConfiguration( testClass = testClass, iterations = iterations, threads = threads, actorsPerThread = actorsPerThread, actorsBefore = actorsBefore, actorsAfter = actorsAfter, generatorClass = generatorClass, verifierClass = verifierClass, checkObstructionFreedom = checkObstructionFreedom, hangingDetectionThreshold = hangingDetectionThreshold, invocationsPerIteration = invocationsPerIteration, guarantees = guarantees, minimizeFailedScenario = minimizeFailedScenario, sequentialSpecification = sequentialSpecification, timeoutMs = timeoutMs, customScenarios = customScenarios, stdLibAnalysisEnabled = stdLibAnalysisEnabled, ) { override val instrumentationMode: InstrumentationMode get() = if (isInTraceDebuggerMode) TRACE_DEBUGGING else MODEL_CHECKING override fun createStrategy( testClass: Class<*>, scenario: ExecutionScenario, validationFunction: Actor?, stateRepresentationMethod: Method?, ): Strategy { val runner = ExecutionScenarioRunner( scenario = scenario, testClass = testClass, validationFunction = validationFunction, stateRepresentationFunction = stateRepresentationMethod, timeoutMs = getTimeOutMs(inIdeaPluginReplayMode, timeoutMs), useClocks = UseClocks.ALWAYS ) return ModelCheckingStrategy(runner, createSettings(), inIdeaPluginReplayMode, LincheckJavaAgent.context).also { runner.initializeStrategy(it) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - src/jvm/main/org/jetbrains/lincheck/datastructures/ModelCheckingOptions.kt [32:115]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - class ModelCheckingOptions : ManagedOptions() { override fun createTestConfigurations(testClass: Class<*>): ModelCheckingCTestConfiguration { return ModelCheckingCTestConfiguration( testClass = testClass, iterations = iterations, threads = threads, actorsPerThread = actorsPerThread, actorsBefore = actorsBefore, actorsAfter = actorsAfter, generatorClass = executionGenerator, verifierClass = verifier, checkObstructionFreedom = checkObstructionFreedom, hangingDetectionThreshold = hangingDetectionThreshold, invocationsPerIteration = invocationsPerIteration, guarantees = guarantees, minimizeFailedScenario = minimizeFailedScenario, sequentialSpecification = chooseSequentialSpecification(sequentialSpecification, testClass), timeoutMs = timeoutMs, customScenarios = customScenarios, stdLibAnalysisEnabled = stdLibAnalysisEnabled, ) } } /** * Configuration for the model checking strategy. */ class ModelCheckingCTestConfiguration( testClass: Class<*>, iterations: Int, threads: Int, actorsPerThread: Int, actorsBefore: Int, actorsAfter: Int, generatorClass: Class, verifierClass: Class, checkObstructionFreedom: Boolean, hangingDetectionThreshold: Int, invocationsPerIteration: Int, guarantees: List, minimizeFailedScenario: Boolean, sequentialSpecification: Class<*>, timeoutMs: Long, customScenarios: List, stdLibAnalysisEnabled: Boolean, ) : ManagedCTestConfiguration( testClass = testClass, iterations = iterations, threads = threads, actorsPerThread = actorsPerThread, actorsBefore = actorsBefore, actorsAfter = actorsAfter, generatorClass = generatorClass, verifierClass = verifierClass, checkObstructionFreedom = checkObstructionFreedom, hangingDetectionThreshold = hangingDetectionThreshold, invocationsPerIteration = invocationsPerIteration, guarantees = guarantees, minimizeFailedScenario = minimizeFailedScenario, sequentialSpecification = sequentialSpecification, timeoutMs = timeoutMs, customScenarios = customScenarios, stdLibAnalysisEnabled = stdLibAnalysisEnabled, ) { override val instrumentationMode: InstrumentationMode get() = if (isInTraceDebuggerMode) TRACE_DEBUGGING else MODEL_CHECKING override fun createStrategy( testClass: Class<*>, scenario: ExecutionScenario, validationFunction: Actor?, stateRepresentationMethod: Method?, ): Strategy { val runner = ExecutionScenarioRunner( scenario = scenario, testClass = testClass, validationFunction = validationFunction, stateRepresentationFunction = stateRepresentationMethod, timeoutMs = getTimeOutMs(inIdeaPluginReplayMode, timeoutMs), useClocks = UseClocks.ALWAYS ) return ModelCheckingStrategy(runner, createSettings(), inIdeaPluginReplayMode, LincheckJavaAgent.context).also { runner.initializeStrategy(it) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -