cmake_matlab_unit_tests1.m 921 B

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