Skip to content

Commit d1ded06

Browse files
author
jaib1
committed
reorganized test folder structure, plus added some comments
1 parent c8f7eb6 commit d1ded06

13 files changed

+46
-14
lines changed

+eui/ConditionPanel.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
ConditionTable
1111
% Minimum UI Panel width allowed. See also EUI.PARAMEDITOR/ONRESIZE
1212
MinWidth = 80
13-
% MaxWidth = 140
14-
% Margin = 4
1513
% Handle to parent UI container
1614
UIPanel
1715
% Handle to UI container for buttons

.github/config.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
classdef ParamEditor_perf < matlab.perftest.TestCase
1+
classdef ParamEditor_perfTest < matlab.perftest.TestCase
22

33
properties
44
% Figure visibility setting before running tests
@@ -19,15 +19,27 @@ function setup(testCase)
1919
testCase.FigureVisibleDefault = get(0,'DefaultFigureVisible');
2020
set(0,'DefaultFigureVisible','off');
2121
testCase.addTeardown(@set, 0, 'DefaultFigureVisible', testCase.FigureVisibleDefault);
22-
22+
23+
% add a teardown for pre-test path:
24+
% (first arg is fixture instance (i.e. environment - when to
25+
% teardown (when this is out of scope)))
26+
% (second arg is tearDownFcn (i.e. what to execute during teardown))
27+
p = path;
28+
testCase.addTeardown(@path,p);
29+
30+
% add the the 'helpers' folder in the 'tests' folder for using the
31+
% 'tests' folder's version of 'dat.paths'
32+
curpath = fileparts(mfilename('fullpath'));
33+
addpath([curpath '\helpers'])
34+
2335
% Loads validation data
2436
% Graph data is a cell array where each element is the graph number
2537
% (1:3) and within each element is a cell of X- and Y- axis values
2638
% respectively
2739
testCase.Parameters = exp.choiceWorldParams;
2840

2941
% Check paths file
30-
assert(endsWith(which('dat.paths'), fullfile('tests','+dat','paths.m')));
42+
assert(endsWith(which('dat.paths'), fullfile('tests', 'helpers', '+dat', 'paths.m')));
3143
% Create stand-alone panel
3244
testCase.ParamEditor = eui.ParamEditor;
3345
testCase.Figure = gcf();

tests/ParamEditor_test.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,27 @@ function setup(testCase)
2525
testCase.FigureVisibleDefault = get(0,'DefaultFigureVisible');
2626
set(0,'DefaultFigureVisible','off');
2727
testCase.addTeardown(@set, 0, 'DefaultFigureVisible', testCase.FigureVisibleDefault);
28-
28+
29+
% add a teardown for pre-test path:
30+
% (first arg is fixture instance (i.e. environment - when to
31+
% teardown (when this is out of scope)))
32+
% (second arg is tearDownFcn (i.e. what to execute during teardown))
33+
p = path;
34+
testCase.addTeardown(@path,p);
35+
36+
% add the the 'helpers' folder in the 'tests' folder for using the
37+
% 'tests' folder's version of 'dat.paths'
38+
curpath = fileparts(mfilename('fullpath'));
39+
addpath([curpath '\helpers'])
40+
2941
% Loads validation data
3042
% Graph data is a cell array where each element is the graph number
3143
% (1:3) and within each element is a cell of X- and Y- axis values
3244
% respectively
3345
testCase.Parameters = exp.choiceWorldParams;
3446

3547
% Check paths file
36-
assert(endsWith(which('dat.paths'), fullfile('tests','+dat','paths.m')));
48+
assert(endsWith(which('dat.paths'), fullfile('tests', 'helpers', '+dat', 'paths.m')));
3749
% Create stand-alone panel
3850
testCase.ParamEditor = eui.ParamEditor;
3951
testCase.Figure = gcf();

tests/Parameters_test.m

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,20 @@ function loadData(testCase)
3333
end
3434

3535
function setupClass(testCase)
36+
% add a teardown for pre-test path:
37+
% (first arg is fixture instance (i.e. environment - when to
38+
% teardown (when this is out of scope)))
39+
% (second arg is tearDownFcn (i.e. what to execute during teardown))
40+
p = path;
41+
testCase.addTeardown(@path,p);
42+
43+
% add the the 'helpers' folder in the 'tests' folder for using the
44+
% 'tests' folder's version of 'dat.paths'
45+
curpath = fileparts(mfilename('fullpath'));
46+
addpath([curpath '\helpers'])
47+
3648
% Check paths file
37-
assert(endsWith(which('dat.paths'), fullfile('tests','+dat','paths.m')));
49+
assert(endsWith(which('dat.paths'), fullfile('tests', 'helpers', '+dat', 'paths.m')));
3850
% Create stand-alone panel
3951
testCase.Parameters = exp.Parameters();
4052
testCase.fatalAssertTrue(isa(testCase.Parameters, 'exp.Parameters'))
File renamed without changes.

tests/expDefinitions/advancedChoiceWorldExpPanel.m renamed to tests/helpers/expDefinitions/advancedChoiceWorldExpPanel.m

File renamed without changes.

tests/expDefinitions/advancedChoiceWorld_parameters.mat renamed to tests/helpers/expDefinitions/advancedChoiceWorld_parameters.mat

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)