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

dsUnitSaveAutoGenTestData

PURPOSE ^

Inputs:

SYNOPSIS ^

function dsUnitSaveAutoGenTestData(argin, argout, localFn_flag)

DESCRIPTION ^

 Inputs:
   argin: cell array with input arguments
   argout: cell array with output arguments
   localFn_flag: logical of whether to include 'fn1__fn2' in fnName or 'fn1'

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function dsUnitSaveAutoGenTestData(argin, argout, localFn_flag)
0002 % Inputs:
0003 %   argin: cell array with input arguments
0004 %   argout: cell array with output arguments
0005 %   localFn_flag: logical of whether to include 'fn1__fn2' in fnName or 'fn1'
0006 
0007 if ~exist('localFn_flag','var')
0008   localFn_flag = false;
0009 end
0010 
0011 % get fn name from stack
0012 stack = dbstack;
0013 if ~localFn_flag
0014   fnNameStack = stack(2).name;
0015   fnName = fnNameStack;
0016 else
0017   fnNameStack = stack(4).name;
0018   fnName = [fnNameStack '__' stack(3).name];
0019 end
0020 
0021 hash = DataHash(argin);
0022 
0023 testFileName = sprintf('%s_autogen_%s.mat', fnName, hash);
0024 testFileDir = fullfile(dsGetConfig('ds_unitTestData_path'), 'autogen_newSave');
0025 mkdirSilent(testFileDir);
0026 testFilePath = fullfile(testFileDir, testFileName);
0027 save(testFilePath, 'argin', 'argout')
0028 
0029 end

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