From d21cddadfdf605dcc5a1040cc9ec4d441785835e Mon Sep 17 00:00:00 2001
From: Federico Felici <federico.felici@epfl.ch>
Date: Sat, 16 Nov 2019 15:31:05 +0100
Subject: [PATCH] Update CI for multi-stage tests in specific folders

---
 algos/SCDliuqe/SCDalgo_liuqe_test.m | 44 ++++++++++++++++-------------
 1 file changed, 25 insertions(+), 19 deletions(-)

diff --git a/algos/SCDliuqe/SCDalgo_liuqe_test.m b/algos/SCDliuqe/SCDalgo_liuqe_test.m
index b6b1653..1d4e691 100644
--- a/algos/SCDliuqe/SCDalgo_liuqe_test.m
+++ b/algos/SCDliuqe/SCDalgo_liuqe_test.m
@@ -1,29 +1,35 @@
 classdef SCDalgo_liuqe_test < matlab.unittest.TestCase
   
+  properties
+    algoobj = SCDalgo_liuqe_obj();
+  end
+  
+  methods (TestClassSetup)
+    
+    function setup_conf(testCase)
+      testCase.assertWarningFree(@() SCDconf_setSIMconf);
+    end
+    function setup_algo(testCase)
+      testCase.assertInstanceOf(testCase.algoobj,'SCDclass_algo');
+    end
+    
+  end
   methods (Test)
-    function test_compile(testCase)
+    function test_callinits(testCase)
       %%
-      SCDconf_setSIMconf;
-       
-      algoobj = SCDalgo_liuqe_obj;
-      algoobj.callinits; % calls inits defining fixed parameters etc
-      algoobj.setup; % calls possible tunable parameters
       
-      algoobj.compile;
-      algoobj.sim;
+      testCase.algoobj.callinits; % calls inits defining fixed parameters etc
+    end
+    
+    function test_setup(testCase)
+      testCase.algoobj.setup; % calls possible tunable parameters
       
-      modelname = algoobj.getname;
-      %%
-      try
-        eval(sprintf('%s([],[],[],''compile'')',modelname));
-      catch
-        eval(sprintf('%s([],[],[],''term'')',modelname));
-      end
-      eval(sprintf('%s([],[],[],''term'')',modelname));
-
-      sim(modelname)
-      %%
     end
+    
+    function test_compile(testCase)
+      testCase.algoobj.compile;
+    end
+    
   end
   
 end
\ No newline at end of file
-- 
GitLab