Create temporary folder
returns a temporary folder This folder is deleted based on the scope of the test case. For
example, for a folder created by a method, that folder is deleted when the method is
complete and goes out of scope. Temporary folders are useful if you want to use a separate
folder to store methods of a test case. See Write Plugins to Extend TestRunner for
information on test case scope.
folder = createTemporaryFolder(
testCase — Instance of test case
Instance of the test case, specified as an
folder — Temporary folder path
Temporary folder, returned as a character vector.
To learn about attributes of methods, see Method Attributes.
Create Temporary Folder for Each Test Method
classdef tempFolder < sltest.TestCase properties Folder; end methods (TestMethodSetup) function setup(testCase) testCase.Folder = ... testCase.createTemporaryFolder(); end end methods (Test) function test1(testCase) testCase.simulate('myModel1',... 'InFolder',testCase.Folder); end function test2(testCase) testCase.simulate('myModel2',... 'InFolder',testCase.Folder); end end end
Introduced in R2020b