[PD-cvs] externals/zexy/tests README.txt, 1.1, 1.2 runtests.sh, 1.5, 1.6 runtests.txt, 1.7, 1.8

IOhannes m zmölnig zmoelnig at users.sourceforge.net
Wed Mar 14 10:53:39 CET 2007


Update of /cvsroot/pure-data/externals/zexy/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv655

Modified Files:
	README.txt runtests.sh runtests.txt 
Log Message:
updated test system and added a msgfile reentrancy test

Index: runtests.txt
===================================================================
RCS file: /cvsroot/pure-data/externals/zexy/tests/runtests.txt,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** runtests.txt	28 Sep 2006 10:27:00 -0000	1.7
--- runtests.txt	14 Mar 2007 09:53:37 -0000	1.8
***************
*** 13,18 ****
  help-msg/blockswap~;
  help-msg/date;
- help-msg/demultiplex;
  help-msg/demultiplex~;
  help-msg/dfreq~;
  help-msg/dirac~;
--- 13,18 ----
  help-msg/blockswap~;
  help-msg/date;
  help-msg/demultiplex~;
+ help-msg/demultiplex;
  help-msg/dfreq~;
  help-msg/dirac~;
***************
*** 34,39 ****
  help-msg/msgfile;
  help-msg/multiline~;
- help-msg/multiplex;
  help-msg/multiplex~;
  help-msg/niagara;
  help-msg/noish~;
--- 34,39 ----
  help-msg/msgfile;
  help-msg/multiline~;
  help-msg/multiplex~;
+ help-msg/multiplex;
  help-msg/niagara;
  help-msg/noish~;
***************
*** 67,73 ****
--- 67,75 ----
  help-msg/urn;
  help-msg/wrap;
+ help-msg/zexy;
  help-msg/z~;
  l2s/argument;
  l2s/delimiter;
+ msgfile/reentrant;
  repeat/noargs;
  s2l/numsymbols;

Index: README.txt
===================================================================
RCS file: /cvsroot/pure-data/externals/zexy/tests/README.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** README.txt	21 Dec 2005 10:42:55 -0000	1.1
--- README.txt	14 Mar 2007 09:53:37 -0000	1.2
***************
*** 9,18 ****
  a bang is sent to the inlet to start the test.
  the test has to send "1" to the outlet if the test succeeded.
! any other result (be it !=1 or no result at all will be 
! considered a failure of the test.
  
  example tests of [==]:
  
! test1:
   [inlet]
   |
--- 9,21 ----
  a bang is sent to the inlet to start the test.
  the test has to send "1" to the outlet if the test succeeded.
! any other result will be considered a failure of the test.
! the test MUST return a result, else it will halt the entire
! testrun. (this is needed to allow objects that do not return 
! in zero-time (signal-objects or other timed objects) to be
! tested with this framework too)
  
  example tests of [==]:
  
! GOOD test:
   [inlet]
   |
***************
*** 23,27 ****
   [outlet]
  
! test2:
   [inlet]
   |
--- 26,30 ----
   [outlet]
  
! BAD test (will hang forever):
   [inlet]
   |
***************
*** 39,46 ****
  HOW THE FRAMEWORK WORKS
  -----------------------
! only .pd-files in one-level-subdirectories are considered tests.
! (e.g. ./subdir/patch1.pd is tested, while ./patch2.pd and 
! ./sub/dir/patch3.pd are not taken into account)
! see directory layout below
  at the beginning of the testrun a file "runtests.txt" is generated
  which contains all test-patches, one per line and each line
--- 42,50 ----
  HOW THE FRAMEWORK WORKS
  -----------------------
! all .pd-files in one-level-subdirectories are considered tests.
! e.g. ./subdir/patch1.pd is tested, while ./patch2.pd and 
! ./sub/dir/patch3.pd are not taken into account
! this is important if you need abstractions for your test
! 
  at the beginning of the testrun a file "runtests.txt" is generated
  which contains all test-patches, one per line and each line
***************
*** 58,63 ****
  CAVEATS
  =======
!  no testing of signal objects
!  no testing of timed objects
  
  
--- 62,71 ----
  CAVEATS
  =======
!  pd-0.40 has problems creating an path-prefixed abstraction when a
!  library of the same name is already loaded.
!  e.g. if the library "zexy" is loaded, then the abstraction ./path/zexy.pd
!  CANNOT be instantiated as object [./path/zexy];
!  this seems to be fixed in newer versions of pd
!  
  
  

Index: runtests.sh
===================================================================
RCS file: /cvsroot/pure-data/externals/zexy/tests/runtests.sh,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** runtests.sh	28 Sep 2006 10:15:10 -0000	1.5
--- runtests.sh	14 Mar 2007 09:53:37 -0000	1.6
***************
*** 17,37 ****
  RUNTESTS_LOG=log-runtests.${SUFFIX}
  
! ls -1 */*.pd | sed 's/\.pd/;/' > ${RUNTESTS_TXT}
  
  
- LIBFLAGS="-path ../src:../ -lib zexy -path ../abs/"
  
  function run_nogui() {
   ${PD} ${LIBFLAGS} -nogui runtests_nogui.pd > ${RUNTESTS_LOG} 2>&1 
!  NUMTESTS=`grep -c . ${RUNTESTS_TXT}`
!  echo "regression-test: ${NUMTESTS} tests total" >>  ${RUNTESTS_LOG}
!  
!  cat ${RUNTESTS_LOG} | egrep "^regression-test: " | sed -e 's/^regression-test: //'
  }
  
  function run_withgui() {
   ${PD} ${LIBFLAGS} -stderr runtests.pd > ${RUNTESTS_LOG} 2>&1
  }
  
  if test "x$1" = "x-gui"; then
   run_withgui
--- 17,67 ----
  RUNTESTS_LOG=log-runtests.${SUFFIX}
  
! LIBFLAGS="-path ../src:../ -lib zexy -path ../abs/"
  
+ function list_tests() {
+ #  find . -mindepth 2  -name "*.pd" | sed 's|\.pd$|;|' 
+  ls -1 */*.pd | sed 's|\.pd$|;|'
+ }
+ 
+ function debug() {
+  :
+ # echo $@
+ }
+ 
+ 
+ function evaluate_tests() {
+  local logfile
+  local testfile
+  local numtests
+ 
+  testfile=$1
+  logfile=$2
+ 
+  debug "now evaluating results in ${logfile} (${testfile}"
+ 
+  numtests=$(grep -c . ${testfile})
+  debug "number of tests = ${numtests}"
+  echo "regression-test: ${numtests} tests total" >>  ${logfile}
+  debug "show results"
+  cat ${logfile} | egrep "^regression-test: " | sed -e 's/^regression-test: //'
+ }
  
  
  function run_nogui() {
+  debug "running test without gui"
   ${PD} ${LIBFLAGS} -nogui runtests_nogui.pd > ${RUNTESTS_LOG} 2>&1 
!  debug "testing done"
!  evaluate_tests ${RUNTESTS_TXT} ${RUNTESTS_LOG}
!  debug "testing finished"
  }
  
  function run_withgui() {
+  debug "running test with gui"
   ${PD} ${LIBFLAGS} -stderr runtests.pd > ${RUNTESTS_LOG} 2>&1
+  debug "testing completed, no evaluation will be done; see ${RUNTESTS_LOG} for results"
  }
  
+ list_tests > ${RUNTESTS_TXT}
+ 
  if test "x$1" = "x-gui"; then
   run_withgui





More information about the Pd-cvs mailing list