matlab.unittest.testcase not found on path
24 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Error using SolverTest
The specified superclass 'matlab.unittest.TestCase' contains a parse error, cannot be found on MATLAB's search path, or is shadowed by another file with the same name.
I'm running R2015b on xUbuntu. The folder /usr/local/MATLAB/R2015b/toolbox/matlab/testframework is on the path and the files all seem to be there.I already reinstalled MATLAB.
Any Ideas? Thx, martin
0 comentarios
Respuestas (4)
Kiran
el 12 de Feb. de 2016
There could be multiple issue causing this behavior.
1. You may not had executed following command at MATLAB command prompt:
import matlab.unittest.TestSuite
2. There could be another file by name with name TestSuites which is shadowing the original file. To check this, execute following command:
which -all matlab.unittest.TestSuite
This should give output as
C:\Program Files\MATLAB\R2015a\toolbox\matlab\testframework\+matlab\+unittest\TestSuite.m % matlab.unittest.TestSuite constructor
Also, if this file is not on MATLAB path then add it to MATLAB path using method "addpath".
Let me know if doesn't solve the issue.
4 comentarios
Bill Tubbs
el 6 de Jun. de 2022
Bill Tubbs
el 15 de Jun. de 2022
Now I downloaded Matlab R2021b and still get the same error. I will ask a new question.
Andy Campbell
el 12 de Feb. de 2016
This does seem like an installation problem. A couple things to try:
1. Look for TestCase
>> which -all matlab.unittest.TestCase
matlab.unittest.TestCase is a built-in method % matlab.unittest.TestCase constructor
2. Look for the resulting library. Look for matlab/bin/glnxa64/libmwmatlabunit.so in your installation, as well as matlab/bin/registry/libmwmatlabunit.xml. If they are not there this is a problem with your installation.
3 comentarios
Andy Campbell
el 15 de Feb. de 2016
Editada: Andy Campbell
el 15 de Feb. de 2016
Hmmmm, I'm stumped, everything looks fine as far as I can tell. I would suggest connecting with our installation support team, they should be able to help you get to the bottom of these problems.
Marcelo
el 1 de Nov. de 2017
I am with this same problem.
I tried to execute the example "TestCarpet" described in https://www.mathworks.com/help/matlab/matlab_prog/create-basic-parameterized-test.html and also in the "Create Basic Parameterized Test" section within Help, but I received always the same error:
>> suite = matlab.unittest.TestSuite.fromFile('TestCarpet.m');
Error using matlab.unittest.TestSuite.fromFile (line 159)
The specified superclass 'matlab.unittest.TestCase' contains a parse error, cannot be found on MATLAB's search path, or is shadowed by another file with the same name.
Like Martin, I am using Matlab R2015b 32-bits, but the Windows version.
Is there some incompatibility between the Unit Test Framework and the 2015b release?
I looked for in Bug Reports, but I did not find anything about this particular problem.
Debugging the code it was possible to see that the problem occurred during the calling
suite = factory.createSuiteExplicitly(selector);
inside TestSuite class definition file.
Thanks
Marcelo
0 comentarios
Benoît Bourassa-Moreau
el 11 de Jun. de 2019
Editada: Benoît Bourassa-Moreau
el 11 de Jun. de 2019
I have the same error prompt as Martin but on Matlab R2016a (9.0.0.341360) win64. I've been working with Test objects for the past few months without any issues and previously working Test Case stopped working this morning. I'm able to find TestSuite, but not TestCase in my path:
>> which -all matlab.unittest.TestSuite
C:\Program Files\MATLAB\R2016a\toolbox\matlab\testframework\core\+matlab\+unittest\TestSuite.m % matlab.unittest.TestSuite constructor
And
>> which -all matlab.unittest.TestCase
'matlab.unittest.TestCase' not found.
I've tried to restore my Matlab path and rehash the Matlab root functions and class:
>> restoredefaultpath
>> rehash toolboxcache
TestCase still cannot be found.
Thank you,
Benoit
0 comentarios
Ver también
Categorías
Más información sobre Entering Commands en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!