% ARTOA3 automatic test script
% This script is used by gitlab's ci feature for automated testing.
% Can also be used locally.

% disable all warnings for better overview
warning('off','all');

[currentDirectory, ~, ~] = fileparts(mfilename('fullpath'));
addpath(genpath(fullfile(currentDirectory, '..')));

testsToRun = { ...
    @tests.rfb.load, ...
    @tests.ric.save, ...
    @tests.soundsources.load, ...
    @tests.trj4.save, ...
    @tests.rfc.save, ...
    @tests.data.toaConversion, ...
    @tests.startendtoa.save ...
};

aTestFailed = 0;

for i = 1:length(testsToRun)
    exitCode = tests.runTest(testsToRun{i});
    if exitCode == 1
        aTestFailed = exitCode;
    end
end

exit(aTestFailed);