# テスト実行の経過時間を、ファイルに出力して表示
# 引数は、テスト名、コマンドファイル、出力ファイル
-# 用例: $(call time_cmd,name,file_cmd,file_out)
+# 用例: $(call time_cmd,file_cmd,file_out)
define time_cmd
- $(call chk_file_notext,$2)
- $(CHMOD) u+x $2
- $(TIME) -f"$1: %E" -o $3 ./$2 >$(DEV_NULL) 2>&1
+ if test ! -x $1; then $(CHMOD) u+x $1; fi
+ ($(TIME) ./$1 1>$(DEV_NULL) 2>$(DEV_NULL)) 2>&1 | $(GREP) '^real' >$2
endef
# テスト実行コマンド。引数は、コマンドファイル、出力ファイル、エラーファイル
# エラー発生時は、エラー出力を出力ファイルとエラーファイルに保存。
# 用例: $(call exec_cmd,file_cmd,file_out,file_err)
define exec_cmd
- $(call chk_file_notext,$1)
- $(CHMOD) u+x $1
+ if test ! -x $1; then $(CHMOD) u+x $1; fi
./$1 >>$2 2>$3
if test -s $3; then $(CAT) $3 >>$2; fi
$(call rm_null,$3)
# 引数は、対象ファイル群、出力ファイル
# 用例: $(call report_files,list_file_target,file_out)
define report_files
- $(call chk_file_ext,$2)
$(foreach tfile,$1,$(call report_file,$(tfile),$2))
endef