Python: add regression tests and organise tests

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-06-22 16:36:19 +02:00
parent aa04a2a476
commit e8289d6fa1
28 changed files with 206 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import experimental.dataflow.DataFlow
/**
* A configuration to find all "maximal" flows.
* To be used on small programs.
*/
class MaximalFlowsConfig extends DataFlow::Configuration {
MaximalFlowsConfig() { this = "AllFlowsConfig" }
override predicate isSource(DataFlow::Node node) {
node instanceof DataFlow::ParameterNode
or
node = DataFlow::TEssaNode(_) and
not exists(DataFlow::Node pred |
pred = DataFlow::TEssaNode(_) and
DataFlow::localFlowStep(pred, node)
)
}
override predicate isSink(DataFlow::Node node) {
node instanceof DataFlow::ReturnNode
or
node = DataFlow::TEssaNode(_) and
not exists(node.asEssaNode().getASourceUse())
}
}