Commit 0bdf7b31 authored by Matthew Dawson's avatar Matthew Dawson
Browse files

Move the jTET loading logic to its own function.

Make it easier for the test suite to run by moving the loading logic out to
its own function.  This allows multiple entry points to the TET code to be
handled easily.
parent 7f0c9804
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
function test_results = run
%RUN Runs TET test suite
%   Runs all the tests in TET, returning the result.
TETLoadjTET

path = mfilename('fullpath');
path = [path(1:size(path, 2)-13) 'Tests'];

TETLoadjTET.m

0 → 100644
+22 −0
Original line number Diff line number Diff line
function TETLoadjTET()
%TETLOADJTET Loads jTET for use by the TET
%   This loads the jTET library into MATLAB, so TET can use it.

% First find the path.
path = mfilename('fullpath');
path = [path(1:size(path, 2)-11) 'jTET/jtet-1.0-SNAPSHOT-jar-with-dependencies.jar'];

% Verify the jar isn't already in the classpath.
classpath = javaclasspath;
exists = 0;
for i=1:size(classpath,1)
    if strcmp(classpath{i}, path) == 1
        exists = 1;
    end
end
if exists == 0
    % Not added yet, thus add it.
    javaaddpath(path);
end

end
+1 −17
Original line number Diff line number Diff line
@@ -2,23 +2,7 @@
% Organization: McMaster Centre for Software Certification
function TTdiag(varargin)
% Java needs to be loaded here.  Thus load it.

% First find the path.
path = mfilename('fullpath');
path = [path(1:size(path, 2)-6) 'jTET/jtet-1.0-SNAPSHOT-jar-with-dependencies.jar'];

% Verify the jar isn't already in the classpath.
classpath = javaclasspath;
exists = 0;
for i=1:size(classpath,1)
    if strcmp(classpath{i}, path) == 1
        exists = 1;
    end
end
if exists == 0
    % Not added yet, thus add it.
    javaaddpath(path);
end
TETLoadjTET();


orig_gcbh = gcbh;