1
2classdef cmake_matlab_unit_tests1 < matlab.unittest.TestCase
3  % some simple unit test for CMake Matlab wrapper
4  properties
5  end
6
7  methods (Test)
8    function testDummyCall(testCase)
9      % very simple call test
10      cmake_matlab_mex1(rand(3,3));
11    end
12
13    function testDummyCall2(testCase)
14      % very simple call test 2
15      ret = cmake_matlab_mex1(rand(3,3));
16      testCase.verifyEqual(size(ret), size(rand(3,3)));
17
18      testCase.verifyEqual(size(cmake_matlab_mex1(rand(4,3))), [4,3] );
19    end
20
21    function testFailTest(testCase)
22      testCase.verifyError(@() cmake_matlab_mex1(10), 'cmake_matlab:configuration');
23      testCase.verifyError(@() cmake_matlab_mex1([10]), 'cmake_matlab:configuration');
24    end
25
26    function testHelpContent(testCase)
27      % testing the help feature
28      testCase.verifySubstring(evalc('help cmake_matlab_mex1'), 'Dummy matlab extension in cmake');
29    end
30
31
32  end
33end
34