octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #65150] io.tst uses non-unique names for tmp f


From: Dmitri A. Sergatskov
Subject: [Octave-bug-tracker] [bug #65150] io.tst uses non-unique names for tmp files
Date: Thu, 11 Jan 2024 11:12:32 -0500 (EST)

Follow-up Comment #1, bug#65150 (group octave):

The proposed diff prepends the filenames with random string:

--- /usr/local/share/octave/9.0.1/etc/tests/fixed/io.tst        2024-01-10
12:01:55.775827045 -0500
+++ /home/dima/src/octave/test/io.tst   2024-01-10 21:38:01.593264717 -0500
@@ -27,9 +27,14 @@
 ## saving sparse matrices to MAT files when using 64-bit indexing since
 ## that is not implemented yet.
 
+%! ## Random prefix for file name
+%! global t_pfix
+%! t_pfix = tempname ();
+
 %!function [ret, files] = testls (input)
 %!  ## flag a1 global so as to test the storage of global flags
 %!  global a1;
+%!  global t_pfix
 %!
 %!  ## Input or output, so as to be able to exchange between versions
 %!  if (nargin < 1)
@@ -81,9 +86,7 @@
 %!
 %!  ret = 0;
 %!
-%!  files = cellfun (@fullfile, {P_tmpdir},
-%!                   {"text.mat", "binary.mat", "mat5.mat", "mat7.mat"},
-%!                   "UniformOutput", false);
+%!  files = {[t_pfix, "_text.mat"], [t_pfix, "_binary.mat"], [t_pfix,
"_mat5.mat"], [t_pfix, "_mat7.mat"]};
 %!  opts = {"-z -text", "-z -binary", "-z -mat", "-v7"};
 %!  tols = {2*eps, 0, 0, 0};
 %!
@@ -185,7 +188,7 @@
 %!  endif
 %!
 %!  ## Cleanup after test
-%!  clear -global a1;
+%!  clear -global a1 t_pfix;
 %!
 %!  ret = 1;
 %!endfunction
@@ -200,7 +203,7 @@
 %! endfor
 %!
 %! assert (save_status && load_status);
-%! clear -global a1;  # cleanup after test
+%! clear -global a1 t_pfix;  # cleanup after test
 
 %!testif HAVE_HDF5
 %!


Dmitri. 
-- 



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65150>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]