[freemat] 01/04: Restore missing files, enable diff() and hist() tests

Graham Inggs ginggs at moszumanska.debian.org
Wed Jun 7 20:45:11 UTC 2017


This is an automated email from the git hooks/post-receive script.

ginggs pushed a commit to branch master
in repository freemat.

commit 0b8cf010e3f58afe222a36b644c896d77ed945e6
Author: Graham Inggs <ginggs at debian.org>
Date:   Wed Jun 7 22:36:47 2017 +0200

    Restore missing files, enable diff() and hist() tests
---
 debian/copyright                           |   2 +-
 debian/patches/restore-missing-files.patch | 235 +++++++++++++++++++++++++++++
 debian/patches/series                      |   1 +
 debian/patches/skip-failing-tests2.patch   |  32 +---
 4 files changed, 240 insertions(+), 30 deletions(-)

diff --git a/debian/copyright b/debian/copyright
index 8c25f8d..0270928 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -2,7 +2,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: FreeMat
 Source: http://freemat.sourceforge.net/
 Upstream-Contact: Samit Basu <samitbasu at users.sourceforge.net>
-Files-Excluded: toolbox/tests doc help/help.zip help/latex/*.pdf help/html/*.ttf help/xml help/latex/FreeSans.ttf help/html/jquery.js toolbox/general
+Files-Excluded: toolbox/tests/reference doc help/help.zip help/latex/*.pdf help/html/*.ttf help/xml help/latex/FreeSans.ttf help/html/jquery.js
 
 Files: *
 Copyright: 2008 Samit Basu <samitbasu at users.sourceforge.net>
diff --git a/debian/patches/restore-missing-files.patch b/debian/patches/restore-missing-files.patch
new file mode 100644
index 0000000..04f98ca
--- /dev/null
+++ b/debian/patches/restore-missing-files.patch
@@ -0,0 +1,235 @@
+Description: Restore files missing from DFSG tarball
+Bug-Debian: https://bugs.debian.org/864364
+Forwarded: not-needed
+Author: Graham Inggs <ginggs at debian.org>
+Last-Update: 2017-06-07
+--- /dev/null
++++ b/toolbox/general/diff.m
+@@ -0,0 +1,148 @@
++% DIFF DIFF Difference Function
++%
++% Usage
++%
++%
++% 	y=diff(x)
++% 	y=diff(x,k)
++% 	y=diff(x,k,dim)
++%
++%  Produce difference of successive vector elements.
++%
++%  If x is a vector of length n, diff (x) is the
++%  vector of first differences
++%  \[
++%   [x_2 - x_1, ..., x_n - x_{n-1}].
++%  \]
++%
++%  If x is a matrix, diff (x) is the matrix of column
++%  differences along the first non-singleton dimension.
++%
++%  The second argument is optional.  If supplied, diff (x,k),
++%  where k is a nonnegative integer, returns the
++%  k-th differences. It is possible that k is larger than
++%  then first non-singleton dimension of the matrix. In this case,
++%  diff continues to take the differences along the next
++%  non-singleton dimension.
++%
++%  The dimension along which to take the difference can be explicitly
++%  stated with the optional variable dim. In this case the
++%  k-th order differences are calculated along this dimension.
++%  In the case where k exceeds size (x, dim)
++%  then an empty matrix is returned.
++%
++
++% Copyright (C) 1995, 1996, 1999, 2000, 2002, 2004, 2005, 2006, 2007
++%               Kurt Hornik
++%%
++%% Copyright (C) 2008 Samit Basu, Eugene Ingerman
++%%
++%% This file is adopted in FreeMat from Octave under the conditions of the GNU
++%% General Public License
++%
++%
++% Octave is free software; you can redistribute it and/or modify it
++% under the terms of the GNU General Public License as published by
++% the Free Software Foundation; either version 3 of the License, or (at
++% your option) any later version.
++%
++% Octave is distributed in the hope that it will be useful, but
++% WITHOUT ANY WARRANTY; without even the implied warranty of
++% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++% General Public License for more details.
++%
++% You should have received a copy of the GNU General Public License
++% along with Octave; see the file COPYING.  If not, see
++% <http://www.gnu.org/licenses/>.
++
++% Author: KH <Kurt.Hornik at wu-wien.ac.at>
++% Created: 2 February 1995
++% Adapted-By: jwe
++
++function x = diff (x, k, dim)
++
++  if (nargin < 1 || nargin > 3)
++    error('incorrect number of parameters');
++  end
++
++  if (nargin < 2 || isempty(k))
++    k = 1;
++  else
++    if ( ~ (isscalar (k) && k == round (k) && k >= 0))
++      error ('diff: k must be a nonnegative integer');
++    elseif (k == 0)
++      return;
++    end
++  end
++
++  nd = ndims (x);
++  sz = size (x);
++  if (nargin ~= 3)
++    %% Find the first non-singleton dimension
++    dim  = 1;
++    while (dim < nd + 1 && sz (dim) == 1)
++      dim = dim + 1;
++    end
++    if (dim > nd)
++      dim = 1;
++    end
++  else
++    if (~ (isscalar (dim) && dim == round (dim)) && dim > 0 && dim < (nd + 1))
++      error ('diff: dim must be an integer and valid dimension');
++    end
++  end
++
++%  if (ischar (x))
++%    error ('diff: symbolic differentiation not (yet) supported');
++%  end
++
++
++  if (nargin == 3)
++    if (sz (dim) <= k)
++      sz(dim) = 0;
++      if (isa(x,'single'))
++        x = zeros (sz,'single');
++      else
++        x = zeros(sz);
++      end
++    else
++      n = sz (dim);
++      idx1 = cell ();
++      for i = 1:nd
++		idx1{i} = 1:sz(i);
++      end
++      idx2 = idx1;
++      for i = 1 : k;
++		idx1{dim} = 2 : (n - i + 1);
++		idx2{dim} = 1 : (n - i);
++		x = x(idx1{:}) - x(idx2{:});
++      end
++    end
++  else
++    if (sum (sz - 1) < k)
++      if (isa(x,'single'))
++        x = single([]);
++      else
++        x = [];
++      end;
++    else
++      idx1 = cell ();
++      for i = 1:nd
++		idx1{i} = 1:sz(i);
++      end
++      idx2 = idx1;
++      while (k)
++		n = sz (dim);
++		for i = 1 : min (k, n - 1)
++		  idx1{dim} = 2 : (n - i + 1);
++		  idx2{dim} = 1 : (n - i);
++		  x = x(idx1{:}) - x(idx2{:});
++		end
++		idx1{dim} = 1;
++		idx2{dim} = 1;
++		k = k - min (k, n - 1);
++		dim = dim + 1;
++      end
++    end
++  end
++
+--- /dev/null
++++ b/toolbox/tests/run_tests.m
+@@ -0,0 +1,76 @@
++%
++% Function run_tests
++%
++%  Runs the complete set of tests for FreeMat
++%  This file is autogenerated by helpgen (the help compiler)
++%  Any changes will be lost!
++
++% Copyright (c) 2002-2007 Samit Basu
++% Licensed under the GPL
++
++function run_tests
++   run_path = pwd;
++   myloc = which('run_tests');
++   [pth,name,sfx] = fileparts(myloc);
++   cd(pth);
++   testlist = tlist(pth,{});
++   exclude_list = {'bbtest_csvread','bbtest_source','bbtest_import'};
++   spath = getpath;
++   failed = {};
++   quiet quiet;
++   for i=1:numel(testlist);
++     cd(run_path);
++     save run_tests.dat run_path testlist failed spath
++     printf('Running test %s...',testlist{i}(1:end-2));
++     if (~any(strcmp(testlist{i}(1:end-2),exclude_list)))
++       [testpath,testname] = fileparts(testlist{i});
++       cd(testpath)
++       success = eval(testname,'0');
++     else
++       success = 1;
++     end
++     cd(run_path);
++     load run_tests.dat
++     delete run_tests.dat
++     setpath(spath);
++     if (isempty(success) || ~success) failed = [failed,testlist(i)]; end;
++     if (isempty(success) || ~success)
++        printf('failed!\n');
++     else
++        printf('success\n');
++     end
++     close all
++   end
++   printf('****************************************\n');
++   printf('*  Test Summary                        *\n');
++   printf('****************************************\n');
++   printf('\n');
++   printf('Number of tests: %d\n',numel(testlist));
++   if (numel(failed) == 0)
++     printf('*** ALL TESTS PASSED ***\n');
++   else
++     printf('Failed tests: %d\n',numel(failed));
++     for i=1:numel(failed)
++        printf('   Test %s failed\n',failed{i});
++     end
++   end
++   quiet normal;
++
++
++function olist = tlist(root,ilist)
++  olist = ilist;
++  q = dir(root);
++  for i=1:numel(q)
++    if (q(i).isdir)
++      if (q(i).name(1) ~= '.' && ~strcmp(q(i).name,'class') && ~strcmp(q(i).name,'suite'))
++        printf('Dir name %s\n',q(i).name);
++        olist = [olist,tlist([root,dirsep,q(i).name],{})];
++      end
++    else
++      if (regexp(q(i).name,'^test_.*\.m$') || ...
++	  regexp(q(i).name,'^wbtest_.*\.m$') ||  ...
++	  regexp(q(i).name,'^bbtest_.*\.m$'))
++	olist = [olist,[root,dirsep,q(i).name]];
++      end
++    end
++  end
diff --git a/debian/patches/series b/debian/patches/series
index ea46f1a..9d9e111 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ disable_llvm.patch
 skip-failing-tests1.patch
 skip-failing-tests2.patch
 skip-failing-tests3.patch
+restore-missing-files.patch
diff --git a/debian/patches/skip-failing-tests2.patch b/debian/patches/skip-failing-tests2.patch
index db671fb..e1f7e6f 100644
--- a/debian/patches/skip-failing-tests2.patch
+++ b/debian/patches/skip-failing-tests2.patch
@@ -1,12 +1,10 @@
 Description: Skip failing tests 2
  The following tests fail locally on amd64:
- wbtest_csvread_*, wbtest_diff_*, wbtest_dec2bin_1, wbtest_hist_1,
- wbtest_typerules_2, wbtest_typerules_3, wbtest_i_1
- At least wbtest_diff_* and wbtest_hist_1 failures are due to
- an undefined diff() function.
+ wbtest_csvread_*, wbtest_dec2bin_1, wbtest_typerules_2,
+ wbtest_typerules_3, wbtest_i_1
 Forwarded: no
 Author: Graham Inggs <ginggs at debian.org>
-Last-Update: 2017-06-03
+Last-Update: 2017-06-07
 --- a/tests/io/CMakeLists.txt
 +++ b/tests/io/CMakeLists.txt
 @@ -1,7 +1,7 @@
@@ -20,21 +18,6 @@ Last-Update: 2017-06-03
  ADD_TEST(wbtest_csvwrite_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/io" "-f" "wb_test('@$exact#csvwrite(''test_csvwrite.csv'',[1,2,3;5,6,7]);y1=csvread(''test_csvwrite.csv'')','wbtest_csvwrite_1','${CMAKE_SOURCE_DIR}/tests/reference')")
  ADD_TEST(wbtest_str2num_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/io" "-f" "wb_test('@$exact#y1=str2num(x1)','wbtest_str2num_1','${CMAKE_SOURCE_DIR}/tests/reference')")
  ADD_TEST(test_imwrite_imread ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/io" "-f" "wrap_test('test_imwrite_imread')")
---- a/tests/elementary/CMakeLists.txt
-+++ b/tests/elementary/CMakeLists.txt
-@@ -16,9 +16,9 @@
- ADD_TEST(wbtest_any_3 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$exact#y1=any(x1,1)','wbtest_any_3','${CMAKE_SOURCE_DIR}/tests/reference')")
- ADD_TEST(wbtest_deal_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$exact#y1=deal(x1{:})','wbtest_deal_1','${CMAKE_SOURCE_DIR}/tests/reference')")
- ADD_TEST(wbtest_deal_2 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$exact#[y1,y2]=deal(x1{:})','wbtest_deal_2','${CMAKE_SOURCE_DIR}/tests/reference')")
--ADD_TEST(wbtest_diff_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$exact#y1=diff(x1)','wbtest_diff_1','${CMAKE_SOURCE_DIR}/tests/reference')")
--ADD_TEST(wbtest_diff_2 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$exact#y1=diff(x1,2)','wbtest_diff_2','${CMAKE_SOURCE_DIR}/tests/reference')")
--ADD_TEST(wbtest_diff_3 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$exact#y1=diff(x1,2,2)','wbtest_diff_3','${CMAKE_SOURCE_DIR}/tests/reference')")
-+#ADD_TEST(wbtest_diff_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$exact#y1=diff(x1)','wbtest_diff_1','${CMAKE_SOURCE_DIR}/tests/reference')")
-+#ADD_TEST(wbtest_diff_2 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$exact#y1=diff(x1,2)','wbtest_diff_2','${CMAKE_SOURCE_DIR}/tests/reference')")
-+#ADD_TEST(wbtest_diff_3 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$exact#y1=diff(x1,2,2)','wbtest_diff_3','${CMAKE_SOURCE_DIR}/tests/reference')")
- ADD_TEST(wbtest_std_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$near#y1=std(x1)','wbtest_std_1','${CMAKE_SOURCE_DIR}/tests/reference')")
- ADD_TEST(wbtest_std_2 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$near#y1=std(x1,2)','wbtest_std_2','${CMAKE_SOURCE_DIR}/tests/reference')")
- ADD_TEST(wbtest_max_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/elementary" "-f" "wb_test('@$exact#y1=max(x1)','wbtest_max_1','${CMAKE_SOURCE_DIR}/tests/reference')")
 --- a/tests/typecast/CMakeLists.txt
 +++ b/tests/typecast/CMakeLists.txt
 @@ -14,7 +14,7 @@
@@ -46,15 +29,6 @@ Last-Update: 2017-06-03
  ADD_TEST(wbtest_logical_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/typecast" "-f" "wb_test('@$exact#y1=logical(x1)','wbtest_logical_1','${CMAKE_SOURCE_DIR}/tests/reference')")
  ADD_TEST(wbtest_string_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/typecast" "-f" "wb_test('@$exact#y1=string(x1)','wbtest_string_1','${CMAKE_SOURCE_DIR}/tests/reference')")
  ADD_TEST(wbtest_uint8_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/typecast" "-f" "wb_test('@$exact#y1=uint8(x1)','wbtest_uint8_1','${CMAKE_SOURCE_DIR}/tests/reference')")
---- a/tests/handle/CMakeLists.txt
-+++ b/tests/handle/CMakeLists.txt
-@@ -1,5 +1,5 @@
- ENABLE_TESTING()
--ADD_TEST(wbtest_hist_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/handle" "-f" "wb_test('@$exact#y1=hist(linspace(1,100),3)','wbtest_hist_1','${CMAKE_SOURCE_DIR}/tests/reference')")
-+#ADD_TEST(wbtest_hist_1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/handle" "-f" "wb_test('@$exact#y1=hist(linspace(1,100),3)','wbtest_hist_1','${CMAKE_SOURCE_DIR}/tests/reference')")
- ADD_TEST(test_plot1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/handle" "-f" "wrap_test('test_plot1')")
- ADD_TEST(test_image1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/handle" "-f" "wrap_test('test_image1')")
- ADD_TEST(test_contour1 ${FreeMat_Loc} "-e" "-nogui" "-t" "-nogreet" "-p" "${CMAKE_SOURCE_DIR}/tests/handle" "-f" "wrap_test('test_contour1')")
 --- a/tests/operators/CMakeLists.txt
 +++ b/tests/operators/CMakeLists.txt
 @@ -9,8 +9,8 @@

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/freemat.git



More information about the debian-science-commits mailing list