Skip to content

Commit 786811c

Browse files
committed
test:octave: only if pkg exists
1 parent 9d04673 commit 786811c

File tree

10 files changed

+20
-0
lines changed

10 files changed

+20
-0
lines changed

+stdlib/h5exists.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
end
2929

3030
%!test
31+
%! if !isempty(pkg('list', 'hdf5oct'))
3132
%! pkg load hdf5oct
3233
%! fn = tempname();
3334
%! ds = '/a';
3435
%! h5create(fn, ds, [1])
3536
%! assert(h5exists(fn, ds))
3637
%! assert(!h5exists(fn, '/b'))
3738
%! delete(fn)
39+
%! endif

+stdlib/h5save_exist.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function h5save_exist(filename, varname, A, sizeA)
3232
end
3333

3434
%!test
35+
%! if !isempty(pkg('list', 'hdf5oct'))
3536
%! pkg load hdf5oct
3637
%! fn = tempname();
3738
%! ds = '/a';
@@ -41,3 +42,4 @@ function h5save_exist(filename, varname, A, sizeA)
4142
%! h5save_exist(fn, ds, b, size(b))
4243
%! assert(h5read(fn, ds), b)
4344
%! delete(fn)
45+
%! endif

+stdlib/h5save_new.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ function h5save_new(filename, varname, A, sizeA, compressLevel)
3131
end
3232

3333
%!test
34+
%! if !isempty(pkg('list', 'hdf5oct'))
3435
%! pkg load hdf5oct
3536
%! fn = tempname();
3637
%! ds = '/a';
3738
%! a = [1,2];
3839
%! h5save_new(fn, ds, a, size(a), 0)
3940
%! assert(h5read(fn, ds), a)
4041
%! delete(fn)
42+
%! endif

+stdlib/h5size.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424

2525

2626
%!test
27+
%! if !isempty(pkg('list', 'hdf5oct'))
2728
%! pkg load hdf5oct
2829
%! fn = tempname();
2930
%! ds = '/a';
3031
%! a = [1,2];
3132
%! h5save_new(fn, ds, a, size(a), 0)
3233
%! assert(h5size(fn, ds), uint64([1,2]))
3334
%! delete(fn)
35+
%! endif

+stdlib/h5variables.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636

3737

3838
%!test
39+
%! if !isempty(pkg('list', 'hdf5oct'))
3940
%! pkg load hdf5oct
4041
%! fn = tempname();
4142
%! ds = '/a';
4243
%! h5create(fn, ds, [1])
4344
%! assert(h5variables(fn, ''), {'/a'})
4445
%! delete(fn)
46+
%! endif

+stdlib/ncexists.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030

3131

3232
%!test
33+
%! if !isempty(pkg('list', 'netcdf'))
3334
%! pkg load netcdf
3435
%! fn = tempname();
3536
%! ds = 'a';
3637
%! nccreate(fn, ds)
3738
%! assert(ncexists(fn, ds))
3839
%! assert(!ncexists(fn, 'b'))
3940
%! delete(fn)
41+
%! endif

+stdlib/ncsave_exist.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ function ncsave_exist(filename, varname, A, sizeA)
1616
end
1717

1818
%!test
19+
%! if !isempty(pkg('list', 'netcdf'))
1920
%! pkg load netcdf
2021
%! fn = tempname();
2122
%! ds = 'a';
@@ -25,3 +26,4 @@ function ncsave_exist(filename, varname, A, sizeA)
2526
%! ncsave_exist(fn, ds, b, size(b))
2627
%! assert(ncread(fn, ds), b)
2728
%! delete(fn)
29+
%! endif

+stdlib/ncsave_new.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ function ncsave_new(file, varname, A, sizeA, ncdims, compressLevel)
2222
end
2323

2424
%!test
25+
%! if !isempty(pkg('list', 'netcdf'))
2526
%! pkg load netcdf
2627
%! fn = tempname();
2728
%! ds = 'a';
2829
%! a = [1,2];
2930
%! ncsave_new(fn, ds, a, size(a), {"x", 1, "y", 2}, 0)
3031
%! assert(ncread(fn, ds), a)
3132
%! delete(fn)
33+
%! endif

+stdlib/ncsize.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@
2323
end
2424

2525
%!test
26+
%! if !isempty(pkg('list', 'netcdf'))
2627
%! pkg load netcdf
2728
%! fn = tempname();
2829
%! nccreate(fn, 'a')
2930
%! assert(ncsize(fn, 'a'), [])
3031
%! nccreate(fn, 'b', 'Dimensions', {'x', 2, 'y', 3})
3132
%! assert(ncsize(fn, 'b'), [2, 3])
3233
%! delete(fn)
34+
%! endif

+stdlib/ncvariables.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@
3838

3939

4040
%!test
41+
%! if !isempty(pkg('list', 'netcdf'))
4142
%! pkg load netcdf
4243
%! fn = tempname();
4344
%! ds = 'a';
4445
%! nccreate(fn, ds)
4546
%! assert(ncvariables(fn, ''), {'a'})
4647
%! delete(fn)
48+
%! endif

0 commit comments

Comments
 (0)