From: <and...@us...> - 2008-12-18 09:54:57
|
Revision: 9186 http://plplot.svn.sourceforge.net/plplot/?rev=9186&view=rev Author: andrewross Date: 2008-12-18 09:54:53 +0000 (Thu, 18 Dec 2008) Log Message: ----------- Modify octave examples and test script so ctest can redirect output to a file rather than stdout. Note this is different to the other languages in that it uses octave capabilities rather than tee. This is more intrusive, but does ensure that the examples can all be run from a single octave process which is much more efficient. Modified Paths: -------------- trunk/bindings/octave/demos/x01c.m trunk/bindings/octave/demos/x23c.m trunk/bindings/octave/demos/x31c.m trunk/plplot_test/test_octave.sh.in Modified: trunk/bindings/octave/demos/x01c.m =================================================================== --- trunk/bindings/octave/demos/x01c.m 2008-12-18 08:42:44 UTC (rev 9185) +++ trunk/bindings/octave/demos/x01c.m 2008-12-18 09:54:53 UTC (rev 9186) @@ -17,8 +17,13 @@ 1; -function ix01c +function ix01c(strm) + # Redirect output to file if required + if (nargin == 0) + strm = stdout; + endif + if (!exist("plinit")) plplot_stub endif @@ -37,7 +42,7 @@ ## Get version number, just for kicks */ ver=plgver'; - printf("PLplot library version: %s\n", ver); + fprintf(strm,"PLplot library version: %s\n", ver); ## Initialize plplot */ ## Divide page into 2x2 plots unless user overrides */ @@ -219,6 +224,10 @@ endfunction -ix01c +if (exist("strm","var")) + ix01c(strm) +else + ix01c() +endif Modified: trunk/bindings/octave/demos/x23c.m =================================================================== --- trunk/bindings/octave/demos/x23c.m 2008-12-18 08:42:44 UTC (rev 9185) +++ trunk/bindings/octave/demos/x23c.m 2008-12-18 09:54:53 UTC (rev 9186) @@ -26,8 +26,14 @@ ## Displays Greek letters and mathematically interesting Unicode ranges -function ix23c +function ix23c(strm) + # Redirect output to file if required + if (nargin == 0) + strm = stdout; + endif + + Greek = [\ "#gA";"#gB";"#gG";"#gD";"#gE";"#gZ";"#gY";"#gH";"#gI";"#gK";"#gL";"#gM";\ "#gN";"#gC";"#gO";"#gP";"#gR";"#gS";"#gT";"#gU";"#gF";"#gX";"#gQ";"#gW";\ @@ -270,8 +276,8 @@ ## Demonstrate methods of getting the current fonts fci_old = plgfci(); [ifamily,istyle,iweight] = plgfont(); -printf("For example 23 prior to page 12 the FCI is 0x%x\n",fci_old); -printf("For example 23 prior to page 12 the font family, style and weight are %s %s %s\n",deblank(family(ifamily+1,:)), deblank(style(istyle+1,:)), deblank(weight(iweight+1,:))); +fprintf(ostrm,"For example 23 prior to page 12 the FCI is 0x%x\n",fci_old); +fprintf(ostrm,"For example 23 prior to page 12 the font family, style and weight are %s %s %s\n",deblank(family(ifamily+1,:)), deblank(style(istyle+1,:)), deblank(weight(iweight+1,:))); for page=11:15 dy = 0.030; @@ -321,4 +327,9 @@ end -ix23c +if (exist("strm","var")) + ix23c(strm); +else + ix23c(); +endif + Modified: trunk/bindings/octave/demos/x31c.m =================================================================== --- trunk/bindings/octave/demos/x31c.m 2008-12-18 08:42:44 UTC (rev 9185) +++ trunk/bindings/octave/demos/x31c.m 2008-12-18 09:54:53 UTC (rev 9186) @@ -24,8 +24,13 @@ 1; -function ret = ix31c +function ret = ix31c(strm) + # Redirect output to file if required + if (nargin == 0) + strm = stdout; + endif + if (!exist("plinit")) plplot_stub endif @@ -207,4 +212,8 @@ endfunction -ix31c +if (exist("strm","var")) + ix31c(strm) +else + ix31c() +endif Modified: trunk/plplot_test/test_octave.sh.in =================================================================== --- trunk/plplot_test/test_octave.sh.in 2008-12-18 08:42:44 UTC (rev 9185) +++ trunk/plplot_test/test_octave.sh.in 2008-12-18 09:54:53 UTC (rev 9186) @@ -75,6 +75,8 @@ #in the API that is supposed to be common to all front ends.) failed = []; for i=[1:13 15 16 18 20:31 ]; + ofile = sprintf("${OUTPUT_DIR}/x%.2d${lang}_${dsuffix}.txt",i); + strm = fopen(ofile,"w"); cmd = sprintf("x%.2dc",i); if (verbose_test) printf("%s\n",cmd); @@ -93,6 +95,7 @@ file = sprintf("${OUTPUT_DIR}/x%.2d${lang}%%n.$dsuffix",i); plSetOpt("o", file); eval(cmd, "failed = [failed, i];"); + fclose(strm); endfor if ! isempty (failed) printf ("Failed tests: "); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |