forked from MOxUnit/MOcov
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request MOxUnit#6 from scottclowe/time-functions
NF: add timing of unit tests
- Loading branch information
Showing
7 changed files
with
24 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,5 +34,6 @@ | |
s.skips=cell(0); | ||
s.successes=cell(0); | ||
s.testsRun=0; | ||
s.duration=0; | ||
obj=class(s,'MOxUnitTestResult'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
function obj=addFailure(obj,t,e) | ||
function obj=addFailure(obj,t,dur,e) | ||
% Add test case failure to a MoxUnitTestResult instance | ||
% | ||
% obj=addError(obj,t,e) | ||
% | ||
% Inputs: | ||
% obj MOxUnitTestResult instance. | ||
% t MoxUnitTestCase that gave a failure. | ||
% dur Duration of runtime until failure (in seconds). | ||
% e Exception associated with the failure. | ||
% | ||
% Output: | ||
% obj MOxUnitTestResult instance with the failure added. | ||
% | ||
% NNO 2015 | ||
|
||
obj.failures{end+1}={t,e}; | ||
obj.failures{end+1}={t,dur,e}; | ||
obj.testsRun=obj.testsRun+1; | ||
obj.duration=obj.duration+dur; | ||
report(obj,'F','FAILED',t); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
function obj=addSuccess(obj,t) | ||
function obj=addSuccess(obj,t,dur) | ||
% Add test case success (pass) to a MoxUnitTestResult instance | ||
% | ||
% obj=addError(obj,t,e) | ||
% | ||
% Inputs: | ||
% obj MOxUnitTestResult instance. | ||
% t MoxUnitTestCase that gave a success. | ||
% dur Duration of runtime (in seconds). | ||
% | ||
% Output: | ||
% obj MOxUnitTestResult instance with the test success added. | ||
% | ||
% NNO 2015 | ||
|
||
obj.successes{end+1}=t; | ||
obj.successes{end+1}={t,dur}; | ||
obj.testsRun=obj.testsRun+1; | ||
obj.duration=obj.duration+dur; | ||
report(obj,'.','passed',t); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters