package Sequenic.T2ext.CoverageEngine; import Examples.*; import Sequenic.T2ext.Analyzer.*; import Sequenic.T2ext.Instrumenter.*; import Sequenic.T2ext.util.util; import java.util.*; public class Engine_10Test0 { public void test0() { String path = util.getClassLocation(ClassWithInterMethodInteraction.class) ; // Ok, use T2 to generate traces first: String trfile = path + "ClassWithInterMethodInteraction.tr" ; //System.out.println(">>> " + path) ; //System.out.println(">>> " + trfile) ; Sequenic.T2.Main.Junit("Examples.ClassWithInterMethodInteraction" + " --nmax=800 --lenexec=8 --savegoodtr=100" + " --savefile=" + trfile); // Check the coverage of the traces from T2: T2TraceFileCoverageAnalyzer analz = new T2TraceFileCoverageAnalyzer( trfile, path + "ClassWithInterMethodInteraction.cfgs"); analz.debug = true ; System.out.println("\n===== The coverage of the by-T2-generated traces:\n") ; T2TraceFileCoverageResult res = analz.calculateCoverage(); // Now use Engine_10 to try to cover for each uncovered path: analz.debug = false ; List> entries = new LinkedList>(res.totCoverage.entrySet()); for (Map.Entry entry : entries) { CFG CFG = entry.getKey() ; CoverageResult CR = entry.getValue(); for (LinkedList ppath : CFG.getTargetPaths()) { if (!CR.directlyCoveredPaths.contains(ppath)) { Engine_10 eng10 = new Engine_10(res,analz,ppath) ; eng10.debug = true ; eng10.generateTraces() ; System.out.println("\n===== The coverage of the newly-generated traces:\n") ; eng10.testGeneratedTraces() ; } } } } static public void main(String[] args){ Engine_10Test0 T = new Engine_10Test0() ; T.test0() ; } }