-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for multiple logging outputs (console, file, xml) #18
Open
blueacorn
wants to merge
10
commits into
psexton:main
Choose a base branch
from
blueacorn:master
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
644c538
Added .gitignore for *.asv files
adambard 86fb63f
Made multiple loggings possible. Maybe I want xml, logfile and consol…
adambard cd9a9a3
Enhanced xml output to do separate files under the right conditions.
adambard c33572b
Merge commit 'cd9a9a3de1fb4d5be66d36fb4a98703f73d9e778'
blueacorn bd43b7b
Moved MetaTestRunLogger.m to src\ path
blueacorn e5f95fb
Updated runxunit.m help text for multiple output logger options.
blueacorn 1fd3271
Add narginchk.m for compatibility with Matlab version < R2011b
blueacorn 746ba0a
Fixed narginchk.m formatting to match Matlab R2011b version
blueacorn e93ee2a
BugFix: Edited XMLTestRunLogger.m to pass XML write tests
blueacorn 44a1e31
Minor correction to runxunit.m help, to specify -xmlfile directory pa…
blueacorn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.asv |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
classdef MetaTestRunLogger < TestRunMonitor | ||
%METATESTRUNLOGGER Combine several test run loggers into one | ||
% Implement the 4 methods of a matlab-xunit test logger on each of | ||
% a cell array of instantiated input loggers. | ||
|
||
properties | ||
loggers = {}; | ||
end | ||
|
||
methods | ||
function self = MetaTestRunLogger(loggers) | ||
self.loggers = loggers; | ||
end | ||
|
||
function testComponentStarted(self, component) | ||
for ii=1:length(self.loggers) | ||
logger = self.loggers{ii}{1}; | ||
logger.testComponentStarted(component); | ||
end | ||
end | ||
|
||
function testComponentFinished(self, component, did_pass) | ||
for ii=1:length(self.loggers) | ||
logger = self.loggers{ii}{1}; | ||
logger.testComponentFinished(component, did_pass); | ||
end | ||
end | ||
|
||
function testCaseFailure(self, test_case, failure_exception) | ||
for ii=1:length(self.loggers) | ||
logger = self.loggers{ii}{1}; | ||
logger.testCaseFailure(test_case, failure_exception); | ||
end | ||
end | ||
|
||
function testCaseError(self, test_case, error_exception) | ||
for ii=1:length(self.loggers) | ||
logger = self.loggers{ii}{1}; | ||
logger.testCaseError(test_case, error_exception); | ||
end | ||
end | ||
end | ||
|
||
end | ||
|
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function narginchk(minargs, maxargs) | ||
|
||
if (nargin ~= 2) | ||
error('%s: Usage: narginchk(minargs, maxargs)',upper(mfilename)); | ||
elseif (~isnumeric (minargs) || ~isscalar (minargs)) | ||
error ('minargs must be a numeric scalar'); | ||
elseif (~isnumeric (maxargs) || ~isscalar (maxargs)) | ||
error ('maxargs must be a numeric scalar'); | ||
elseif (minargs > maxargs) | ||
error ('minargs cannot be larger than maxargs') | ||
end | ||
|
||
|
||
args = evalin ('caller', 'nargin;'); | ||
|
||
|
||
if (args < minargs) | ||
error ('MATLAB:narginchk:notEnoughInputs', 'Not enough input arguments.'); | ||
elseif (args > maxargs) | ||
error ('MATLAB:narginchk:tooManyInputs', 'Too many input arguments.'); | ||
end | ||
|
||
end |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been in MATLAB since R2011b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, we have a production project stuck on R2010b however, YMMV.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that this will shadow the "proper" builtin version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah true, suggest just block this file from merge to your branch - and just take the other parts.