Commit 2e308e36 authored by Johannes Eder's avatar Johannes Eder
Browse files

fixed test set up

parent b2037a88
......@@ -42,7 +42,6 @@ import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.utils.ProjectUtils;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskArchitecture;
import org.fortiss.af3.task.model.allocation.ComponentToTaskAllocationEntry;
import org.fortiss.af3.task.util.ComponentToTaskArchitectureTransformation;
......@@ -93,9 +92,6 @@ public class RoutingTest {
List<SMTConstraint> constraints = new ArrayList<>();
// DeploymentRun2 run2 = new DeploymentRun2();
SMTConstraint createBasicDeploymentConstraint =
BasicDeploymentConstraint.createBasicDeploymentConstraint(tasksArch.getTasks(),
Task.class, ecus, ExecutionUnit.class);
// System.out.println(createBasicDeploymentConstraint + "\n");
// constraints.add(createBasicDeploymentConstraint);
......@@ -103,12 +99,17 @@ public class RoutingTest {
conn.addAll(tasksArch.getSignals());
final DSEPlatformArtifact createDsePlatformArtifact =
DSEProjectModelElementFactory.createDsePlatformArtifact(pa);
List<SMTConstraint> createBasicSignalConstraint =
BasicDeploymentConstraint.createBasicSignalConstraint(conn,
createDsePlatformArtifact, null);
createBasicSignalConstraint.stream().forEach(s -> System.out.println(s + "\n"));
System.out.println("--");
constraints.addAll(createBasicSignalConstraint);
List<SMTConstraint> createBasicSignalConstraint;
try {
createBasicSignalConstraint =
BasicDeploymentConstraint.createBasicSignalConstraint(conn,
createDsePlatformArtifact, null);
createBasicSignalConstraint.stream().forEach(s -> System.out.println(s + "\n"));
System.out.println("--");
constraints.addAll(createBasicSignalConstraint);
} catch(Exception e) {
e.printStackTrace();
}
// custom alloc constraint
// List<Component> collect =
......
......@@ -58,7 +58,6 @@ public class CreateJUnitTestFile {
"import java.util.Collection;\n" +
"import java.util.Optional;\n" +
"\n" +
"import org.eclipse.emf.common.util.URI;\n" +
"import org.fortiss.af3.exploration.model.ExplorationSpecification;\n" +
"import org.fortiss.af3.exploration.model.ExplorationTarget;\n" +
"import org.fortiss.af3.exploration.model.SuperSetMap;\n" +
......
......@@ -91,12 +91,28 @@ public class CreateTestFiles {
@Test
public void createTests() {
File root = new File(path);
if(!root.exists()) {
root.mkdir();
}
File dir = new File(path + projectFolder);
String[] list2 = dir.list();
for(String name : list2) {
new File(path + projectFolder + name).delete();
File dir2 = new File(path + testFolder);
if(dir2.exists()) {
String[] list2 = dir.list();
for(String name : list2) {
new File(path + testFolder + name).delete();
}
} else {
dir2.mkdir();
}
if(dir.exists()) {
String[] list2 = dir.list();
for(String name : list2) {
new File(path + projectFolder + name).delete();
}
} else {
dir.mkdir();
}
List<TestBundle> createBundles = createBundles();
List<List<TestBundle>> bb = divideBundles(createBundles, 4);
NewProjectTestUtils.createNewGeneralProject();
......
......@@ -182,18 +182,23 @@ public class GenerateTestBundles {
EList<Signal> signals = bundle.ta.getSignals();
List<IConnection> connections = new ArrayList<>();
connections.addAll(signals);
List<SMTConstraint> basicConstraints =
BasicDeploymentConstraint.createBasicSignalConstraint(connections, bundle.pa,
ExplorationUtils.convertToMap(bundle.dseSuperSets));
for(SMTConstraint c : basicConstraints) {
incrementIDcounter1000andFixIDs(bundle, c);
List<SMTConstraint> basicConstraints;
try {
basicConstraints =
BasicDeploymentConstraint.createBasicSignalConstraint(connections, bundle.pa,
ExplorationUtils.convertToMap(bundle.dseSuperSets));
for(SMTConstraint c : basicConstraints) {
incrementIDcounter1000andFixIDs(bundle, c);
}
RuleSet basicRuleSet = DSEProjectModelElementFactory.createRuleSet();
basicRuleSet.setImplicit(true);
basicRuleSet.setName("Basic Constraints");
incrementIDcounter1000andFixIDs(bundle, basicRuleSet);
basicRuleSet.getExplorationTargets().addAll(basicConstraints);
bundle.ruleSets.add(basicRuleSet);
} catch(Exception e) {
e.printStackTrace();
}
RuleSet basicRuleSet = DSEProjectModelElementFactory.createRuleSet();
basicRuleSet.setImplicit(true);
basicRuleSet.setName("Basic Constraints");
incrementIDcounter1000andFixIDs(bundle, basicRuleSet);
basicRuleSet.getExplorationTargets().addAll(basicConstraints);
bundle.ruleSets.add(basicRuleSet);
bundle = generateFlashConstraints(bundle);
// TODO: check if flash values of components/tasks are really used
List<TestBundle> generateConstraints = generateAllocConstraints(bundle);
......
......@@ -20,7 +20,6 @@ package org.fortiss.af3.exploration.ui.featuretest;
import static org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.ALLOC_CONSTRAINT_DISTRIBUTION.FIFTY;
import static org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.ALLOC_CONSTRAINT_DISTRIBUTION.TWENTYFIVE;
import static org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.ALLOC_CONSTRAINT_DISTRIBUTION.ZERO;
import static org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.ASIL_DISTRIBUTION_SW_HW.ASIL_A_ONLY;
import static org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.ASIL_DISTRIBUTION_SW_HW.ASIL_D_ONLY;
import static org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.ASIL_DISTRIBUTION_SW_HW.ASIL_MIX_AD;
import static org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.CHANNEL_DIRECTIONS_SW.BI_DIR;
......@@ -94,7 +93,7 @@ public class GenerationProperties {
// @CodeFormatterOff
public static final TOPOLOGY[] topologies = {/*SINGLETON,*/ PAIRS, STAR, LINE, COMPLETE};
public static final CHANNEL_DIRECTIONS_SW[] channelDirections = {UNI_DIR, BI_DIR};
public static final ASIL_DISTRIBUTION_SW_HW[] asilDistributions = {ASIL_A_ONLY, ASIL_D_ONLY, ASIL_MIX_AD};
public static final ASIL_DISTRIBUTION_SW_HW[] asilDistributions = {/*ASIL_A_ONLY,*/ ASIL_D_ONLY, ASIL_MIX_AD};
public static final RAM_DISTRIBUTION_SW[] ramDistributions_SW = {/*ONE_R,*/ TEN_R, HUNDRED_R};
public static final RAM_DISTRIBUTION_HW[] ramDistributions_HW = {/*ONE_R_HW,*/ HUNDRED_R_HW, /*THOUSAND_R_HW*/};
public static final FLASH_DISTRIBUTION_SW[] flashDistributions_SW = {/*ONE_F,*/ TEN_F, HUNDRED_F};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment