如何使 MATLAB xUnit 在 MATLAB R2008b (7.7) 上运行?

发布于 2024-08-04 22:41:36 字数 278 浏览 6 评论 0原文

我将 matlab_xunit 文件夹复制到 C:\Program Files,并将其(及其子文件夹)包含在 MATLAB 路径中。现在 MATLAB 可以识别新命令,例如

runtests

但此命令在当前文件夹中找不到任何测试。我做错了什么?我还能做什么?

>> runtests 
Starting test run with 0 test cases.

PASSED in 0.000 seconds.

I copied the matlab_xunit folder to C:\Program Files, and included it (and its subfolders) on the MATLAB path. Now MATLAB recognizes new commands such as

runtests

But this command does not find any tests on the current folder. What I have done wrong? What else can I do?

>> runtests 
Starting test run with 0 test cases.

PASSED in 0.000 seconds.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

街角卖回忆 2024-08-11 22:41:36

我是 MATLAB xUnit 的创建者。对于您所看到的情况,最可能的解释是测试文件中存在一些问题。您可以发布一个示例测试文件以便我查看吗?

如果您正在编写子函数样式的测试文件,当前目录中是否有任何文件以“test”或“Test”开头?该文件是否包含任何以“test”或“Test”开头的子函数?当您调用没有输入参数和单个输出参数的这些文件之一时,它是否返回 TestSuite 对象?如果没有,请仔细检查 有关创建子功能测试的文档

您是否正在编写子类 TestCase 的测试文件?它们是否包含以“test”或“Test”开头的方法?

I am the creator of MATLAB xUnit. The most likely explanation for what you are seeing is some problem in the test files. Can you post a sample test file so I can look at it?

If you are writing subfunction-style test files, do any files in your current directory start with "test" or "Test"? Does the file contain any subfunctions that begin with "test" or "Test"? When you call one of those files with no input arguments and a single output argument, does it return a TestSuite object? If not, then double-check the documentation about creating subfunction tests.

Are you instead writing test files that subclass TestCase? Do they contain methods that begin with "test" or "Test"?

燃情 2024-08-11 22:41:36

本文档 MATLAB xUnit 测试框架提交的文件交换页面应该会有所帮助。它说您必须创建一个包含测试用例 M 文件的文件夹,然后使用 CD

This document on the File Exchange page for the MATLAB xUnit Test Framework submission should help. It says that you have to create a folder with your test-case M-files in it, then make that your working directory using CD.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文