ヘルプ センターヘルプ センター
クラス: matlab.unittest.plugins.Parallelizable パッケージ: matlab.unittest.plugins
どのような場合にプラグインがテストの並列実行をサポートするかの指定
R2019b 以降
tf = supportsParallel(plugin)
例
tf = supportsParallel(plugin) は、plugin がテストの並列実行をサポートする場合は logical 1 (true) を返し、plugin が逐次モードでのみテストの実行をサポートする場合は logical 0 (false) を返します。
plugin
1
true
0
false
特定の状況では、TestRunner がプラグインで拡張されている場合はテストを並列実行できません。supportsParallel をオーバーライドし、プラグインを使用してテストを並列実行できないように指定します。
TestRunner
supportsParallel
テストを並列実行するには Parallel Computing Toolbox™ が必要です。
すべて展開する
Parallelizable
プラグイン オブジェクト。matlab.unittest.plugins.Parallelizable インターフェイスをサブクラス化するプラグイン クラスのインスタンスとして指定します。
matlab.unittest.plugins.Parallelizable
ExamplePlugin は、既定でテキスト出力を画面に送信する並列化可能プラグインです。プラグインがテキスト出力をファイルに書き込む場合にテストが逐次モードでのみ実行されるように、supportsParallel をオーバーライドします。
ExamplePlugin
classdef ExamplePlugin < ... matlab.unittest.plugins.TestRunnerPlugin & ... matlab.unittest.plugins.Parallelizable properties Output (1,1) string = "StandardOutput" end methods function plugin = ExamplePlugin(stream) if nargin == 1 plugin.Output = stream; end end function tf = supportsParallel(plugin) tf = (plugin.Output == "StandardOutput"); end end end
R2019b で導入
matlab.unittest.plugins.TestRunnerPlugin | matlab.automation.streams.OutputStream
matlab.unittest.plugins.TestRunnerPlugin
matlab.automation.streams.OutputStream
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office