From 7fc9fe25f03b219bd45664a5244b7487b89d1afc Mon Sep 17 00:00:00 2001 From: mquinson Date: Sat, 22 Oct 2005 14:45:22 +0000 Subject: [PATCH] Move OSSP testsuite code out of the testsuite/ dir so that it becomes part of XBT git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1795 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- ChangeLog | 3 +- TODO | 13 ++- include/Makefile.am | 1 + include/xbt.h | 1 + .../ex_test_ts.h => include/xbt/testsuite.h | 0 src/Makefile.am | 1 + .../xbt/ex_test_ts.c => src/xbt/testsuite.c | 2 +- testsuite/Makefile.am | 1 - testsuite/run_tests.in | 86 +++++++++++-------- testsuite/xbt/ex_test.c | 2 +- 10 files changed, 67 insertions(+), 43 deletions(-) rename testsuite/xbt/ex_test_ts.h => include/xbt/testsuite.h (100%) rename testsuite/xbt/ex_test_ts.c => src/xbt/testsuite.c (99%) diff --git a/ChangeLog b/ChangeLog index c8e0b64aa8..0f61356d57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ SimGrid (3.0.2) unstable; urgency=low - * + XBT: + * New module: testsuite [MQ] -- diff --git a/TODO b/TODO index b2e95ff946..ba432587da 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,17 @@ ### ### Ongoing stuff ### +/* FIXME: better place? */ +int vasprintf (char **ptr, const char *fmt, va_list ap); +char *bprintf(const char*fmt, ...) _XBT_GNUC_PRINTF(1,2); +Replace fifo with dynars + +Replace set with SWAG + +Rename SWAG to RING? + +Rename cursor to iterator ### ### Planned @@ -33,7 +43,7 @@ The first ones should be repported to the user, the second should kill the program (or, yet better, only the msg handler) * Allows the use of an error handler depending on the current module (ie, - the same philosophy than log4c using GSL's error functions) + the same philosophy as log4c using GSL's error functions) [logs] * Hijack message from a given category to another for a while (to mask @@ -62,7 +72,6 @@ ****** [doc] - * add the token ring as official example * implement the P2P protocols that macedon does. They constitute great examples, too diff --git a/include/Makefile.am b/include/Makefile.am index 0291635c92..30575e9cec 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -10,6 +10,7 @@ nobase_include_HEADERS = \ xbt/fifo.h \ xbt/swag.h \ xbt/config.h \ + xbt/testsuite.h \ \ msg/msg.h \ msg/datatypes.h \ diff --git a/include/xbt.h b/include/xbt.h index 52a918980f..75ef4df957 100644 --- a/include/xbt.h +++ b/include/xbt.h @@ -25,5 +25,6 @@ #include #include +#include #endif /* xbt_H */ diff --git a/testsuite/xbt/ex_test_ts.h b/include/xbt/testsuite.h similarity index 100% rename from testsuite/xbt/ex_test_ts.h rename to include/xbt/testsuite.h diff --git a/src/Makefile.am b/src/Makefile.am index 03ca4dc2fe..09ca7f59a8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -114,6 +114,7 @@ COMMON_SRC=\ xbt/set.c \ xbt/module.c \ xbt/config.c \ + xbt/testsuite.c \ \ gras/gras.c \ \ diff --git a/testsuite/xbt/ex_test_ts.c b/src/xbt/testsuite.c similarity index 99% rename from testsuite/xbt/ex_test_ts.c rename to src/xbt/testsuite.c index b86c81e200..bc872ba9dd 100644 --- a/testsuite/xbt/ex_test_ts.c +++ b/src/xbt/testsuite.c @@ -34,7 +34,7 @@ #include #include "gras_config.h" -#include "ex_test_ts.h" +#include "xbt/testsuite.h" /* embedded ring data structure library */ #define RING_ENTRY(elem) \ diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 965253364d..fb394bce5d 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -51,7 +51,6 @@ valgrind: $(noinst_PROGRAMS) $(noinst_SCRIPTS) LDADD_SG=$(top_builddir)/src/libsimgrid.la LDADD_RL=$(top_builddir)/src/libgras.la -xbt_ex_test_SOURCES= xbt/ex_test.c xbt/ex_test_ts.c xbt/ex_test_ts.h xbt_ex_test_LDADD= $(LDADD_RL) xbt_log_usage_LDADD= $(LDADD_RL) diff --git a/testsuite/run_tests.in b/testsuite/run_tests.in index 27fcd51335..e2b741b133 100755 --- a/testsuite/run_tests.in +++ b/testsuite/run_tests.in @@ -71,7 +71,7 @@ test="" for testpart in $xbt_TESTS $gras_TESTS $surf_TESTS do test="$test $testpart" - if echo $test | grep ';' ; then + if echo $test | grep ';' >/dev/null ; then # end of test declaration found. # we must have a space after the ; @@ -83,56 +83,68 @@ do # Cleanup test declaration, run it. test=`echo $test | sed 's/;//'` - tests_nb=`expr $tests_nb + 1` - echo "#### Test $test" - if [ x@EXEEXT@ = x ] ; then - : + if [ ".$1" = .windump ] ; then + test=`echo $test | sed 's|/home.*testsuite/|//10.0.2.4/qemu/testsuite/|'` + test=`echo $test | sed 's|/|\\\\|g'` + echo "\\\\10.0.2.4\\qemu\\testsuite\\$test" + echo "@if errorlevel 1 echo ERRORERRORERRORERRORERRORERRORERRORERRORERRORERRORERRORERROR" + test="" else - # overwrites "valgrind" as a value, but should be exclusive. - exenv=wine - fi - exenvsave=$exenv - if [ "x$test" = "xxbt/dict_crash@EXEEXT@" ] ; then - if echo $exenv | grep valgrind >/dev/null ; then - exenv= + tests_nb=`expr $tests_nb + 1` + echo "#### Test $test" + if [ x@EXEEXT@ = x ] ; then + : + else + # overwrites "valgrind" as a value, but should be exclusive. + exenv=wine fi - $exenv ./$test --xbt-log="root.thres=info" 2>&1 - retval=$? - else - if [ x@EXEEXT@ != x ] && [ x$exenv = xwine ] ; then - if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else - exenv="" + exenvsave=$exenv + if [ "x$test" = "xxbt/dict_crash@EXEEXT@" ] ; then + if echo $exenv | grep valgrind >/dev/null ; then + exenv= + fi + $exenv ./$test --xbt-log="root.thres=info" 2>&1 + retval=$? + else + if [ x@EXEEXT@ != x ] && [ x$exenv = xwine ] ; then + if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else + exenv="" + fi fi + $exenv ./$test --xbt-log="root.thres=info" 2>&1 + retval=$? fi - $exenv ./$test --xbt-log="root.thres=info" 2>&1 - retval=$? - fi - exenv=$exenvsave - if [ $retval != 0 ] ; then if [ $retval != 77 ]; then - echo "## failed" # . Rerun $test with full details." + exenv=$exenvsave + if [ $retval != 0 ] ; then if [ $retval != 77 ]; then + echo "## failed" # . Rerun $test with full details." # if [ "x$test" = "xdict_crash" ] ; then # $exenv ./$test --xbt-log="root.thres=debug" 2>&1 # else # $exenv ./$test --xbt-log="root.thres=debug" 2>&1 # fi - failed_nb=`expr $failed_nb + 1` - echo " $test (returned $retval)" >> test.failed - else # retval == 77 - echo "## Ignored since it returned 77" - ignored_nb=`expr $ignored_nb + 1` - echo " $test" >> test.ignored - fi else - echo "## Success" - success_nb=`expr $success_nb + 1` - echo " $test" >> test.success - fi - test="" - fi # end of ';' found in test declaration => run it + failed_nb=`expr $failed_nb + 1` + echo " $test (returned $retval)" >> test.failed + else # retval == 77 + echo "## Ignored since it returned 77" + ignored_nb=`expr $ignored_nb + 1` + echo " $test" >> test.ignored + fi else + echo "## Success" + success_nb=`expr $success_nb + 1` + echo " $test" >> test.success + fi + test="" + fi # end of ';' found in test declaration => run it + fi # end of run it only if not in windump mode done ### ### Display summary ### +if [ ".$1" = .windump ] ; then + echo pause + exit 0 +fi echo echo "#### Summary" diff --git a/testsuite/xbt/ex_test.c b/testsuite/xbt/ex_test.c index f1e754005a..5bb4c92d66 100644 --- a/testsuite/xbt/ex_test.c +++ b/testsuite/xbt/ex_test.c @@ -33,7 +33,7 @@ #include #include -#include "ex_test_ts.h" +#include "xbt/testsuite.h" #include "xbt/ex.h" #include "xbt/log.h" -- 2.20.1