Main Content

sltest.testmanager.copyTests

Copy test cases or test suites to another location

Description

example

objArray = sltest.testmanager.copyTests(srcObjArray,targetObj) copies test cases or test suites to another test file or test suite.

Examples

collapse all

  • % Create test structure
    tf = sltest.testmanager.TestFile('Test File');
    ts_orig = tf.createTestSuite('Original Test Suite');
    tc1 = ts_orig.createTestCase('baseline','Baseline Test Case 1');
    tc2 = ts_orig.createTestCase('baseline','Baseline Test Case 2');
    
    % Create new test suite for the target location
    ts_new = tf.createTestSuite('New Test Suite');
    
    % Copy test cases to new test suite
    objArray = sltest.testmanager.copyTests([tc1,tc2],ts_new)
    objArray = 
    
      1x2 TestCase array with properties:
    
        Name
        Description
        Enabled
        ReasonForDisabling
        TestFile
        TestPath
        TestType
        Parent

Input Arguments

collapse all

Test cases or test suites to copy, specified as an array of sltest.testmanager.TestCase or sltest.testmanager.TestSuite objects.

The destination test file or test suite to copy to, specified as an sltest.testmanager.TestFile or sltest.testmanager.TestSuite object.

Output Arguments

collapse all

Test cases or test suites at the target destination location, returned as an array of sltest.testmanager.TestCase or sltest.testmanager.TestSuite objects.

Introduced in R2015b