Home > functions > internal > unit-test > dsUnitTest_autogen_query.m

dsUnitTest_autogen_query

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 classdef dsUnitTest_autogen_query < matlab.unittest.TestCase
0002   properties
0003     unitTestDataPath = dsGetConfig('ds_unitTestData_path');
0004   end
0005   
0006   properties (TestParameter)
0007     dataFileName = dsUnitGetAutogenFiles(false, true);
0008   end
0009   
0010   methods (Test,  TestTags = {'autogen', 'query'})
0011     function testCellIn(testCase, dataFileName)
0012       args = load(fullfile(testCase.unitTestDataPath, 'autogen', dataFileName));
0013       expectedOut = args.argout;
0014       
0015       [~,filename] = fileparts2(dataFileName);
0016       fnName = strsplit(filename,'_autogen_');
0017       
0018       % TODO: handle localfunctions from query
0019       
0020       fh = str2func(fnName{1});
0021       
0022       [testOut{1:length(expectedOut)}] = feval(fh, args.argin{:});
0023       
0024       for ind = 1:length(expectedOut)
0025         testCase.verifyEqual(testOut{ind}, expectedOut{ind});
0026       end
0027       
0028     end
0029   end
0030   
0031 end

Generated on Tue 12-Dec-2017 11:32:10 by m2html © 2005