-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_and_run_euphonic_tests.m
49 lines (44 loc) · 1.23 KB
/
setup_and_run_euphonic_tests.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% Set up Python
py_ex_path = getenv('PYTHON_EX_PATH');
disp(py_ex_path)
try
% Pyenv only introduced in 2019b
pyenv('Version', py_ex_path)
catch ME
if (strcmp(ME.identifier,'MATLAB:UndefinedFunction'))
% Pyversion is deprecated but use if pyenv not available
pyversion(py_ex_path)
else
rethrow(ME);
end
end
% Install and load Horace
horace_path = getenv('HORACE_PATH');
if isempty(horace_path) % try default path
rootpath = fileparts(mfilename('fullpath'));
horace_path = fullfile(rootpath,'horace_git');
else
rootpath = fileparts(horace_path );
end
cd(fullfile(horace_path,'admin'))
horace_install
horace_on
cd(rootpath);
% Install Horace-Euphonic-Interface
toolboxes = matlab.addons.toolbox.installedToolboxes;
for i = 1:length(toolboxes)
if strcmp(toolboxes(i).Name, 'horace_euphonic_interface')
matlab.addons.toolbox.uninstallToolbox(toolboxes(i));
break;
end
end
euphonic_toolbox_path = getenv('EUPHONIC_TOOLBOX');
toolbox = fullfile(euphonic_toolbox_path,'horace_euphonic_interface.mltbx');
matlab.addons.toolbox.installToolbox(toolbox);
matlab.addons.toolbox.installedToolboxes
% Run tests
res = runtests('EuphonicDisp2SqwTest.m');
passed = [res.Passed];
if ~all(passed)
quit(1);
end