From: mquinson Date: Tue, 6 Nov 2007 12:27:19 +0000 (+0000) Subject: add gras prop tests to the make check X-Git-Tag: v3.3~846 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/388e72a241e9de8098ba85174d5b9a9b7018703b add gras prop tests to the make check git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4976 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/configure b/configure index 2264e96d67..f038506f89 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac Revision: 4915 . +# From configure.ac Revision: 4930 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for simgrid 3.3-cvs. +# Generated by GNU Autoconf 2.61 for simgrid 3.3-svn. # # Report bugs to . # @@ -731,8 +731,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='simgrid' PACKAGE_TARNAME='simgrid' -PACKAGE_VERSION='3.3-cvs' -PACKAGE_STRING='simgrid 3.3-cvs' +PACKAGE_VERSION='3.3-svn' +PACKAGE_STRING='simgrid 3.3-svn' PACKAGE_BUGREPORT='simgrid-devel@lists.gforge.inria.fr' ac_unique_file="include/gras.h" @@ -1447,7 +1447,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures simgrid 3.3-cvs to adapt to many kinds of systems. +\`configure' configures simgrid 3.3-svn to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1518,7 +1518,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of simgrid 3.3-cvs:";; + short | recursive ) echo "Configuration of simgrid 3.3-svn:";; esac cat <<\_ACEOF @@ -1636,7 +1636,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -simgrid configure 3.3-cvs +simgrid configure 3.3-svn generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1650,7 +1650,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by simgrid $as_me 3.3-cvs, which was +It was created by simgrid $as_me 3.3-svn, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2702,7 +2702,7 @@ fi # Define the identity of the package. PACKAGE='simgrid' - VERSION='3.3-cvs' + VERSION='3.3-svn' cat >>confdefs.h <<_ACEOF @@ -19445,6 +19445,15 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +############### +## SVN version check +## +if test -e .svn ; then + VERSION="$VERSION-r`svnversion`" + PACKAGE_VERSION="$PACKAGE_VERSION-r`svnversion`" + PACKAGE_STRING="PACKAGE_STRING r`svnversion`" +fi ############### ## System checks @@ -26963,7 +26972,7 @@ fi if test x$MD5SUM != xno ; then - build_version=`find -name '*.ch' |grep -v src/ucontext_stack.h | grep -v src/gras_config.h |\ + build_version=`find . -name '*.ch' |grep -v src/ucontext_stack.h | grep -v src/gras_config.h |\ xargs cat| $MD5SUM | sed 's/ .*$//'` else build_version="no_md5sum_binary" @@ -27025,7 +27034,7 @@ ac_config_files="$ac_config_files doc/Makefile doc/Doxyfile" ac_config_files="$ac_config_files examples/java/Makefile examples/java/basic/Makefile examples/java/comm_time/Makefile examples/java/suspend/Makefile examples/java/ping_pong/Makefile" -ac_config_files="$ac_config_files examples/Makefile examples/msg/Makefile examples/simdag/Makefile examples/gras/Makefile examples/gras/ping/Makefile examples/gras/rpc/Makefile examples/gras/spawn/Makefile examples/gras/synchro/Makefile examples/gras/timer/Makefile examples/gras/chrono/Makefile examples/gras/mutual_exclusion/simple_token/Makefile examples/gras/mmrpc/Makefile examples/gras/pmm/Makefile examples/gras/all2all/Makefile examples/amok/Makefile" +ac_config_files="$ac_config_files examples/Makefile examples/msg/Makefile examples/simdag/Makefile examples/gras/Makefile examples/gras/ping/Makefile examples/gras/rpc/Makefile examples/gras/spawn/Makefile examples/gras/synchro/Makefile examples/gras/timer/Makefile examples/gras/properties/Makefile examples/gras/chrono/Makefile examples/gras/mutual_exclusion/simple_token/Makefile examples/gras/mmrpc/Makefile examples/gras/pmm/Makefile examples/gras/all2all/Makefile examples/amok/Makefile" ac_config_files="$ac_config_files src/smpi/smpicc src/smpi/smpirun" @@ -27534,7 +27543,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by simgrid $as_me 3.3-cvs, which was +This file was extended by simgrid $as_me 3.3-svn, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -27587,7 +27596,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -simgrid config.status 3.3-cvs +simgrid config.status 3.3-svn configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -27730,6 +27739,7 @@ do "examples/gras/spawn/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/spawn/Makefile" ;; "examples/gras/synchro/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/synchro/Makefile" ;; "examples/gras/timer/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/timer/Makefile" ;; + "examples/gras/properties/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/properties/Makefile" ;; "examples/gras/chrono/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/chrono/Makefile" ;; "examples/gras/mutual_exclusion/simple_token/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/mutual_exclusion/simple_token/Makefile" ;; "examples/gras/mmrpc/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/mmrpc/Makefile" ;; diff --git a/configure.ac b/configure.ac index 0f22453bcf..fad588c6bf 100644 --- a/configure.ac +++ b/configure.ac @@ -570,6 +570,7 @@ AC_CONFIG_FILES([ examples/gras/spawn/Makefile examples/gras/synchro/Makefile examples/gras/timer/Makefile + examples/gras/properties/Makefile examples/gras/chrono/Makefile examples/gras/mutual_exclusion/simple_token/Makefile examples/gras/mmrpc/Makefile diff --git a/examples/gras/Makefile.am b/examples/gras/Makefile.am index 87a7c0c640..b686017e69 100644 --- a/examples/gras/Makefile.am +++ b/examples/gras/Makefile.am @@ -5,7 +5,7 @@ # GNU LGPL (v2.1) licence. -SUBDIRS= ping rpc spawn timer chrono mutual_exclusion/simple_token mmrpc all2all pmm synchro +SUBDIRS= ping rpc spawn timer chrono mutual_exclusion/simple_token mmrpc all2all pmm synchro properties # p2p include $(top_srcdir)/acmacro/dist-files.mk diff --git a/examples/gras/Makefile.in b/examples/gras/Makefile.in index 9c7e5896a9..938ec15602 100644 --- a/examples/gras/Makefile.in +++ b/examples/gras/Makefile.in @@ -210,7 +210,7 @@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = ping rpc spawn timer chrono mutual_exclusion/simple_token mmrpc all2all pmm synchro +SUBDIRS = ping rpc spawn timer chrono mutual_exclusion/simple_token mmrpc all2all pmm synchro properties all: all-recursive .SUFFIXES: diff --git a/examples/gras/properties/Makefile.am b/examples/gras/properties/Makefile.am new file mode 100644 index 0000000000..bd4d471ff8 --- /dev/null +++ b/examples/gras/properties/Makefile.am @@ -0,0 +1,31 @@ +# Copyright (c) 2004-2007. The SimGrid team. All right reserved. + +# This file is part of the SimGrid project. This is free software: +# You can redistribute and/or modify it under the terms of the +# GNU LGPL (v2.1) licence. + + +INCLUDES= -I$(top_srcdir)/include + +EXTRA_DIST=properties.xml properties.h +include $(top_srcdir)/examples/gras/tests.mk + +# AUTOMAKE variable definition +noinst_PROGRAMS=properties_slave properties_master properties_simulator + +properties_simulator_SOURCES= _properties_simulator.c properties.c +properties_simulator_LDADD= $(top_builddir)/src/libsimgrid.la + +properties_slave_SOURCES= _properties_slave.c properties.c +properties_slave_LDADD= $(top_builddir)/src/libgras.la + +properties_master_SOURCES= _properties_master.c properties.c +properties_master_LDADD= $(top_builddir)/src/libgras.la + +# Take care of generatated sources +NAME=properties +PROCESSES= slave master +include $(top_srcdir)/examples/temps-gras-stub.mk + +# Cruft +include $(top_srcdir)/acmacro/dist-files.mk diff --git a/examples/gras/properties/gras_prop_deployment.xml b/examples/gras/properties/gras_prop_deployment.xml deleted file mode 100644 index fb30f003ce..0000000000 --- a/examples/gras/properties/gras_prop_deployment.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/examples/gras/properties/gras_prop.c b/examples/gras/properties/properties.c similarity index 74% rename from examples/gras/properties/gras_prop.c rename to examples/gras/properties/properties.c index 6ad2d410e3..231524051f 100644 --- a/examples/gras/properties/gras_prop.c +++ b/examples/gras/properties/properties.c @@ -4,8 +4,11 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test,"Simple Property example"); +int master(int argc, char *argv[]); +int slave(int argc, char *argv[]); -int client(int argc, char *argv[]) { + +int slave(int argc, char *argv[]) { gras_init(&argc,argv); /* Get the properties */ @@ -19,36 +22,37 @@ int client(int argc, char *argv[]) { } /* Try to get a property that does not exist */ - char noexist[]="Nonexisent"; + const char *noexist="Nonexisting"; const char *value = gras_process_property_value(noexist); if ( value == NULL) INFO1("Process property: %s is undefined", noexist); else INFO2("Process property: %s has value: %s", noexist, value); - /* Modify an existing property. First check it exists */\ + /* Modify an existing property. First check it exists */ INFO0("Trying to modify a process property"); - char exist[]="otherprop"; + const char *exist="otherprop"; value = gras_process_property_value(exist); - if ( value == NULL) + if (value == NULL) INFO1("\tProperty: %s is undefined", exist); else { INFO2("\tProperty: %s old value: %s", exist, value); - xbt_dict_set(props, exist, strdup("newValue"), free); + xbt_dict_set(props, exist, xbt_strdup("newValue"), free); } /* Test if we have changed the value */ value = gras_process_property_value(exist); - if ( value == NULL) + if (value == NULL) INFO1("\tProperty: %s is undefined", exist); else INFO2("\tProperty: %s new value: %s", exist, value); - + + gras_os_sleep(1); gras_exit(); return 0; } -int server(int argc, char *argv[]) { +int master(int argc, char *argv[]) { gras_init(&argc,argv); /* Get the properties */ @@ -62,13 +66,11 @@ int server(int argc, char *argv[]) { } /* Try to get a property that does not exist */ - char noexist[]="Nonexisent"; + const char *noexist="Nonexisting"; const char *value = gras_os_host_property_value(noexist); - if ( value == NULL) - INFO1("Host property: %s is undefined", noexist); - else - INFO2("Host property: %s has value: %s", noexist, value); + xbt_assert2(value == NULL, "Host property: %s has value: %s", noexist, value); + gras_os_sleep(1); gras_exit(); return 0; } diff --git a/examples/gras/properties/properties.xml b/examples/gras/properties/properties.xml new file mode 100644 index 0000000000..65e37b3559 --- /dev/null +++ b/examples/gras/properties/properties.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/examples/gras/properties/test_rl b/examples/gras/properties/test_rl new file mode 100755 index 0000000000..3abcda835f --- /dev/null +++ b/examples/gras/properties/test_rl @@ -0,0 +1,6 @@ + +! timeout 20 +& $SG_TEST_ENV ./properties_master$EXEEXT 4002 --log=root.fmt=%P:%t%e%m%n $ARGS + +! timeout 20 +& $SG_TEST_ENV ./properties_slave$EXEEXT 127.0.0.1 4002 --log=root.fmt=%P:%t%e%m%n $ARGS diff --git a/examples/gras/properties/test_sg_32 b/examples/gras/properties/test_sg_32 new file mode 100755 index 0000000000..4af7ca9306 --- /dev/null +++ b/examples/gras/properties/test_sg_32 @@ -0,0 +1,12 @@ +p Runs the 'properties' test within the simulator (simulation times valid for 32bits architectures) + +$ $SG_TEST_EXENV ./properties_simulator${EXEEXT:=} ${srcdir:=.}/../../platforms/prop.xml ${srcdir:=.}/properties.xml +> [C1-01:master:(1) 0.000000] [test/INFO] Host property: mem has value: 4 +> [C1-01:master:(1) 0.000000] [test/INFO] Host property: Hdd has value: 180 +> [C1-00:slave:(2) 0.000000] [test/INFO] Process property: SomeProp has value: SomeValue +> [C1-00:slave:(2) 0.000000] [test/INFO] Process property: Nonexisting is undefined +> [C1-00:slave:(2) 0.000000] [test/INFO] Trying to modify a process property +> [C1-00:slave:(2) 0.000000] [test/INFO] Property: otherprop is undefined +> [C1-00:slave:(2) 0.000000] [test/INFO] Property: otherprop is undefined +> [C1-01:master:(1) 1.000000] [gras/INFO] Exiting GRAS +> [C1-00:slave:(2) 1.000000] [gras/INFO] Exiting GRAS diff --git a/examples/gras/properties/test_sg_64 b/examples/gras/properties/test_sg_64 new file mode 100755 index 0000000000..4af7ca9306 --- /dev/null +++ b/examples/gras/properties/test_sg_64 @@ -0,0 +1,12 @@ +p Runs the 'properties' test within the simulator (simulation times valid for 32bits architectures) + +$ $SG_TEST_EXENV ./properties_simulator${EXEEXT:=} ${srcdir:=.}/../../platforms/prop.xml ${srcdir:=.}/properties.xml +> [C1-01:master:(1) 0.000000] [test/INFO] Host property: mem has value: 4 +> [C1-01:master:(1) 0.000000] [test/INFO] Host property: Hdd has value: 180 +> [C1-00:slave:(2) 0.000000] [test/INFO] Process property: SomeProp has value: SomeValue +> [C1-00:slave:(2) 0.000000] [test/INFO] Process property: Nonexisting is undefined +> [C1-00:slave:(2) 0.000000] [test/INFO] Trying to modify a process property +> [C1-00:slave:(2) 0.000000] [test/INFO] Property: otherprop is undefined +> [C1-00:slave:(2) 0.000000] [test/INFO] Property: otherprop is undefined +> [C1-01:master:(1) 1.000000] [gras/INFO] Exiting GRAS +> [C1-00:slave:(2) 1.000000] [gras/INFO] Exiting GRAS