diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 543a77a266d..371065bca48 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,10 +57,10 @@ jobs: cc_flags=-D_GLIBCXX_ASSERTIONS - name: Set up MATLAB uses: matlab-actions/setup-matlab@v1 - - name: Run test script - uses: matlab-actions/run-command@v1 - with: - command: cd ~/work/cantera/cantera; addpath([pwd, '/test/matlab_experimental']); ctRunTests; + # - name: Run test script + # uses: matlab-actions/run-command@v1 + # with: + # command: cd ~/work/cantera/cantera; addpath([pwd, '/test/matlab_experimental']); ctRunTests; - name: Run tests directly uses: matlab-actions/run-tests@v1 with: diff --git a/test/matlab_experimental/ctRunTests.m b/test/matlab_experimental/ctTestSetUp.m similarity index 79% rename from test/matlab_experimental/ctRunTests.m rename to test/matlab_experimental/ctTestSetUp.m index b21d405f9fb..a48138d68a1 100644 --- a/test/matlab_experimental/ctRunTests.m +++ b/test/matlab_experimental/ctTestSetUp.m @@ -18,12 +18,3 @@ end disp('Cantera is loaded for test'); - -% Run all tests -results1 = runtests('ctTestThermo') - -% Unload Cantera and remove temporary library file -unloadlibrary('libcantera_shared'); -delete([rootDir, ctName]); - -disp('Cantera has been unloaded'); \ No newline at end of file diff --git a/test/matlab_experimental/ctTestTearDown.m b/test/matlab_experimental/ctTestTearDown.m new file mode 100644 index 00000000000..2ef1b32ca2c --- /dev/null +++ b/test/matlab_experimental/ctTestTearDown.m @@ -0,0 +1,10 @@ +clear all + +rootDir = fullfile(pwd); +ctName = '/test/matlab_experimental/libcantera_shared.so'; + +% Unload Cantera and remove temporary library file +unloadlibrary('libcantera_shared'); +delete([rootDir, ctName]); + +disp('Cantera has been unloaded'); diff --git a/test/matlab_experimental/ctTestThermo.m b/test/matlab_experimental/ctTestThermo.m index 4ba7539bbbf..b03f36ead3b 100644 --- a/test/matlab_experimental/ctTestThermo.m +++ b/test/matlab_experimental/ctTestThermo.m @@ -6,15 +6,22 @@ atol = 1e-8; end + methods (TestClassSetup) + function testSetUp(self) + ctTestSetUp + end + end + methods (TestClassTeardown) function testTearDown(self) % Clean up Cantera ctCleanUp + ctTestTearDown end end methods (TestMethodSetup) - % Setup for each test + function createPhase(self) src = 'h2o2.yaml'; id = 'ohmech'; @@ -25,7 +32,7 @@ function createPhase(self) end methods (TestMethodTeardown) - % Destroy object + function deleteSolution(self) clear self.phase; end @@ -453,4 +460,4 @@ function testInvalidProperty(self) end -end \ No newline at end of file +end