1 ######################################################################
3 ######################################################################
5 # 引数のファイルをチェックし、内容がない場合は削除
6 # 用例: $(call rm_null,file)
8 if test ! -s $1; then $(RM) $1; fi
11 # 説明ファイルの内容を、引数のファイルに出力
12 # 用例: $(call desc_log,file_out)
14 if test -s $(DESC_FILE); then $(CAT) $(DESC_FILE) >>$1; fi
17 # テスト実行の経過時間を、ファイルに出力して表示
18 # 引数は、テスト名、コマンドファイル、出力ファイル
19 # 用例: $(call time_cmd,file_cmd,file_out)
21 if test ! -x $1; then $(CHMOD) u+x $1; fi
22 ($(TIME) ./$1 1>$(DEV_NULL) 2>$(DEV_NULL)) 2>&1 | $(GREP) '^real' >$2
25 # テスト実行コマンド。引数は、コマンドファイル、出力ファイル、エラーファイル
26 # コマンドファイルを実行し、標準出力を出力ファイルに保存。
27 # エラー発生時は、エラー出力を出力ファイルとエラーファイルに保存。
28 # 用例: $(call exec_cmd,file_cmd,file_out,file_err)
30 if test ! -x $1; then $(CHMOD) u+x $1; fi
32 if test -s $3; then $(CAT) $3 >>$2; fi
36 # 2つのファイルを比較し、差分ファイルを作成
37 # 引数は、2ファイルのリスト、差分ファイル
38 # 用例: $(call diff_files,files,file_out)
45 # 引数は、テスト名、差分ファイル、ログファイル
46 # 用例: $(call test_log,name,file_diff,file_log)
49 if test ! -s $2; then RES=Success; else RES=Failure; fi; $(ECHO) "$1: Test $$RES $(DATE)" >>$3
50 $(ECHO) "Detail in $(CURRDIR)/$(DETAIL_FILE)" >>$3
53 # NODISPが設定されていない時は、ログファイルを表示
55 # 用例: $(call disp_test_log,file_log)
57 $(if $(NODISP),,$(CAT) $1)
60 # ファイル群から、ファイル名とファイルの内容を出力
62 # 用例: $(call report_files,list_file_target,file_out)
64 $(foreach tfile,$1,$(call report_file,$(tfile),$2))
69 # 用例: $(call report_file,file_target,file_out)
71 $(call chk_var_null,$1)
72 if test -s $1; then $(ECHO) "== $1 ==" >>$2; $(call echo_hr,$2); cat $1 >>$2; $(call echo_hr,$2); $(ECHO) >>$2; fi
76 $(ECHO) "----------------------------------------------------------------------" >>$1