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

Re: Adding dependencies for Debian CI autopkgtest



Hi Oliver,

* Oliver Heimlich <oheim@posteo.de> [2018-08-26 02:45]:

However, the unit tests should probably be modified upstream and only be run if the needed other package is available. Since there is no strong dependency declared upstream, one cannot assume that other packages are available.

Could you please tell me whether the attached patch would be appropriate for the vibes package?

Rafael
Description: Skip unit tests in drawBox.m is package interval is not available
Author: Rafael Laboissiere <rafael@debian.org>
Forwarded: no
Last-Update: 2018-08-26

--- octave-vibes-0.2.0.orig/inst/+vibes/drawBox.m
+++ octave-vibes-0.2.0/inst/+vibes/drawBox.m
@@ -83,34 +83,40 @@ endfunction
 %!shared
 %! vibes.endDrawing
 
-%!shared ix,iy,iz,dx,dy,dz,rx,ry,rz
-%! pkg load interval
-%! vibes.beginDrawing
-%! x = [ 0  2 ; ...
-%!       7 22 ];
-%! y = [ 1 2 3 4 ; ...
-%!       2 3 4 5 ];
-%! z = [ 1 2 ; ...
-%!       3 4 ; ...
-%!       5 6 ; ...
-%!       7 8 ];
-%! ix = infsup (x)
-%! iy = infsup (y)
-%! iz = infsup (z)
-%! dx = infsupdec (x)
-%! dy = infsupdec (y)
-%! dz = infsupdec (z)
-%! rx = infsup (x, x + 100)
-%! ry = infsup (y, y + 100)
-%! rz = infsup (z, z + 100)
-%!test vibes.drawBox (ix)
-%!test vibes.drawBox (iy)
-%!test vibes.drawBox (iz)
-%!test vibes.drawBox (dx)
-%!test vibes.drawBox (dy)
-%!test vibes.drawBox (dz)
-%!test vibes.drawBox (rx)
-%!test vibes.drawBox (ry)
-%!test vibes.drawBox (rz)
-%!shared
-%! vibes.endDrawing
+%!shared ix,iy,iz,dx,dy,dz,rx,ry,rz,run_tests
+%! try
+%!     pkg load interval
+%!     run_tests = 1;
+%!     vibes.beginDrawing
+%!     x = [ 0  2 ; ...
+%!           7 22 ];
+%!     y = [ 1 2 3 4 ; ...
+%!           2 3 4 5 ];
+%!     z = [ 1 2 ; ...
+%!           3 4 ; ...
+%!           5 6 ; ...
+%!           7 8 ];
+%!     ix = infsup (x)
+%!     iy = infsup (y)
+%!     iz = infsup (z)
+%!     dx = infsupdec (x)
+%!     dy = infsupdec (y)
+%!     dz = infsupdec (z)
+%!     rx = infsup (x, x + 100)
+%!     ry = infsup (y, y + 100)
+%!     rz = infsup (z, z + 100)
+%! catch
+%!     warning ("Package interval is not available.  Unit tests will be skipped.")
+%!     run_tests = 0;
+%! end_try_catch
+%!test if run_tests, vibes.drawBox (ix); endif
+%!test if run_tests, vibes.drawBox (iy); endif
+%!test if run_tests, vibes.drawBox (iz); endif
+%!test if run_tests, vibes.drawBox (dx); endif
+%!test if run_tests, vibes.drawBox (dy); endif
+%!test if run_tests, vibes.drawBox (dz); endif
+%!test if run_tests, vibes.drawBox (rx); endif
+%!test if run_tests, vibes.drawBox (ry); endif
+%!test if run_tests, vibes.drawBox (rz); endif
+%!shared run_tests
+%! if run_tests, vibes.endDrawing; endif

Reply to: