diff m-toolbox/classes/tests/@ltpda_test_runner/get_builtin_model_tests.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/tests/@ltpda_test_runner/get_builtin_model_tests.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,30 @@
+% GET_BUILTIN_MODEL_TESTS returns an array of test structures.
+% 
+% The tests for the built-in model test classes are gathered in to an array
+% of structures of the form:
+% 
+%   test.utp     % instance of the unit test class
+%   test.methods % a cell-array of the methods to be run
+% 
+% VERSION: $Id: get_builtin_model_tests.m,v 1.3 2011/02/23 15:13:45 hewitson Exp $
+% 
+function tests = get_builtin_model_tests(runner)
+  
+  tests = [];
+  % Run all tests in built-in models dirs <models>/tests
+  paths = utils.models.getBuiltinModelSearchPaths();
+  
+  for kk=1:numel(paths)
+    path = fullfile(paths{kk}, 'tests');    
+    tests = [tests runner.get_tests_in_dir(path)];    
+  end
+  
+  % and add the new extension modules built-in models and class tests
+  prefs = getappdata(0, 'LTPDApreferences');
+  searchPaths = prefs.getExtensionsPrefs.getSearchPaths;
+  for kk=0:searchPaths.size-1
+    path = fullfile(char(searchPaths.get(kk)), 'tests');
+    tests = [tests runner.get_tests_in_dir(path)];    
+  end
+  
+end
\ No newline at end of file