5

合格するはずの多くのテストを含む、スクリプト化されたシステムのメイクファイルがあります。各テストは、スクリプト アプリケーションへの個別の呼び出しです。

#----------------------------------------------------------------------------
# run test scripts in the module::test
#----------------------------------------------------------------------------
scripted_tests: bin/kin modules/test/actor_equality.kin modules/test/actor_fibre.kin ...
    bin/kin modules/test/actor_equality.kin
    bin/kin modules/test/actor_fibre.kin
    ...

それは結構です。失敗を返すはずの同様のテストもいくつかあります。返品ステータスを無視することはわかってい-ますが、実行できるように返品ステータスを反転する簡単なものが必要です

#----------------------------------------------------------------------------
# run test scripts in the module::test::errors
#----------------------------------------------------------------------------
inverse_tests: bin/kin modules/test/error/bad_function.kin ...
    not bin/kin modules/test/error/bad_function.kin
    ...
4

2 に答える 2

8

コマンドを使用し!ます。

echo This returns success
! echo This returns failure
于 2009-10-09T20:52:26.640 に答える
1

「bin/kin test5.kin」の終了ステータスが 5 であることを確認したいとします。次に、次のように記述します。

run-test5:
  bin/kin test5.bin; test $$? = 5

より詳細なテストについては、'help test' と 'man test' を参照してください。

注: 感嘆符を対話型シェルにコピー/貼り付けすることは通常不可能であるため (履歴を検索するため)、私は感嘆符を避ける傾向があります。

于 2010-11-10T00:55:41.027 に答える