非機密扱い | ![]() | ARM DUI0446WJ | ||
| ||||
ホーム > スクリプトを使用したデバッグ > 1 つのスクリプト内の複数のユースケース |
1 つのスクリプト内で複数のユースケースを定義できます。これは、ユースケースで共通コードを共有できるので便利で、各ユースケースで 1 つの機能を指定できます。
USECASE
ヘッダで始まる独自のユースケース定義ブロックが必要です。同一のスクリプトでユースケースを定義する場合、オプションと検証関数は共有できますが、各ユースケースのエントリポイントは一意である必要があります。USECASE ... ... $Run$ mainMethod USECASE ... ... $Run$ entry2
... def mainMethod(options): print “Running the first main method” ... def entry2(script, param1): print “Running the second main method” ...
USECASE ... ... $Run$ mainMethod
... def mainMethod(options): print “Running the first main method” ...
USECASE ... ... $Run$ entry2
... def entry2(script, param1): print “Running the second main method” ...