Skip to content

Commit

Permalink
no instrumentation mode added
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniilStepanov committed Oct 9, 2023
1 parent 5f70d96 commit 555da94
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class InstrumentationProcessRunner(

suspend fun executeUTestAsync(uTest: UTest): UTestExecutionResult = rdProcessRunner.callUTestAsync(uTest)

suspend fun destroy() = rdProcessRunner.destroy()
fun destroy() = rdProcessRunner.destroy()


}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class UTestConcreteExecutor(
return try {
instrumentationProcessRunner.executeUTestSync(uTest, timeout)
} catch (e: TimeoutException) {
instrumentationProcessRunner.destroy()
val descriptor = UTestExceptionDescriptor(
type = jcClasspath.findClass<Exception>().toType(),
message = e.message ?: "timeout",
Expand All @@ -69,6 +70,7 @@ class UTestConcreteExecutor(
)
UTestExecutionTimedOutResult(descriptor)
} catch (e: RdFault) {
instrumentationProcessRunner.destroy()
val descriptor = UTestExceptionDescriptor(
type = jcClasspath.findClass<Exception>().toType(),
message = e.reasonAsText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ interface JcInstrumenterFactory<T: JcInstrumenter> {

class JcRuntimeTraceInstrumenterFactory : JcInstrumenterFactory<JcRuntimeTraceInstrumenter> {
override fun create(jcClasspath: JcClasspath): JcRuntimeTraceInstrumenter = JcRuntimeTraceInstrumenter(jcClasspath)
}
class NoInstrumentationFactory : JcInstrumenterFactory<NoInstrumentation> {
override fun create(jcClasspath: JcClasspath): NoInstrumentation = NoInstrumentation(jcClasspath)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.usvm.instrumentation.instrumentation

import org.jacodb.api.JcClasspath
import org.objectweb.asm.tree.ClassNode

class NoInstrumentation(
override val jcClasspath: JcClasspath
) : JcInstrumenter {
override fun instrumentClass(classNode: ClassNode): ClassNode {
return classNode
}
}

0 comments on commit 555da94

Please sign in to comment.