Rank: 70718 based on 0 downloads (last 30 days) and 0 file submitted
photo

John Grogan

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by John View all
Updated File Comments Rating
07 Dec 2011 XMLTestRunDisplay JUnit-style XML logger for MATLAB xunit framework Author: Jonathan Karr

Hi Jonathan, Thanks for providing an update. It is worth noting that this is designed to support xUnit-style tests that subclass the TestCase class. Other test framework options such as function/initTestSuite/subfunction test code and single function test code don't produce useful xml as the test names are lost because the test names are derived from class and method names.

However, to support the other test framework types, I found the following modifications worked (around line 160 in XMLTestRunDisplay.testComponentFinished). May not be the best way to do it, but it is ok for me.

if isa(component, 'TestCase')
this.iTestCase = this.iTestCase + 1;
if strcmp(component.MethodName, 'runTestCase')
[~, filename, ~] = fileparts(component.Location);
if isempty(filename)
classname = component.Name;
else
classname = filename;
end
this.TestCases(this.iTestCase).classname = classname;
this.TestCases(this.iTestCase).name = component.Name;
else
this.TestCases(this.iTestCase).classname = class(component);
this.TestCases(this.iTestCase).name = component.MethodName;
end
this.TestCases(this.iTestCase).location = component.Location;
this.TestCases(this.iTestCase).time = component_run_time;
end

Anyway, thanks for sharing this code!

03 Dec 2011 XMLTestRunDisplay JUnit-style XML logger for MATLAB xunit framework Author: Jonathan Karr

This XML logging would be a great extension to xUnit, unfortunately, the initial upload is not runnable due to missing package code (edu.stanford.covert.util)

Contact us