Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ object UtSettings : AbstractSettings(
*/
val copyVisualizationPathToClipboard get() = useDebugVisualization

/**
* Set the value to true to show library classes' graphs in visualization.
*
* False by default.
*/
val showLibraryClassesInVisualization by getBooleanProperty(false)

/**
* Method is paused after this timeout to give an opportunity other methods
* to work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.utbot.engine.isReturn
import org.utbot.engine.selectors.PathSelector
import org.utbot.engine.stmts
import org.utbot.framework.UtSettings.copyVisualizationPathToClipboard
import org.utbot.framework.UtSettings.showLibraryClassesInVisualization
import soot.jimple.Stmt
import soot.toolkits.graph.ExceptionalUnitGraph
import java.awt.Toolkit
Expand Down Expand Up @@ -103,7 +104,11 @@ class GraphViz(
graph.allEdges.forEach { edge ->
val (edgeSrc, edgeDst, _) = edge

if (stmtToSubgraph[edgeSrc] !in libraryGraphs && stmtToSubgraph[edgeDst] !in libraryGraphs) {
val srcInLibraryMethod = stmtToSubgraph[edgeSrc] in libraryGraphs
val dstInLibraryMethod = stmtToSubgraph[edgeDst] in libraryGraphs
val edgeIsRelatedToLibraryMethod = srcInLibraryMethod || dstInLibraryMethod

if (!edgeIsRelatedToLibraryMethod || showLibraryClassesInVisualization) {
dotGlobalGraph.addDotEdge(edge)
}
}
Expand Down Expand Up @@ -143,8 +148,10 @@ class GraphViz(
}

// Filter library methods
uncompletedStack.removeIf { it.name in libraryGraphs }
fullStack.removeIf { it.name in libraryGraphs }
if (!showLibraryClassesInVisualization) {
uncompletedStack.removeIf { it.name in libraryGraphs }
fullStack.removeIf { it.name in libraryGraphs }
}

// Update nodes and edges properties
dotGlobalGraph.updateProperties(executionState)
Expand Down