From a9325e9a82ed6cc0f6e487e2e61138e50b222519 Mon Sep 17 00:00:00 2001 From: mquinson Date: Wed, 6 Jun 2007 15:19:29 +0000 Subject: [PATCH] Convert to tesh git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3573 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- examples/gras/chrono/Makefile.am | 1 + examples/gras/chrono/Makefile.in | 1 + examples/gras/chrono/test_rl.in | 11 +++-------- examples/gras/chrono/test_sg.in | 9 ++------- examples/gras/timer/Makefile.am | 1 + examples/gras/timer/Makefile.in | 1 + examples/gras/timer/test_rl.in | 24 ++++++++++++++++-------- examples/gras/timer/test_sg.in | 22 +++++++++++++++------- examples/gras/timer/timer.c | 20 +++++++++----------- 9 files changed, 49 insertions(+), 41 deletions(-) diff --git a/examples/gras/chrono/Makefile.am b/examples/gras/chrono/Makefile.am index 05103c30dd..0425e1160e 100644 --- a/examples/gras/chrono/Makefile.am +++ b/examples/gras/chrono/Makefile.am @@ -1,6 +1,7 @@ INCLUDES= -I$(top_srcdir)/include AM_CFLAGS=-g TESTS= test_rl test_sg +TESTS_ENVIRONMENT=../../../tools/tesh/tesh EXTRA_DIST=chrono.xml # AUTOMAKE variable definition diff --git a/examples/gras/chrono/Makefile.in b/examples/gras/chrono/Makefile.in index ff886dec4a..fa244a564b 100644 --- a/examples/gras/chrono/Makefile.in +++ b/examples/gras/chrono/Makefile.in @@ -235,6 +235,7 @@ target_os = @target_os@ target_vendor = @target_vendor@ INCLUDES = -I$(top_srcdir)/include TESTS = test_rl test_sg +TESTS_ENVIRONMENT = ../../../tools/tesh/tesh EXTRA_DIST = chrono.xml chrono_simulator_SOURCES = _chrono_simulator.c chrono.c chrono_simulator_LDADD = $(top_builddir)/src/libsimgrid.la diff --git a/examples/gras/chrono/test_rl.in b/examples/gras/chrono/test_rl.in index cf6e5c7ca4..5474cd5b34 100755 --- a/examples/gras/chrono/test_rl.in +++ b/examples/gras/chrono/test_rl.in @@ -1,8 +1,3 @@ -#! @BASH@ -e -if [ x@EXEEXT@ = x ] ; then - exenv=$SG_TEST_EXENV -else - exenv=wine -fi - -exec $exenv ./chrono_multiplier@EXEEXT@ $@ + +! output display +$ $SG_TEST_EXENV ./chrono_multiplier@EXEEXT@ --log=root.fmt:%m%n $@ diff --git a/examples/gras/chrono/test_sg.in b/examples/gras/chrono/test_sg.in index 1debfc92be..01ea14de94 100755 --- a/examples/gras/chrono/test_sg.in +++ b/examples/gras/chrono/test_sg.in @@ -1,8 +1,3 @@ -#! @BASH@ -if [ x@EXEEXT@ = x ] ; then - exenv=$SG_TEST_EXENV -else - exenv=wine -fi -exec $exenv ./chrono_simulator@EXEEXT@ @top_srcdir@/examples/msg/small_platform.xml @srcdir@/chrono.xml +! output display +$ $SG_TEST_EXENV ./chrono_simulator@EXEEXT@ @top_srcdir@/examples/msg/small_platform.xml @srcdir@/chrono.xml diff --git a/examples/gras/timer/Makefile.am b/examples/gras/timer/Makefile.am index 4adfc5a1b2..ce2e0cdb78 100644 --- a/examples/gras/timer/Makefile.am +++ b/examples/gras/timer/Makefile.am @@ -2,6 +2,7 @@ INCLUDES= -I$(top_srcdir)/include AM_CFLAGS=-g TESTS= test_rl test_sg +TESTS_ENVIRONMENT=../../../tools/tesh/tesh EXTRA_DIST=$(NAME).xml $(TESTS) # AUTOMAKE variable definition diff --git a/examples/gras/timer/Makefile.in b/examples/gras/timer/Makefile.in index 3b2337d715..2a07ab0ab1 100644 --- a/examples/gras/timer/Makefile.in +++ b/examples/gras/timer/Makefile.in @@ -233,6 +233,7 @@ target_os = @target_os@ target_vendor = @target_vendor@ INCLUDES = -I$(top_srcdir)/include TESTS = test_rl test_sg +TESTS_ENVIRONMENT = ../../../tools/tesh/tesh EXTRA_DIST = $(NAME).xml $(TESTS) timer_simulator_SOURCES = _timer_simulator.c timer.c timer_simulator_LDADD = $(top_builddir)/src/libsimgrid.la diff --git a/examples/gras/timer/test_rl.in b/examples/gras/timer/test_rl.in index 4f67277ed5..1afa26c85b 100755 --- a/examples/gras/timer/test_rl.in +++ b/examples/gras/timer/test_rl.in @@ -1,8 +1,16 @@ -#! @BASH@ -e -if [ x@EXEEXT@ = x ] ; then - exenv=$SG_TEST_EXENV -else - exenv=wine -fi - -exec $exenv ./timer_client@EXEEXT@ +! set timeout 20 +$ $SG_TEST_EXENV ./timer_client@EXEEXT@ --log=root.fmt:%m%n +> Programming the repetitive_action with a frequency of 1.000000 sec +> Programming the delayed_action for after 2.000000 sec +> Have a rest +> Canceling the delayed_action. +> Re-programming the delayed_action for after 2.000000 sec +> Repetitive_action has nothing to do yet +> Repetitive_action has nothing to do yet +> delayed_action setting globals->still_to_do to 5 +> repetitive_action decrementing globals->still_to_do. New value: 4 +> repetitive_action decrementing globals->still_to_do. New value: 3 +> repetitive_action decrementing globals->still_to_do. New value: 2 +> repetitive_action decrementing globals->still_to_do. New value: 1 +> repetitive_action decrementing globals->still_to_do. New value: 0 +> Exiting GRAS diff --git a/examples/gras/timer/test_sg.in b/examples/gras/timer/test_sg.in index e54fb71d09..45abb4bbfc 100755 --- a/examples/gras/timer/test_sg.in +++ b/examples/gras/timer/test_sg.in @@ -1,8 +1,16 @@ -#! @BASH@ -if [ x@EXEEXT@ = x ] ; then - exenv=$SG_TEST_EXENV -else - exenv=wine -fi -exec $exenv ./timer_simulator@EXEEXT@ @top_srcdir@/examples/msg/small_platform.xml @srcdir@/timer.xml $@ +$ $SG_TEST_EXENV ./timer_simulator@EXEEXT@ @top_srcdir@/examples/msg/small_platform.xml @srcdir@/timer.xml $@ +> [Fafard:client:(1) 0.000000] [test/INFO] Programming the repetitive_action with a frequency of 1.000000 sec +> [Fafard:client:(1) 0.000000] [test/INFO] Programming the delayed_action for after 2.000000 sec +> [Fafard:client:(1) 0.000000] [test/INFO] Have a rest +> [Fafard:client:(1) 1.000000] [test/INFO] Canceling the delayed_action. +> [Fafard:client:(1) 1.000000] [test/INFO] Re-programming the delayed_action for after 2.000000 sec +> [Fafard:client:(1) 1.000000] [test/INFO] Repetitive_action has nothing to do yet +> [Fafard:client:(1) 2.000000] [test/INFO] Repetitive_action has nothing to do yet +> [Fafard:client:(1) 2.000000] [test/INFO] delayed_action setting globals->still_to_do to 5 +> [Fafard:client:(1) 3.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 4 +> [Fafard:client:(1) 4.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 3 +> [Fafard:client:(1) 5.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 2 +> [Fafard:client:(1) 6.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 1 +> [Fafard:client:(1) 7.000000] [test/INFO] repetitive_action decrementing globals->still_to_do. New value: 0 +> [Fafard:client:(1) 7.000000] [gras/INFO] Exiting GRAS diff --git a/examples/gras/timer/timer.c b/examples/gras/timer/timer.c index 4f6b7e699b..b46d3888d4 100644 --- a/examples/gras/timer/timer.c +++ b/examples/gras/timer/timer.c @@ -26,7 +26,7 @@ static void repetitive_action(void) { /* Stop if nothing to do yet */ if (globals->still_to_do <= 0) { - INFO1("[%.0f] Repetitive_action has nothing to do yet",gras_os_time()); + INFO0("Repetitive_action has nothing to do yet"); return; } @@ -35,7 +35,7 @@ static void repetitive_action(void) { gras_timer_cancel_repeat(REPEAT_INTERVAL,repetitive_action); } - INFO2("[%.0f] repetitive_action decrementing globals->still_to_do. New value: %d",gras_os_time(), + INFO1("repetitive_action decrementing globals->still_to_do. New value: %d", globals->still_to_do-1); globals->still_to_do--; /* should be the last line of the action since value=0 stops the program */ @@ -44,8 +44,7 @@ static void repetitive_action(void) { static void delayed_action(void) { my_globals *globals=(my_globals*)gras_userdata_get(); - INFO2("[%.0f] delayed_action setting globals->still_to_do to %d", - gras_os_time(),LOOP_COUNT); + INFO1("delayed_action setting globals->still_to_do to %d",LOOP_COUNT); globals->still_to_do = LOOP_COUNT; } /* end_of_delayed_action */ @@ -57,26 +56,25 @@ int client(int argc,char *argv[]) { globals=gras_userdata_new(my_globals); globals->still_to_do = -1; - INFO2("[%.0f] Programming the repetitive_action with a frequency of %f sec", gras_os_time(), REPEAT_INTERVAL); + INFO1("Programming the repetitive_action with a frequency of %f sec", REPEAT_INTERVAL); gras_timer_repeat(REPEAT_INTERVAL,repetitive_action); - INFO2("[%.0f] Programming the delayed_action for after %f sec", gras_os_time(), DELAY_INTERVAL); + INFO1("Programming the delayed_action for after %f sec", DELAY_INTERVAL); gras_timer_delay(REPEAT_INTERVAL,delayed_action); - INFO1("[%.0f] Have a rest", gras_os_time()); + INFO0("Have a rest"); gras_os_sleep(DELAY_INTERVAL / 2.0); - INFO1("[%.0f] Canceling the delayed_action.",gras_os_time()); + INFO0("Canceling the delayed_action."); gras_timer_cancel_delay(REPEAT_INTERVAL,delayed_action); - INFO2("[%.0f] Re-programming the delayed_action for after %f sec", gras_os_time(),DELAY_INTERVAL); + INFO1("Re-programming the delayed_action for after %f sec",DELAY_INTERVAL); gras_timer_delay(REPEAT_INTERVAL,delayed_action); while (globals->still_to_do == -1 || /* Before delayed action runs */ globals->still_to_do > 0 /* after delayed_action, and not enough repetitive_action */) { - DEBUG2("[%.0f] Prepare to handle messages for 5 sec (still_to_do=%d)", - gras_os_time(), globals->still_to_do); + DEBUG1("Prepare to handle messages for 5 sec (still_to_do=%d)", globals->still_to_do); gras_msg_handle(5.0); } gras_exit(); -- 2.20.1