use of abs.frontend.ast.DeltaAccess in project abstools by abstools.
the class ABSUnitTestCaseTranslator method generateABSUnitTests.
/**
* Generates an ABS module {@link ModuleDecl} that defines the
* given test suite.
*
* @param suite
* @param validate
* @return
*/
@SuppressWarnings("rawtypes")
public ModuleDecl generateABSUnitTests(ApetTestSuite suite, boolean validate) {
console("Add basic imports...");
for (String key : suite.keySet()) {
console("Generating test suite for " + key + "...");
generateABSUnitTest(suite.get(key), key);
}
Set<DeltaDecl> deltaDecls = new HashSet<DeltaDecl>();
for (DeltaWrapper w : deltas) {
DeltaDecl delta = w.getDelta();
deltaDecls.add(delta);
abs.frontend.ast.List<DeltaAccess> access = delta.getDeltaAccesss();
if (access.hasChildren()) {
String use = access.getChild(0).getModuleName();
importModules.add(use);
}
}
addImports(module);
buildProductLine(module);
console("Pretty printing ABSUnit tests...");
List<ASTNode<ASTNode>> nodes = new ArrayList<ASTNode<ASTNode>>();
nodes.add(module);
nodes.addAll(deltaDecls);
nodes.add(productline);
nodes.add(product);
printToFile(nodes, outputFile);
if (validate) {
console("Validating ABSUnit tests...");
validateOutput();
}
console("ABSUnit tests generation successful");
return module;
}
Aggregations