TestSuite Maximum recursion limit reached.
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Testing Frameworks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!