Be the first to rate this file! 1 Download (last 30 days) File Size: 4.63 KB File ID: #23166

Patch for XTargets MUnit

by Sung Soo Kim

 

03 Mar 2009

Patch for later versions of MATLAB

| Watch this File

File Information
Description

XTargets' MUnit does not work in recent versions of MATLAB.
I contacted XTargets, but I've not received any answer.
So I handmade a patch.
I hope XTargets release a newer version soon.
=====
installation:
0. Backup XTargets' MUnit folder.
1. Overwrite three included files into Xtargets' MUnit folder.
2. Edit your old test files as shown below:

From
===================
function test = your_test_file

    % Subclass the testcase object
    test = munit_testcase;

    % Create a structure of constraint objects for assertions
    c = munit_constraint;

    function setup
blahblahblah
===========================

To:
===========================
function test = your_test_file

    %%%%%%%%%%%%%%%
    % Do not modify the following 20 lines of codes.
    %%%%%%%%%%%%%%%
    
    % Create a structure of constraint objects for assertions
    c = munit_constraint;

    % Subclass the testcase object
    stk = dbstack('-completenames');
    mname = stk(1).file;
    fcn_names = scan(mname, {'setup' ,'teardown', 'test_[A-Za-z0-9_]*'});
    for ffi=1:length(fcn_names)
        fcn_handles{ffi}=eval(['@',fcn_names{ffi}]);
    end
    test_file_info.fcn_names = fcn_names;
    test_file_info.fcn_handles = fcn_handles;
    test = munit_testcase(test_file_info);
    
    %%%%%%%%%%%%%%%
    
    
    %%%%%%%%%%%%%%%
    % Your codes below
    %%%%%%%%%%%%%%%
    
    
    x = [];
    y = [];
    

    function setup
blah blah blah
=================================

Now, you're good to go.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
12 Mar 2010 Tim Davis

The zip file is corrupted. I can unzip it using the system "unzip" command on my Mac and on my Linux PC, but the MATLAB "unzip" function in MATLAB on both those platforms fails, reporting an invalid zip file. Please re-zip the file and repost.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
xtargets Sung Soo Kim 03 Mar 2009 16:19:04
munit Sung Soo Kim 03 Mar 2009 16:19:04
unit testing Sung Soo Kim 03 Mar 2009 16:19:04
patch Sung Soo Kim 03 Mar 2009 16:19:04
munit Martin 04 Mar 2009 07:06:27
unit test Ryan Ollos 23 Sep 2009 16:22:19
xunit Ryan Ollos 23 Sep 2009 16:22:20

Contact us at files@mathworks.com