TestSuite Maximum recursion limit reached.

2 ビュー (過去 30 日間)
Rafael Müller
Rafael Müller 2018 年 3 月 5 日
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 Center および File ExchangeTesting Frameworks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by