changeset 18414:68fc31c69fcb

Workaround for clear -classes and failures in 'make check' (bug #41269) Rename classes in fcn-handle-derived-resolution so they don't conflict with the same class names in ctor-vs-method. * test/fcn-handle-derived-resolution/@fhdr_derived/fhdr_derived.m: Renamed from derived.m * test/fcn-handle-derived-resolution/@fhdr_other/fhdr_other.m: renamed from other.m * test/fcn-handle-derived-resolution/@fhdr_other/getsize_arrayfun.m: Moved from @other dir. * test/fcn-handle-derived-resolution/@fhdr_other/getsize_cellfun.m: Moved from @other dir. * test/fcn-handle-derived-resolution/@fhdr_other/getsize_loop.m: Moved from @other dir. * test/fcn-handle-derived-resolution/@fhdr_parent/fhdr_parent.m: renamed from parent.m * test/fcn-handle-derived-resolution/@fhdr_parent/numel.m: Moved from @parent dir. * fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst: Call newly renamed files in %!tests. * test/fcn-handle-derived-resolution/module.mk: Add renamed files to build system.
author Rik <rik@octave.org>
date Thu, 30 Jan 2014 17:56:43 -0800
parents f8f37595c29f
children bcd71a2531d3
files test/fcn-handle-derived-resolution/@derived/derived.m test/fcn-handle-derived-resolution/@fhdr_derived/fhdr_derived.m test/fcn-handle-derived-resolution/@fhdr_other/fhdr_other.m test/fcn-handle-derived-resolution/@fhdr_other/getsize_arrayfun.m test/fcn-handle-derived-resolution/@fhdr_other/getsize_cellfun.m test/fcn-handle-derived-resolution/@fhdr_other/getsize_loop.m test/fcn-handle-derived-resolution/@fhdr_parent/fhdr_parent.m test/fcn-handle-derived-resolution/@fhdr_parent/numel.m test/fcn-handle-derived-resolution/@other/getsize_arrayfun.m test/fcn-handle-derived-resolution/@other/getsize_cellfun.m test/fcn-handle-derived-resolution/@other/getsize_loop.m test/fcn-handle-derived-resolution/@other/other.m test/fcn-handle-derived-resolution/@parent/numel.m test/fcn-handle-derived-resolution/@parent/parent.m test/fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst test/fcn-handle-derived-resolution/module.mk
diffstat 16 files changed, 56 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/test/fcn-handle-derived-resolution/@derived/derived.m	Thu Jan 30 16:11:29 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-function r = derived (n)
-  s.a = n;
-  p = parent (n);
-  r = class (s, 'derived', p);
-end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fcn-handle-derived-resolution/@fhdr_derived/fhdr_derived.m	Thu Jan 30 17:56:43 2014 -0800
@@ -0,0 +1,5 @@
+function r = fhdr_derived (n)
+  s.a = n;
+  p = fhdr_parent (n);
+  r = class (s, 'fhdr_derived', p);
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fcn-handle-derived-resolution/@fhdr_other/fhdr_other.m	Thu Jan 30 17:56:43 2014 -0800
@@ -0,0 +1,4 @@
+function r = fhdr_other (n)
+  s.d = fhdr_derived (n);
+  r = class (s, 'fhdr_other');
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fcn-handle-derived-resolution/@fhdr_other/getsize_arrayfun.m	Thu Jan 30 17:56:43 2014 -0800
@@ -0,0 +1,3 @@
+function r = getsize_arrayfun (x)
+  r = arrayfun (@(i) numel (x(i).d), 1:numel (x), 'uniformoutput', true);
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fcn-handle-derived-resolution/@fhdr_other/getsize_cellfun.m	Thu Jan 30 17:56:43 2014 -0800
@@ -0,0 +1,3 @@
+function r = getsize_cellfun (x)
+  r = cellfun (@numel, {x.d});
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fcn-handle-derived-resolution/@fhdr_other/getsize_loop.m	Thu Jan 30 17:56:43 2014 -0800
@@ -0,0 +1,7 @@
+function r = getsize_loop (x)
+  n = numel (x);
+  r = zeros (1, n);
+  for i = 1:n
+    r(i) = numel (x(i).d);
+  end
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fcn-handle-derived-resolution/@fhdr_parent/fhdr_parent.m	Thu Jan 30 17:56:43 2014 -0800
@@ -0,0 +1,4 @@
+function r = fhdr_parent (n)
+  s.a = rand (n, 1);
+  r = class (s, 'fhdr_parent');
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fcn-handle-derived-resolution/@fhdr_parent/numel.m	Thu Jan 30 17:56:43 2014 -0800
@@ -0,0 +1,3 @@
+function r = numel (x, varargin)
+  r = numel (x.a, varargin{:});
+end
--- a/test/fcn-handle-derived-resolution/@other/getsize_arrayfun.m	Thu Jan 30 16:11:29 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function r = getsize_arrayfun (x)
-  r = arrayfun (@(i) numel (x(i).d), 1:numel (x), 'uniformoutput', true);
-end
--- a/test/fcn-handle-derived-resolution/@other/getsize_cellfun.m	Thu Jan 30 16:11:29 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function r = getsize_cellfun (x)
-  r = cellfun (@numel, {x.d});
-end
--- a/test/fcn-handle-derived-resolution/@other/getsize_loop.m	Thu Jan 30 16:11:29 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-function r = getsize_loop (x)
-  n = numel (x);
-  r = zeros (1, n);
-  for i = 1:n
-    r(i) = numel (x(i).d);
-  end
-end
--- a/test/fcn-handle-derived-resolution/@other/other.m	Thu Jan 30 16:11:29 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-function r = other (n)
-  s.d = derived (n);
-  r = class (s, 'other');
-end
--- a/test/fcn-handle-derived-resolution/@parent/numel.m	Thu Jan 30 16:11:29 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function r = numel (x, varargin)
-  r = numel (x.a, varargin{:});
-end
--- a/test/fcn-handle-derived-resolution/@parent/parent.m	Thu Jan 30 16:11:29 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-function r = parent (n)
-  s.a = rand (n, 1);
-  r = class (s, 'parent');
-end
--- a/test/fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst	Thu Jan 30 16:11:29 2014 -0800
+++ b/test/fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst	Thu Jan 30 17:56:43 2014 -0800
@@ -22,38 +22,46 @@
 %%  Note: This script and all classes are also intended to run
 %%        in Matlab to test compatibility.  Don't break that!
 
-%!shared
-%! clear -classes
+%% FIXME: Can't use 'clear -classes' because it also clears all functions in the
+%% namespace of test.m (bug #35881).  This is a problem only if Octave would
+%% re-use a class definition that was defined somewhere else.  Unfortunately,
+%% that is exactly the case when running 'make check' since the ctor-vs-method
+%% test also uses an @parent, @derived, and @other class.
+%% Until the bug is fixed, it suffices to make the class names unique so that
+%% there is no re-use.  Using the prefix fhdr (fcn-handle-derived-resolution)
+%% for this directory.
+%%!shared
+%%! #clear -classes
 
 %!test
-%! p = parent (7);
+%! p = fhdr_parent (7);
 %! assert (numel (p), 7)
 
 %!test
-%! d = derived (13);
+%! d = fhdr_derived (13);
 %! assert (numel (d), 13)
 
 %!test
-%! p = parent (11);
+%! p = fhdr_parent (11);
 %! f = @numel;
 %! assert (f (p), 11)
 
 %!test
-%! d = parent (21);
+%! d = fhdr_parent (21);
 %! f = @numel;
 %! assert (f (d), 21)
 
 %!test
-%! o(1) = other (13);
-%! o(2) = other (42);
+%! o(1) = fhdr_other (13);
+%! o(2) = fhdr_other (42);
 %! assert (getsize_loop (o), [13, 42])
 
 %!test
-%! o(1) = other (13);
-%! o(2) = other (42);
+%! o(1) = fhdr_other (13);
+%! o(2) = fhdr_other (42);
 %! assert (getsize_cellfun (o), [13, 42])
 
 %!test
-%! o(1) = other (13);
-%! o(2) = other (42);
+%! o(1) = fhdr_other (13);
+%! o(2) = fhdr_other (42);
 %! assert (getsize_arrayfun (o), [13, 42])
--- a/test/fcn-handle-derived-resolution/module.mk	Thu Jan 30 16:11:29 2014 -0800
+++ b/test/fcn-handle-derived-resolution/module.mk	Thu Jan 30 17:56:43 2014 -0800
@@ -1,11 +1,11 @@
 fcn_handle_derived_resolution_FCN_FILES = \
-  fcn-handle-derived-resolution/@derived/derived.m \
-  fcn-handle-derived-resolution/@other/getsize_arrayfun.m \
-  fcn-handle-derived-resolution/@other/getsize_cellfun.m \
-  fcn-handle-derived-resolution/@other/getsize_loop.m \
-  fcn-handle-derived-resolution/@other/other.m \
-  fcn-handle-derived-resolution/@parent/numel.m \
-  fcn-handle-derived-resolution/@parent/parent.m \
+  fcn-handle-derived-resolution/@fhdr_derived/fhdr_derived.m \
+  fcn-handle-derived-resolution/@fhdr_other/getsize_arrayfun.m \
+  fcn-handle-derived-resolution/@fhdr_other/getsize_cellfun.m \
+  fcn-handle-derived-resolution/@fhdr_other/getsize_loop.m \
+  fcn-handle-derived-resolution/@fhdr_other/fhdr_other.m \
+  fcn-handle-derived-resolution/@fhdr_parent/numel.m \
+  fcn-handle-derived-resolution/@fhdr_parent/fhdr_parent.m \
   fcn-handle-derived-resolution/fcn-handle-derived-resolution.tst
 
 FCN_FILES += $(fcn_handle_derived_resolution_FCN_FILES)