今週はシェルスクリプトで痛い目見たので、Jenkins上でシェルスクリプトの自動テストを行える環境を調べた。 使用したシェルスクリプトのユニットテストフレームワークはshunit2。 shunit2 - shUnit2 - xUnit based unit testing for Unix shell scripts - Google Project Hosting シェルスクリプトのユニットテストフレームワーク "shUnit2" を使ってみた - ablog まずは、シェルスクリプトと、そのテストスクリプト(正常ケース・エラーケース)作成。 sample.sh #!/bin/bash sample(){ CODE=$1 MESSAGE=$2 echo "$CODE-$MESSAGE" } sample_test.sh #!/bin/bash # 関数読み込み . ./sample.sh
![[shell] シェルスクリプトをJenkins上で自動テスト - kaakaa Blog](https://cdn-ak-scissors.b.st-hatena.com/image/square/fdb80bc85222412fd8638b31358e8751aa44624c/height=288;version=1;width=512/http%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fk%2Fkaakaa_hoe%2F20120908%2F20120908180454.png)