[Pkg-octave-commit] [SCM] Debian packaging for octave-parallel branch, master, updated. 58e2a762dd8f93562ee39fcc41308cc4b1911913

Rafael Laboissiere rafael at laboissiere.net
Sat Mar 24 18:02:51 UTC 2012


The following commit has been merged in the master branch:
commit 9e27c2d8915d8da74952bc163ffbb0bb52b964d0
Author: Rafael Laboissiere <rafael at laboissiere.net>
Date:   Sat Mar 24 15:15:32 2012 +0100

    debian/check.m: Add file for unit testing

diff --git a/debian/check.m b/debian/check.m
new file mode 100644
index 0000000..bc212a1
--- /dev/null
+++ b/debian/check.m
@@ -0,0 +1,35 @@
+### 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
+system ("octave -q inst/server.m");
+
+### 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);
+
+### Assert result
+try
+    assert (s2, s1);
+    count = 1;
+catch
+    count = 0;
+end_try_catch
+
+disp (sprintf ("PASSES %d out of 1 test", count));
+

-- 
Debian packaging for octave-parallel



More information about the Pkg-octave-commit mailing list