# HG changeset patch # User jwe # Date 1154020574 0 # Node ID 9c134531c2c45f48f79caf133ff3805db202ca24 # Parent 288c341438f9a821a36f18c48cf8e75abf1c291b [project @ 2006-07-27 17:14:24 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2006-07-27 John W. Eaton + + * testfun/test.m: Call fflush after each block of calls to + fprintf, fputs, or fdisp. + 2006-07-26 John W. Eaton * miscellaneous/mex.m: New function. diff --git a/scripts/testfun/test.m b/scripts/testfun/test.m --- a/scripts/testfun/test.m +++ b/scripts/testfun/test.m @@ -105,6 +105,7 @@ __close_fid = 1; endif fprintf (__fid, "%sprocessing %s\n", __signal_file, __name); + fflush (__fid); else __fid = stdout; endif @@ -137,6 +138,7 @@ fprintf (__fid, "# The result may be an unexpected failure (in which\n"); fprintf (__fid, "# case an error will be reported) or an unexpected\n"); fprintf (__fid, "# success (in which case no error will be reported).\n"); + fflush (__fid); if (__close_fid) fclose(__fid); endif return; else @@ -157,6 +159,7 @@ __ret2 = []; else fprintf(__fid, "%s%s does not exist in path\n", __signal_empty, __name); + fflush (__fid); if (nargout > 0) __ret1 = __ret2 = 0; endif endif if (__close_fid) fclose(__fid); endif @@ -172,6 +175,7 @@ __ret2 = []; else fprintf(__fid, "%s%s has no tests available\n", __signal_empty, __file); + fflush (__fid); if (nargout > 0) __ret1 = __ret2 = 0; endif endif if (__close_fid) fclose(__fid); endif @@ -210,6 +214,7 @@ ## let the user/logfile know what is happening if (__verbose) fprintf (__fid, "%s%s\n", __signal_block, __block); + fflush (__fid); endif ## split __block into __type and __code @@ -424,12 +429,15 @@ ## make sure the user knows what caused the error if (!__verbose) fprintf (__fid, "%s%s\n", __signal_block, __block); + fflush (__fid); endif fputs (__fid, __msg); + fflush (__fid); ## show the variable context - if !strcmp(__type, "error") && !all(__shared==" ") + if (!strcmp(__type, "error") && !all(__shared==" ")) fputs(__fid, "shared variables "); eval (sprintf("fdisp(__fid,bundle(%s));", __shared)); + fflush (__fid); endif endif if (__success == 0)