準備

作業用ディレクトリーの作成

まず、Autotest.mkのパッケージに含まれているsample/sort以下のファイルを、任意の作業用ディレクトリーにコピーします。ここでは、~/sort~は、現在ログインしているユーザーのホームディレクトリー)を作業用ディレクトリーにします。また、autotest.mkは、~に展開されているものとします。

$ cd
$ mkdir sort
$ cd autotest.mk/sample/sort
$ cp sort_normal.c sort_bug.c Makefile ~/sort

作業用ディレクトリーに移動し、中のファイルを確認します。

$ cd ~/sort
$ ls
Makefile  sort_normal.c  sort_bug.c

sort関数ファイルの準備

makeまたはmake normalで、sort_normal.csort.cにコピーされます。

$ make
rm -f sort.c
cp sort_normal.c sort.c

バグを含むsort関数ファイルの準備

make bugで、sort_bug.csort.cにコピーされます。 この場合、sort.cはバグを含みます。

$ make bug
rm -f sort.c
cp sort_bug.c sort.c