From 747d27ecda74e3f82837265f977f2fdc9b319059 Mon Sep 17 00:00:00 2001 From: nvt-se Date: Fri, 12 Dec 2008 13:24:42 +0000 Subject: [PATCH] updated cooja/mspsim test for coffee. now with GC --- examples/sky/test-coffee.c | 4 +-- tools/cooja/contiki_tests/sky_coffee.js | 40 ++++++++++++++++++------- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/examples/sky/test-coffee.c b/examples/sky/test-coffee.c index 03d5756c0..26b12f0b7 100755 --- a/examples/sky/test-coffee.c +++ b/examples/sky/test-coffee.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: test-coffee.c,v 1.5 2008/12/12 10:28:11 nvt-se Exp $ + * $Id: test-coffee.c,v 1.6 2008/12/12 13:24:42 nvt-se Exp $ */ /** @@ -306,7 +306,7 @@ PROCESS_THREAD(testcoffee_process, ev, data) { PROCESS_BEGIN(); - printf("Coffee consistency test: %d\n", coffee_file_test()); + printf("Coffee file test: %d\n", coffee_file_test()); printf("Coffee garbage collection test: %d\n", coffee_gc_test()); PROCESS_END(); diff --git a/tools/cooja/contiki_tests/sky_coffee.js b/tools/cooja/contiki_tests/sky_coffee.js index 29003a799..4359054f2 100644 --- a/tools/cooja/contiki_tests/sky_coffee.js +++ b/tools/cooja/contiki_tests/sky_coffee.js @@ -1,10 +1,30 @@ -/* Script is called once for every node log output. */ -/* Input variables: Mote mote, int id, String msg. */ - -if (msg.startsWith('Coffee consistency test: 0')) { - log.log('TEST OK'); - mote.getSimulation().getGUI().doQuit(false); /* Quit simulator (to end test run)*/ -} else if (msg.startsWith('Coffee consistency test')) { - log.log('TEST FAILED'); - mote.getSimulation().getGUI().doQuit(false); /* Quit simulator (to end test run)*/ -} +if (msg.startsWith('Coffee file test: 0')) { + global.put("coffee_file_test", true); +} else if (msg.startsWith('Coffee file test')) { + global.put("coffee_file_test", false); +} else if (msg.startsWith('Coffee garbage collection test: 0')) { + global.put("coffee_gc_test", true); +} else if (msg.startsWith('Coffee garbage collection test')) { + global.put("coffee_gc_test", false); +} + +if (global.get("coffee_file_test") == null) { + //log.log("file test not finished yet\n"); + return; +} +if (global.get("coffee_gc_test") == null) { + //log.log("gc test not finished yet\n"); + return; +} + +if (global.get("coffee_gc_test") == false) { + log.log("coffee garbage collection failed\n"); + log.testFailed(); +} + +if (global.get("coffee_file_test") == false) { + log.log("coffee file test failed\n"); + log.testFailed(); +} + +log.testOK();