TestSuite Maximum recursion limit reached.

2 次查看(过去 30 天)
Hi
I wrote a testSuite for my application. Unfortunately, there is a recursion occurring which I cannot explain. The image below depicts the folder structure I use.
The next lines of code is where I initiate the TestSuite. I assured that my current working directory is ./test.
% MainTest.m
import matlab.unittest.TestSuite
suiteFolder = TestSuite.fromFolder(pwd);
result = run(suiteFolder);
disp(result)
As an example below is the code which runs one test function.
% TestStage.m
function tests = TestStage
tests = functiontests(localfunctions);
function setupOnce(testCase)
testCase.TestData.origPath = pwd;
cd('../src')
function teardownOnce(testCase)
cd(testCase.TestData.origPath);
function testSmallStage(testCase)
verifyTrue(testCase, true);
I get the following error when I run the `MainTest.m`. However, the test finishes when I run `TestStage.m` on its own.
Warning: The following error was caught while executing 'matlab.unittest.internal.Teardownable' class destructor:
Maximum recursion limit of 500 reached.
Can you reproduce the error? Where is my mistake?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Testing Frameworks 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by