immediately aborting script execution when test reports success or failure

This commit is contained in:
fros4943 2009-03-03 15:55:39 +00:00
parent ac5b2b1500
commit 710c96afc5

View file

@ -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: LogScriptEngine.java,v 1.8 2009/01/12 10:45:40 fros4943 Exp $ * $Id: LogScriptEngine.java,v 1.9 2009/03/03 15:55:39 fros4943 Exp $
*/ */
package se.sics.cooja.plugins; package se.sics.cooja.plugins;
@ -380,6 +380,9 @@ public class LogScriptEngine {
if (timeoutEvent != null) { if (timeoutEvent != null) {
timeoutEvent.remove(); timeoutEvent.remove();
} }
semaphoreSim.release(100);
throw new RuntimeException("test script killed");
} }
public void testFailed() { public void testFailed() {
log("TEST FAILED\n"); log("TEST FAILED\n");
@ -408,6 +411,9 @@ public class LogScriptEngine {
if (timeoutEvent != null) { if (timeoutEvent != null) {
timeoutEvent.remove(); timeoutEvent.remove();
} }
semaphoreSim.release(100);
throw new RuntimeException("test script killed");
} }
public void generateMessage(long delay, final String msg) { public void generateMessage(long delay, final String msg) {