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,name,file_cmd,file_out)
21 $(call chk_file_notext,$2)
23 $(TIME) -f"$1: %E" -o $3 ./$2 >$(DEV_NULL) 2>&1
26 # テスト実行コマンド。引数は、コマンドファイル、出力ファイル、エラーファイル
27 # コマンドファイルを実行し、標準出力を出力ファイルに保存。
28 # エラー発生時は、エラー出力を出力ファイルとエラーファイルに保存。
29 # 用例: $(call exec_cmd,file_cmd,file_out,file_err)
31 $(call chk_file_notext,$1)
34 if test -s $3; then $(CAT) $3 >>$2; fi
38 # 2つのファイルを比較し、差分ファイルを作成
39 # 引数は、2ファイルのリスト、差分ファイル
40 # 用例: $(call diff_files,files,file_out)
47 # 引数は、テスト名、差分ファイル、ログファイル
48 # 用例: $(call test_log,name,file_diff,file_log)
51 if test ! -s $2; then RES=Success; else RES=Failure; fi; $(ECHO) "$1: Test $$RES $(DATE)" >>$3
52 $(ECHO) "Detail in $(CURRDIR)/$(DETAIL_FILE)" >>$3
55 # NODISPが設定されていない時は、ログファイルを表示
57 # 用例: $(call disp_test_log,file_log)
59 $(if $(NODISP),,$(CAT) $1)
62 # ファイル群から、ファイル名とファイルの内容を出力
64 # 用例: $(call report_files,list_file_target,file_out)
66 $(call chk_file_ext,$2)
67 $(foreach tfile,$1,$(call report_file,$(tfile),$2))
72 # 用例: $(call report_file,file_target,file_out)
74 $(call chk_var_null,$1)
75 if test -s $1; then $(ECHO) "== $1 ==" >>$2; $(call echo_hr,$2); cat $1 >>$2; $(call echo_hr,$2); $(ECHO) >>$2; fi
79 $(ECHO) "----------------------------------------------------------------------" >>$1