Hoffice push
This commit is contained in:
23
Tests/createTestFile.m
Normal file
23
Tests/createTestFile.m
Normal file
@@ -0,0 +1,23 @@
|
||||
function createTestFile(className, testFilePath)
|
||||
% Open the file for writing
|
||||
fid = fopen(testFilePath, 'w');
|
||||
|
||||
% Write the basic structure for the test class
|
||||
fprintf(fid, 'classdef %s_test < matlab.unittest.TestCase\n', className);
|
||||
fprintf(fid, ' %% Test class for %s\n\n', className);
|
||||
|
||||
fprintf(fid, ' methods (Test)\n');
|
||||
fprintf(fid, ' function testExample(testCase)\n');
|
||||
fprintf(fid, ' %% Example test case for %s\n', className);
|
||||
fprintf(fid, ' %% Add your test code here\n');
|
||||
fprintf(fid, ' testCase.verifyTrue(true);\n');
|
||||
fprintf(fid, ' end\n');
|
||||
fprintf(fid, ' end\n');
|
||||
|
||||
fprintf(fid, 'end\n');
|
||||
|
||||
% Close the file
|
||||
fclose(fid);
|
||||
|
||||
fprintf('Created test file: %s\n', testFilePath);
|
||||
end
|
||||
Reference in New Issue
Block a user