TestSuite Maximum recursion limit reached.
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Testing Frameworks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!