Completed Preliminary MATLAB Test Scripts
This commit is contained in:
39
TestScripts/MATLAB Tests/tests.m
Normal file
39
TestScripts/MATLAB Tests/tests.m
Normal file
@@ -0,0 +1,39 @@
|
||||
testsPassed=0;
|
||||
testsFailed=0;
|
||||
if ismac()
|
||||
os = 'Mac';
|
||||
elseif ispc()
|
||||
os = 'Win';
|
||||
else
|
||||
os = 'Linux';
|
||||
end
|
||||
|
||||
disp(['XPC Tests-MATLAB (', os, ')']);
|
||||
|
||||
theTests = {{@openCloseTest, 'Open/Close Test', 0},...
|
||||
{@sendReadTest,'Send/Read Test', 0},...
|
||||
{@requestDREFTest,'Request DREF Test', 0},...
|
||||
{@sendDREFTest,'Send DREF Test', 0},...
|
||||
{@DATATest,'DATA Test', 0},...
|
||||
{@CTRLTest,'CTRL Test', 0},...
|
||||
{@POSITest,'POSI Test', 0},...
|
||||
{@pauseTest,'Pause Test', 0},...
|
||||
{@struTest,'Struct Test', 0}};
|
||||
|
||||
for i=1:length(theTests)
|
||||
fprintf(['Test ',num2str(i),': ',theTests{i}{2},' - ']);
|
||||
try
|
||||
theTests{i}{1}();
|
||||
disp('SUCCESS');
|
||||
theTests{i}{3} = 1;
|
||||
testsPassed = testsPassed+1;
|
||||
catch err
|
||||
disp('FAILURE');
|
||||
fprintf('\t%s\n',err.message);
|
||||
theTests{i}{3} = -1;
|
||||
testsFailed = testsFailed + 1;
|
||||
end
|
||||
end
|
||||
|
||||
disp('Results Summary:');
|
||||
fprintf('Passed: %i\tFailed: %i\n',testsPassed, testsFailed);
|
||||
Reference in New Issue
Block a user