t-nissieの日記: 【電脳】GNU Autotools (automake) の make check でテストの自動化
日記 by
t-nissie
automakeでMakefile.amにTESTS=foo.sh bar.shと書いておけばmake checkでfoo.shとbar.shがテストとして実行される.
foo.shとbar.shはカレントディレクトリになければsrcdirの中も探される.
http://www.gnu.org/software/hello/manual/automake/Simple-Tests.html
build directoryでもmake checkができるように$srcdirを適宜用いる.
たとえば,foo.shに
if [ ! -f foo.dat ] ; then cp $srcdir/foo.dat . ; fi
と書いておけば,テストに必要なデータファイルfoo.datをコピーしてくれる.
【電脳】GNU Autotools (automake) の make check でテストの自動化 More ログイン