Skip to content

Commit

Permalink
self review pt. 1
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiIurko committed Apr 8, 2024
1 parent 9cd6a2d commit 0dced80
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@ class ExecutionSuccessFinalInfo<T>(
override val instance: T?,
override val args: List<T>,
val retValue: T?
) : ExecutionFinalInfo<T>() {

override fun equals(other: Any?): Boolean {
if (other !is ExecutionSuccessFinalInfo<*>) return false
return instance == other.instance && args == other.args && retValue == other.retValue
}

override fun hashCode(): Int = (instance?.hashCode() ?: 0) * 239 + args.hashCode() * 101 + (retValue?.hashCode() ?: 0)

}
) : ExecutionFinalInfo<T>()

class ExecutionExceptionFinalInfo<T>(
override val instance: T?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ class SymbolicTraceBuilder(
}

override fun track(value: String, concreteValue: Any?) {
// clear cache - some earlier versions of values may be loaded
(converter as? Object2DescriptorConverter)?.objectToDescriptor = IdentityHashMap<Any, Descriptor>()
val kfgValue = parseValue(value)
val termValue = mkValue(kfgValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ class InstructionConcolicChecker(
val timeLimit = kexConfig.getIntValue("concolic", "timeLimit", 100)
val searchStrategy = kexConfig.getStringValue("concolic", "searchStrategy", "bfs")

log.debug("Running on: ${targets.joinToString("\n", prefix = "\n")}")
log.debug("Time budget: $timeLimit")

val actualNumberOfExecutors = maxOf(1, minOf(executors, targets.size))
val coroutineContext = newFixedThreadPoolContextWithMDC(actualNumberOfExecutors, "concolic-dispatcher")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,6 @@ open class CoverageReporter(

val jcClass = classLoader.loadClass("org.junit.runner.JUnitCore")
val jc = jcClass.newInstance()
// TODO: addListener via reflection
// if (kexConfig.getBooleanValue("testGen", "logJUnit", false)) {
// jcClass.getMethod("addListener", classLoader.loadClass("org.junit.runner.notification.RunListener"))
// .invoke(jc, classLoader.loadClass("org.vorpal.research.kex."))
//
// jc.addListener(TestLogger())
// }


val computerClass = classLoader.loadClass("org.junit.runner.Computer")
val returnValue = jcClass.getMethod("run", computerClass, Class::class.java.asArray())
Expand All @@ -273,14 +265,11 @@ open class CoverageReporter(
(returnValue as? Result)?.failures?.forEach {
log.debug(it.trace)
}
// jc.run(Computer(), testClass)


val executionData = ExecutionDataStore()
data.collect(executionData, SessionInfoStore(), false)
datum[testPath] = executionData.deepCopy()
data.reset()

}

context.runtime.shutdown()
Expand Down

0 comments on commit 0dced80

Please sign in to comment.