diff --git a/+TETTests/run.m b/+TETTests/run.m new file mode 100644 index 0000000000000000000000000000000000000000..c258dd5cce617503d4e7f9d7592107053de68da2 --- /dev/null +++ b/+TETTests/run.m @@ -0,0 +1,9 @@ +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 + diff --git a/+TableBlock/convert_table_to_java_table.m b/+TableBlock/convert_table_to_java_table.m new file mode 100644 index 0000000000000000000000000000000000000000..bae685aea190b2437ede36aab41c381fa7a0563a --- /dev/null +++ b/+TableBlock/convert_table_to_java_table.m @@ -0,0 +1,9 @@ +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 + diff --git a/Tests/BaseConversionTest.m b/Tests/BaseConversionTest.m new file mode 100644 index 0000000000000000000000000000000000000000..46531e8e044809c9d6ccb4253a56f1180f480976 --- /dev/null +++ b/Tests/BaseConversionTest.m @@ -0,0 +1,27 @@ +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 + diff --git a/Tests/ConversionTest1.m b/Tests/ConversionTest1.m new file mode 100644 index 0000000000000000000000000000000000000000..a662fc056d98e842146cac0afe7061242077b8e3 --- /dev/null +++ b/Tests/ConversionTest1.m @@ -0,0 +1,10 @@ +classdef ConversionTest1 < BaseConversionTest + %CONVERSIONTEST1 Summary of this class goes here + % Detailed explanation goes here + + properties + File = 'data/test1data.mat' + TableName = 'Startup_Limiter' + end +end + diff --git a/Tests/data/test1data.mat b/Tests/data/test1data.mat new file mode 100644 index 0000000000000000000000000000000000000000..a59161d8f97bdeb2babc3e106f4593f1458b43ea Binary files /dev/null and b/Tests/data/test1data.mat differ