automatically cleaning temporary files for every non-gui test: takes longer but allows for test-specific compiler flags
This commit is contained in:
parent
e91cc0f1ef
commit
7b763f0e75
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: MspMoteType.java,v 1.22 2009/02/17 11:47:12 fros4943 Exp $
|
* $Id: MspMoteType.java,v 1.23 2009/03/03 13:52:35 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.mspmote;
|
package se.sics.cooja.mspmote;
|
||||||
|
@ -231,8 +231,13 @@ public abstract class MspMoteType implements MoteType {
|
||||||
} else {
|
} else {
|
||||||
MessageList compilationOutput = new MessageList();
|
MessageList compilationOutput = new MessageList();
|
||||||
try {
|
try {
|
||||||
compiler.compileFirmware(getSourceFile(), null, null, compilationOutput,
|
|
||||||
true);
|
/* Automatically clean if not visualized */
|
||||||
|
if (!GUI.isVisualized()) {
|
||||||
|
compiler.cleanTempFiles(compilationOutput, getSourceFile().getParentFile(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
compiler.compileFirmware(getSourceFile(), null, null, compilationOutput, true);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
MoteTypeCreationException newException = new MoteTypeCreationException(
|
MoteTypeCreationException newException = new MoteTypeCreationException(
|
||||||
|
@ -398,6 +403,33 @@ public abstract class MspMoteType implements MoteType {
|
||||||
customizedCompileCommand = command;
|
customizedCompileCommand = command;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void cleanTempFiles(final MessageList taskOutput, final File parentDir, boolean synch) {
|
||||||
|
Thread t = new Thread(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
compileFirmware(
|
||||||
|
"make clean TARGET=" + target,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
parentDir,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
taskOutput,
|
||||||
|
true);
|
||||||
|
} catch (Exception e2) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
t.start();
|
||||||
|
if (synch) {
|
||||||
|
try {
|
||||||
|
t.join();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Compiler output
|
* @return Compiler output
|
||||||
*/
|
*/
|
||||||
|
@ -682,17 +714,8 @@ public abstract class MspMoteType implements MoteType {
|
||||||
|
|
||||||
cleanButton.addActionListener(new ActionListener() {
|
cleanButton.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
new Thread(new Runnable() {
|
File parentDir = new File(sourceTextField.getText()).getParentFile();
|
||||||
public void run() {
|
cleanTempFiles(taskOutput, parentDir, false);
|
||||||
try {
|
|
||||||
File parentDir = new File(sourceTextField.getText()).getParentFile();
|
|
||||||
compileFirmware(
|
|
||||||
"make clean TARGET=" + target, new File(sourceTextField.getText()), null,
|
|
||||||
parentDir, null, null, taskOutput, true);
|
|
||||||
} catch (Exception e2) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue