Simple_Unit_Testing​_Toolbox-MATLAB

版本 4.1.4 (473.3 KB) 作者: Tamas Kis
Simple unit testing framework for MATLAB.
23.0 次下载
更新时间 2024/1/3

Simple Unit Testing Toolbox View Simple Unit Testing Toolbox on File Exchange

This toolbox defines a simple unit testing framework for MATLAB.

Installation

  1. Download the toolbox from File Exchange or GitHub.
  2. Open the INSTALL folder.
  3. Double-click on Simple Unit Testing Toolbox.mltbx.

MATLAB will automatically perform the installation and add all the contents of the toolbox folder to the MATLAB search path.

Documentation

Toolbox Documentation

To open the home page of the toolbox documentation in MATLAB, type the following in the Command Window:

doc_SUTT

To open the documentation of a specific function or class with name name, type the following in the Command Window:

doc_SUTT name

Test Suites

Creating a test suite.

test_suite = TestSuite(name,terminate,color)

Adding tests to a test suite.

test_suite.add_test(TestEqual(X1,X2,name,n))
test_suite.add_test(TestNotEqual(X1,X2,name,n))
test_suite.add_test(TestError(f,args,name))
test_suite.add_test(TestNoError(f,args,name))
test_suite.add_test(TestSpeed(f1,f2,args,name))
test_suite.add_test(TestFunctionCount(f,g,name))

Running a test suite.

test_suite.run

Individual Unit Testing Functions

Testing for array equality/inequality.

TEST_EQUAL(X1,X2,n)
TEST_NOT_EQUAL(X1,X2,n)

Testing for correct error handling.

TEST_ERROR(f,args)
TEST_NO_ERROR(f,args)

Testing speed.

TEST_SPEED(f_fast,f_slow,args,n_eval)
TIME_EVALUATION(f,args,n_eval)

Testing counting the number of function evaluations.

TEST_FUNCTION_COUNT(f,g)

Printing to Command Window

Note that in the examples in the documentation, all of the test output is in black. However, when you run the tests locally in MATLAB, passed tests will print in green, while failed tests will print in red; this is accomplished using the cprintf function.

引用格式

Tamas Kis (2024). Simple_Unit_Testing_Toolbox-MATLAB (https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.1.4), GitHub. 检索时间: .

MATLAB 版本兼容性
创建方式 R2022a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
4.1.4

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.1.4

4.1.3

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.1.3

4.1.2

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.1.2

4.1.1

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.1.1

4.1.0

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.1.0

4.0.5

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.0.5

4.0.4

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.0.4

4.0.3

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.0.3

4.0.2

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.0.2

4.0.1

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.0.1

4.0.0

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v4.0.0

3.0.0

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v3.0.0

2.2.0

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v2.2.0

2.1.0

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v2.1.0

2.0.1

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v2.0.1

2.0.0

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v2.0.0

1.0.1

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v1.0.1

1.0.0.0

See release notes for this release on GitHub: https://github.com/tamaskis/Simple_Unit_Testing_Toolbox-MATLAB/releases/tag/v1.0.0

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库