[C-mpi-commits] SF.net SVN: c-mpi:[31] test
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-04-20 19:21:16
|
Revision: 31
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=31&view=rev
Author: jmwozniak
Date: 2010-04-20 19:21:09 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
Improve gossip tests.
Modified Paths:
--------------
Makefile.in
test/gossip/module.mk.in
test/gossip/test-do.c
test/gossip/test-env.c
test/mpirpc/module.mk.in
Added Paths:
-----------
test/gossip/test-do.zsh
test/gossip/test-env.zsh
test/gossip/test-masks.zsh
Modified: Makefile.in
===================================================================
--- Makefile.in 2010-04-20 19:02:35 UTC (rev 30)
+++ Makefile.in 2010-04-20 19:21:09 UTC (rev 31)
@@ -480,7 +480,7 @@
hex unhex hexord unpublish node driver \
$(TEST_OUTPUT) $(TEST_PROGS) $(TEST_OBJS) \
$(CMPI_PROGS) $(CMPI_CP_OBJS) splint.out
- $(E)find . -name "*.failed" -exec rm -fv \{\} \;
+ $(E)find . -name "*.failed" -exec rm -fv \{\} \;
# $(E)find . -name "*.avg" -exec rm -fv \{\} \;
# $(E)find . -name "*.per" -exec rm -fv \{\} \;
Modified: test/gossip/module.mk.in
===================================================================
--- test/gossip/module.mk.in 2010-04-20 19:02:35 UTC (rev 30)
+++ test/gossip/module.mk.in 2010-04-20 19:21:09 UTC (rev 31)
@@ -1,6 +1,11 @@
-TEST_SRC += $(shell find test/gossip -name "*.c")
+DIR := test/gossip
-test/gossip/test%.x: test/gossip/test%.o $(CMPI)
+TEST_SRC += $(shell find $(DIR) -name "*.c")
+
+$(DIR)/test%.x: $(DIR)/test%.o $(CMPI)
$(Q) " LINK $(@) "
$(E)$(MPICC) $(<) $(CMPI) $(LIBS) -o $(@)
+
+$(DIR)/test%.out: $(DIR)/test%.x
+ $(patsubst %.x, %.zsh, $(<)) $(<)
Modified: test/gossip/test-do.c
===================================================================
--- test/gossip/test-do.c 2010-04-20 19:02:35 UTC (rev 30)
+++ test/gossip/test-do.c 2010-04-20 19:21:09 UTC (rev 31)
@@ -16,12 +16,12 @@
printf(
"This test program will print an example debugging message on the final\n"
"line of output if the CMPI_DEBUG_MASK environment variable is set to include\n"
-"\"example\" or \"all\" in its comma seperated list of masks:\n"
+"\"example\" or \"all\" in its comma separated list of masks:\n"
);
gossip_debug_init();
- gossip_do(MASK_EXAMPLE, printf("Hello\n"));
+ gossip_do(MASK_EXAMPLE, printf("EXAMPLE MESSAGE\n"));
MPI_Finalize();
return 0;
Added: test/gossip/test-do.zsh
===================================================================
--- test/gossip/test-do.zsh (rev 0)
+++ test/gossip/test-do.zsh 2010-04-20 19:21:09 UTC (rev 31)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+set -x
+
+# Be sure to make tests with D=1
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+
+crash()
+{
+ print $1
+ mv ${OUT} ${OUT}.failed
+ exit 1
+}
+
+${PROGRAM} > ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+# Should be 3 "test program"s
+N=$( grep -c "test program" ${OUT} )
+(( N == 3 )) || crash "N != 3"
+
+# Should be 2 "EXAMPLE MESSAGE"s
+N=$( grep -c "EXAMPLE MESSAGE" ${OUT} )
+(( N == 2 )) || crash "N != 2"
+
+exit 0
Property changes on: test/gossip/test-do.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/gossip/test-env.c
===================================================================
--- test/gossip/test-env.c 2010-04-20 19:02:35 UTC (rev 30)
+++ test/gossip/test-env.c 2010-04-20 19:21:09 UTC (rev 31)
@@ -18,7 +18,7 @@
gossip_debug_init();
- gossip_debug(MASK_EXAMPLE, "Example debugging message.\n");
+ gossip_debug(MASK_EXAMPLE, "EXAMPLE MESSAGE\n");
MPI_Finalize();
return 0;
Added: test/gossip/test-env.zsh
===================================================================
--- test/gossip/test-env.zsh (rev 0)
+++ test/gossip/test-env.zsh 2010-04-20 19:21:09 UTC (rev 31)
@@ -0,0 +1,37 @@
+#!/bin/zsh
+
+set -x
+
+# Be sure to make tests with D=1
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+
+crash()
+{
+ print $1
+ mv ${OUT} ${OUT}.failed
+ exit 1
+}
+
+${PROGRAM} > ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+CMPI_DEBUG_MASK=example ${PROGRAM} >> ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+CMPI_DEBUG_MASK=all ${PROGRAM} >> ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+# Should be 3 "test program"s
+N=$( grep -c "test program" ${OUT} )
+(( N == 3 )) || crash "N != 3"
+
+# Should be 2 "Example debugging message."s
+N=$( grep -c "Example debugging message." ${OUT} )
+(( N == 2 )) || crash "N != 2"
+
+exit 0
Property changes on: test/gossip/test-env.zsh
___________________________________________________________________
Added: svn:executable
+ *
Added: test/gossip/test-masks.zsh
===================================================================
--- test/gossip/test-masks.zsh (rev 0)
+++ test/gossip/test-masks.zsh 2010-04-20 19:21:09 UTC (rev 31)
@@ -0,0 +1,29 @@
+#!/bin/zsh
+
+set -x
+
+# Be sure to make tests with D=1
+
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+
+crash()
+{
+ print $1
+ mv ${OUT} ${OUT}.failed
+ exit 1
+}
+
+${PROGRAM} > ${OUT} 2>&1
+CODE=$?
+[[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+# Should be 4 "Debug mask"s
+N=$( grep -c "Debug mask" ${OUT} )
+(( N == 4 )) || crash "N != 4"
+
+# Should be 2 line outputs
+N=$( grep -c "test-masks.c main.*Debug mask" ${OUT} )
+(( N == 2 )) || crash "N != 2"
+
+exit 0
Property changes on: test/gossip/test-masks.zsh
___________________________________________________________________
Added: svn:executable
+ *
Modified: test/mpirpc/module.mk.in
===================================================================
--- test/mpirpc/module.mk.in 2010-04-20 19:02:35 UTC (rev 30)
+++ test/mpirpc/module.mk.in 2010-04-20 19:21:09 UTC (rev 31)
@@ -7,6 +7,7 @@
TEST_MPIRPC_SRC += $(shell find $(DIR) -name "*.c" )
TEST_SRC += $(TEST_MPIRPC_SRC)
TEST_STATUS += $(DIR)/test02.status
+TEST_OUTPUT += $(patsubst %.x, %.out, $(TEST_MPIRPC_SRC))
test/mpirpc/test%.out: test/mpirpc/test%.x
mpdlistjobs
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|