Skip to content
Snippets Groups Projects
Commit c8d00725 authored by marvin's avatar marvin
Browse files

Compiler launch fixed (see Main.jak)

parent 5a527ad4
No related merge requests found
......@@ -13,6 +13,9 @@
<feature automatic="unselected" name="Pi_Camera"/>
<feature automatic="unselected" name="imu"/>
<feature automatic="unselected" name="lds_lfcd_sensor"/>
<feature automatic="unselected" name="lds_lfcd_sensor_BAD_RANGE"/>
<feature automatic="unselected" name="lds_lfcd_sensor_GOOD_RANGE"/>
<feature automatic="unselected" name="lds_lfcd_sensor_HIGH_NOISE"/>
<feature automatic="unselected" name="realsense_R200"/>
<feature automatic="unselected" name="Pi_Camera___turtlebot3_burger_for_autorace"/>
<feature automatic="unselected" name="Pi_Camera___turtlebot3_waffle_pi"/>
......
......@@ -2,6 +2,9 @@
import java.util.List;
import java.util.ArrayList;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.File;
import org.jdom2.Document;
import org.jdom2.Element;
......@@ -29,11 +32,12 @@ public class Configurator {
private List m_aModuleList;
//output path
private String m_sOutputPath = "resources/output/featuremodel.xml";
//TODO: set this
//path for test case selector, which has to be launched from this application
private String m_sTestCaseSelectorPath;
//path to the feature model xml
private String m_sFeatureModelPath = "model.xml";
//path to the directory of test manager
private String m_sTestManagerPath = "../../../build/sim/";
//path to the directory of testcase compliler
private String m_sTestCaseCompilerPath = "../../../build/test/compiler/";
//document representation of the feature model
private Document m_oFeatureModelDoc;
......@@ -117,6 +121,34 @@ public class Configurator {
System.out.println(oEx);
return;
}
Runtime oRuntime = Runtime.getRuntime();
//TODO launch compiler
try {
File oWorkingDir = new File(m_sTestCaseCompilerPath);
Process oTestCaseCompiler = oRuntime.exec("./compile", null, oWorkingDir);
BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestCaseCompiler.getInputStream()));
String sOutput = null;
while ((sOutput = oOutput.readLine()) != null) {
System.out.println(sOutput);
}
} catch (IOException oEx) {
System.out.println("ERROR: launching Testcase Compiler failed: " + oEx.toString());
}
//TODO launch test manager
try {
File oWorkingDir = new File(m_sTestManagerPath);
Process oTestManager = oRuntime.exec("./testmanager.sh", null, oWorkingDir);
BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestManager.getInputStream()));
String sOutput = null;
while ((sOutput = oOutput.readLine()) != null) {
System.out.println(sOutput);
}
} catch (IOException oEx) {
System.out.println("ERROR: launching TestManager failed: " + oEx.toString());
}
}
//get all parents of a given module from the Feature Model file
......
/**
* TODO description
*/
public refines class Configurator {
public void save() {
Super().addToModuleList("lds_lfcd_sensor_BAD_RANGE");
Super().save();
}
}
\ No newline at end of file
/**
* TODO description
*/
public refines class Configurator {
public void save() {
Super().addToModuleList("lds_lfcd_sensor_GOOD_RANGE");
Super().save();
}
}
\ No newline at end of file
/**
* TODO description
*/
public refines class Configurator {
public void save() {
Super().addToModuleList("lds_lfcd_sensor_HIGH_NOISE");
Super().save();
}
}
\ No newline at end of file
......@@ -26,6 +26,9 @@
<feature name="Pi_Camera" />
<feature name="imu" />
<feature name="lds_lfcd_sensor" />
<feature name="lds_lfcd_sensor_BAD_RANGE" />
<feature name="lds_lfcd_sensor_GOOD_RANGE" />
<feature name="lds_lfcd_sensor_HIGH_NOISE" />
<feature name="realsense_R200" />
<feature name="Pi_Camera___turtlebot3_burger_for_autorace" />
<feature name="Pi_Camera___turtlebot3_waffle_pi" />
......
......@@ -2,6 +2,9 @@
import java.util.List;
import java.util.ArrayList;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.File;
import org.jdom2.Document;
import org.jdom2.Element;
......@@ -31,11 +34,12 @@ abstract class Configurator$$ConfiguratorMain {
private List m_aModuleList;
//output path
private String m_sOutputPath = "resources/output/featuremodel.xml";
//TODO: set this
//path for test case selector, which has to be launched from this application
private String m_sTestCaseSelectorPath;
//path to the feature model xml
private String m_sFeatureModelPath = "model.xml";
//path to the directory of test manager
private String m_sTestManagerPath = "../../../build/sim/";
//path to the directory of testcase compliler
private String m_sTestCaseCompilerPath = "../../../build/test/compiler/";
//document representation of the feature model
private Document m_oFeatureModelDoc;
......@@ -119,6 +123,34 @@ abstract class Configurator$$ConfiguratorMain {
System.out.println(oEx);
return;
}
Runtime oRuntime = Runtime.getRuntime();
//TODO launch compiler
try {
File oWorkingDir = new File(m_sTestCaseCompilerPath);
Process oTestCaseCompiler = oRuntime.exec("./compile", null, oWorkingDir);
BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestCaseCompiler.getInputStream()));
String sOutput = null;
while ((sOutput = oOutput.readLine()) != null) {
System.out.println(sOutput);
}
} catch (IOException oEx) {
System.out.println("ERROR: launching Testcase Compiler failed: " + oEx.toString());
}
//TODO launch test manager
try {
File oWorkingDir = new File(m_sTestManagerPath);
Process oTestManager = oRuntime.exec("./testmanager.sh", null, oWorkingDir);
BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestManager.getInputStream()));
String sOutput = null;
while ((sOutput = oOutput.readLine()) != null) {
System.out.println(sOutput);
}
} catch (IOException oEx) {
System.out.println("ERROR: launching TestManager failed: " + oEx.toString());
}
}
//get all parents of a given module from the Feature Model file
......
......@@ -2,6 +2,9 @@
import java.util.List;
import java.util.ArrayList;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.File;
import org.jdom2.Document;
import org.jdom2.Element;
......@@ -31,11 +34,12 @@ abstract class Configurator$$ConfiguratorMain {
private List m_aModuleList;
//output path
private String m_sOutputPath = "resources/output/featuremodel.xml";
//TODO: set this
//path for test case selector, which has to be launched from this application
private String m_sTestCaseSelectorPath;
//path to the feature model xml
private String m_sFeatureModelPath = "model.xml";
//path to the directory of test manager
private String m_sTestManagerPath = "../../../build/sim/";
//path to the directory of testcase compliler
private String m_sTestCaseCompilerPath = "../../../build/test/compiler/";
//document representation of the feature model
private Document m_oFeatureModelDoc;
......@@ -119,6 +123,34 @@ abstract class Configurator$$ConfiguratorMain {
System.out.println(oEx);
return;
}
Runtime oRuntime = Runtime.getRuntime();
//TODO launch compiler
try {
File oWorkingDir = new File(m_sTestCaseCompilerPath);
Process oTestCaseCompiler = oRuntime.exec("./compile", null, oWorkingDir);
BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestCaseCompiler.getInputStream()));
String sOutput = null;
while ((sOutput = oOutput.readLine()) != null) {
System.out.println(sOutput);
}
} catch (IOException oEx) {
System.out.println("ERROR: launching Testcase Compiler failed: " + oEx.toString());
}
//TODO launch test manager
try {
File oWorkingDir = new File(m_sTestManagerPath);
Process oTestManager = oRuntime.exec("./testmanager.sh", null, oWorkingDir);
BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestManager.getInputStream()));
String sOutput = null;
while ((sOutput = oOutput.readLine()) != null) {
System.out.println(sOutput);
}
} catch (IOException oEx) {
System.out.println("ERROR: launching TestManager failed: " + oEx.toString());
}
}
//get all parents of a given module from the Feature Model file
......
......@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.File;
import org.jdom2.Document;
import org.jdom2.Element;
......@@ -33,10 +34,10 @@ public class Configurator {
private String m_sOutputPath = "resources/output/featuremodel.xml";
//path to the feature model xml
private String m_sFeatureModelPath = "model.xml";
//path to the test manager
private String m_sTestManagerPath = "../../../build/sim/testmanager.sh";
//path to the testcase compliler
private String m_sTestCaseCompilerPath = "../../../build/test/compiler/compile";
//path to the directory of test manager
private String m_sTestManagerPath = "../../../build/sim/";
//path to the directory of testcase compliler
private String m_sTestCaseCompilerPath = "../../../build/test/compiler/";
//document representation of the feature model
private Document m_oFeatureModelDoc;
......@@ -125,7 +126,8 @@ public class Configurator {
//TODO launch compiler
try {
Process oTestCaseCompiler = oRuntime.exec(m_sTestCaseCompilerPath);
File oWorkingDir = new File(m_sTestCaseCompilerPath);
Process oTestCaseCompiler = oRuntime.exec("./compile", null, oWorkingDir);
BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestCaseCompiler.getInputStream()));
String sOutput = null;
while ((sOutput = oOutput.readLine()) != null) {
......@@ -137,7 +139,8 @@ public class Configurator {
//TODO launch test manager
try {
Process oTestManager = oRuntime.exec(m_sTestManagerPath);
File oWorkingDir = new File(m_sTestManagerPath);
Process oTestManager = oRuntime.exec("./testmanager.sh", null, oWorkingDir);
BufferedReader oOutput = new BufferedReader(new InputStreamReader(oTestManager.getInputStream()));
String sOutput = null;
while ((sOutput = oOutput.readLine()) != null) {
......
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