[Pkg-octave-commit] [octave-parallel] 01/02: d/check.m: Check the parcellfun function

Rafael Laboissière rlaboiss-guest at moszumanska.debian.org
Sun Aug 14 11:44:47 UTC 2016


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

rlaboiss-guest pushed a commit to branch master
in repository octave-parallel.

commit e86a91f7dd8d90434be8d9149c9b028034df7daa
Author: Rafael Laboissiere <rafael at debian.org>
Date:   Sun Aug 14 06:32:21 2016 -0300

    d/check.m: Check the parcellfun function
    
    The previous d/check.m file (which was renamed check.m.disabled in
    commit d33fa24) worked for versions previous to 3.0.0 of the parallel
    package. The API was changed in version 3.0.0.  Indeed, in d/check.m
    there was a call to the "connect" function, which has been renamed
    "pconnect".
    
    This commit reintroduces the d/check.m file and replace the old code
    that exercised pserver/connect/send/recv by a simple test of the
    parcellfun function (BTW, this is related to Bug#832415).  More unit
    tests will hopefully be added in the future.
    
    Closes: 737756
---
 debian/check.m          | 12 ++++++++++++
 debian/check.m.disabled | 43 -------------------------------------------
 2 files changed, 12 insertions(+), 43 deletions(-)

diff --git a/debian/check.m b/debian/check.m
new file mode 100644
index 0000000..9f87fa9
--- /dev/null
+++ b/debian/check.m
@@ -0,0 +1,12 @@
+disp ("[parcellfun]");
+
+### Assert result
+try
+    assert (parcellfun (1, @(x) x ^ 2, {1, 2, 3}),
+            [1, 4, 9]);
+    count = 1;
+catch
+    count = 0;
+end_try_catch
+
+disp (sprintf ("PASSES %d out of 1 test", count));
diff --git a/debian/check.m.disabled b/debian/check.m.disabled
deleted file mode 100644
index a50956a..0000000
--- a/debian/check.m.disabled
+++ /dev/null
@@ -1,43 +0,0 @@
-### The example below is adapted from file doc/README.parallel
-
-### In the following script, the variable s="Hello, again!" passes
-### through the the same computer.  Two octave processes in the same
-### computer emulate the presence of two separate servers.
-
-disp ("[Hello, again!]");
-
-### Launches a server as another process in the same system
-cmd = sprintf ("%s%s",
-               "addpath (genpath ([pwd(),\"/debian\"]));",
-               "source inst/server.m;");
-
-[status, out] = system (sprintf ("echo '%s' | octave -q", cmd));
-
-### Connect all the "servers"
-hosts = [ "127.0.0.1"; "127.0.0.1" ];
-sockets = connect (hosts);
-
-### Pass the string through the servers
-s1 = "Hello, again!";
-send (s1, sockets (2, :));
-reval ("s = recv (sockets (1, :));", sockets (2, :));
-reval ("send (s, sockets (1, :));", sockets (2, :));
-s2 = recv (sockets (2, :));
-
-### Close connections
-scloseall (sockets);
-
-### Kill server process
-system (sprintf ("kill -9 $(cat %s)", out));
-system (sprintf ("rm %s", out));
-
-### Assert result
-try
-    assert (s2, s1);
-    count = 1;
-catch
-    count = 0;
-end_try_catch
-
-disp (sprintf ("PASSES %d out of 1 test", count));
-

-- 
Alioth's /home/groups/pkg-octave/bin/git-commit-notice on /srv/git.debian.org/git/pkg-octave/octave-parallel.git



More information about the Pkg-octave-commit mailing list