Commit 6de8a6eb authored by Matthew Dawson's avatar Matthew Dawson
Browse files

Start work on proper TET -> jTET converter.

Put in the first step of the TET -> jTET converter (giving the table a name).

Also start a test framework using the new MATLAB test framework.  Currently
targeting R2013a, so new parameterized tests.
parent 38af793b
Loading
Loading
Loading
Loading

+TETTests/run.m

0 → 100644
+9 −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.

path = mfilename('fullpath');
path = [path(1:size(path, 2)-13) 'Tests'];
test_results = run(matlab.unittest.TestSuite.fromFolder(path));
end
+9 −0
Original line number Diff line number Diff line
function outtable = convert_table_to_java_table( intable )
%CONVERT_TABLE_TO_JAVA_TABLE Converts a given table to jTET's representation
%   This function converts a table from TET's internal representation to
%   jTET's representation, ready for use against any of jTET's tools.

    outtable = ca.mcscert.jtet.tabularexpression.Table(intable.function_name, []);

end
+27 −0
Original line number Diff line number Diff line
classdef BaseConversionTest < matlab.unittest.TestCase
    %BASECONVERSIONTEST Base test class for conversion to jTET format
    %   This contains all the common code for doing jTET conversion tests.

    properties (Abstract)
        File
        TableName
    end

    properties
        ConvertedTable = []
    end

    methods (TestClassSetup)
        function setupOnce(testcase)
            data = load(testcase.File);
            testcase.ConvertedTable = TableBlock.convert_table_to_java_table(data.data);
        end
    end

    methods (Test)
        function testTableName(testcase)
            testcase.assertEqual(char(testcase.ConvertedTable.getTableName()), testcase.TableName);
        end
    end
end
+10 −0
Original line number Diff line number Diff line
classdef ConversionTest1 < BaseConversionTest
    %CONVERSIONTEST1 Summary of this class goes here
    %   Detailed explanation goes here

    properties
        File = 'data/test1data.mat'
        TableName = 'Startup_Limiter'
    end
end
+2.03 KiB

File added.

No diff preview for this file type.