CMake/Tests/FindMatlab/cmake_matlab_unit_tests1.m
Raffi Enficiaud 49c8dcf7bb FindMatlab: Rewrite module and provide a usage API
Implement a brand new FindMatlab module:

- Add support for versions and components.
- Find Matlab and its version in a more precise and multiplatform way.
- Add API to create a new mex extension with documentation.
- Add API to add matlab unit tests (with or without the unit test framework).
- Find as much as possible based on a single Matlab_ROOT_DIR cache entry
  and allow the user to change it to re-find everything.
2015-03-17 09:47:04 -04:00

34 lines
921 B
Matlab

classdef cmake_matlab_unit_tests1 < matlab.unittest.TestCase
% some simple unit test for CMake Matlab wrapper
properties
end
methods (Test)
function testDummyCall(testCase)
% very simple call test
cmake_matlab_mex1(rand(3,3));
end
function testDummyCall2(testCase)
% very simple call test 2
ret = cmake_matlab_mex1(rand(3,3));
testCase.verifyEqual(size(ret), size(rand(3,3)));
testCase.verifyEqual(size(cmake_matlab_mex1(rand(4,3))), [4,3] );
end
function testFailTest(testCase)
testCase.verifyError(@() cmake_matlab_mex1(10), 'cmake_matlab:configuration');
testCase.verifyError(@() cmake_matlab_mex1([10]), 'cmake_matlab:configuration');
end
function testHelpContent(testCase)
% testing the help feature
testCase.verifySubstring(evalc('help cmake_matlab_mex1'), 'Dummy matlab extension in cmake');
end
end
end