Skip to content

Commit 29cf15d

Browse files
committed
update doc and CI
1 parent bc2e0c9 commit 29cf15d

File tree

4 files changed

+27
-65
lines changed

4 files changed

+27
-65
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ before_script:
3939
# Add to src functions to path
4040
- octave $OCTFLAGS --eval "addpath(genpath(fullfile(pwd, 'src'))); savepath ();"
4141
# Change current directory
42-
- cd manualTests
42+
- cd tests/manualTests
4343

4444
jobs:
4545
include:

src/templates/test_templateTest.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ function test_templateTestBasic()
2323
% expectedOuput = X;
2424

2525
% assertEqual(actualOupout, expectedOuput)
26-
26+
% assertTrue( );
27+
% assertFalse( );
28+
2729
%% clean up (delete temporary files that were created)
2830

2931
end

tests/README.md

Lines changed: 23 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,38 @@
66
- Install [MOcov for matlab and octave](https://github.com/MOcov/MOcov) to get
77
the code coverage
88

9-
- Make sure you are in the `tests` directory.
9+
- Make sure the following folders and sub-folders are in the Octave / MATLAB
10+
path:
1011

11-
- Run `moxunit_runtests` or `moxunit_runtests -verbose` to run the tests.
12+
- `src`
13+
- `lib`
14+
- `tests/utils`
15+
16+
- Run `moxunit_runtests tests` or `moxunit_runtests tests -verbose` to run the
17+
tests.
1218

1319
This should tell you which tests pass or fail.
1420

15-
## code coverage
21+
## Adding more tests
22+
23+
You can use the function template to write more tests.
24+
25+
It is in the [`src/templates` folder](../src/templates)
26+
27+
<!-- ## code coverage
28+
29+
A lot of what follows does not really work locally because of needing to add the right
30+
folders to the path to get an accurate coverage.
1631
1732
The following command would give more info and will give you HTML output in a
1833
`coverage_html` folder showing you which lines of code is or is not checked by
1934
your test suite.
2035
2136
```matlab
22-
success = moxunit_runtests(pwd, ... % the path where the tests are
37+
success = moxunit_runtests('tests', ... % the path where the tests are
2338
'-verbose', ...
2439
'-with_coverage', ...
25-
'-cover', fullfile(pwd, '..'), ... % the path of the code whose coverage we want to estimate
40+
'-cover', fullfile(pwd, 'src'), ... % the path of the code whose coverage we want to estimate
2641
'-cover_xml_file','coverage.xml', ...
2742
'-cover_html_dir','coverage_html');
2843
```
@@ -38,9 +53,9 @@ some tests.
3853
3954
```matlab
4055
coverage = mocov( ...
41-
'-expression', 'moxunit_runtests()', ...
56+
'-expression', "moxunit_runtests('test')", ...
4257
'-verbose', ...
43-
'-cover', fullfile(pwd, '..'), ...
58+
'-cover', fullfile(pwd, 'src'), ...
4459
'-cover_exclude', '*jsonread.m', ...
4560
'-cover_exclude', '*json*code.m', ...
4661
'-cover_exclude', '*Contents.m', ...
@@ -54,50 +69,4 @@ coverage = mocov( ...
5469
'-cover_exclude', '*test_*', ...
5570
'-cover_xml_file','coverage.xml', ...
5671
'-cover_html_dir','coverage_html')
57-
```
58-
59-
## Adding more tests
60-
61-
You can use the following function template to write more tests.
62-
63-
```matlab
64-
function test_suite = test_functionToTest()
65-
% This top function is necessary for mox unit to run tests.
66-
% DO NOT CHANGE IT except to adapt the name of the function.
67-
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
68-
test_functions = localfunctions(); %#ok<*NASGU>
69-
catch % no problem; early Matlab versions can use initTestSuite fine
70-
end
71-
initTestSuite;
72-
end
73-
74-
function test_functionToTestBasic()
75-
76-
%% set up
77-
78-
79-
%% data to test against
80-
81-
82-
%% test
83-
% assertTrue( );
84-
% assertFalse( );
85-
% assertEqual( );
86-
87-
end
88-
89-
function test_functionToTestUseCase1()
90-
91-
%% set up
92-
93-
94-
%% data to test against
95-
96-
97-
%% test
98-
% assertTrue( );
99-
% assertFalse( );
100-
% assertEqual( );
101-
102-
end
103-
```
72+
``` -->

tests/manualTests/miss_hit.cfg

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)