From 54d0e2576394a74d8bab0ff8889f065d8fd7aaf2 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Fri, 15 Feb 2019 21:49:04 +0900 Subject: [PATCH] =?utf8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=A7=E3=80=81?= =?utf8?q?=E3=82=B7=E3=82=A7=E3=83=AB=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97?= =?utf8?q?=E3=83=88=E3=81=A7=E3=82=82C=E8=A8=80=E8=AA=9E=E5=AE=9F=E8=A1=8C?= =?utf8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=A7=E3=82=82make=20val?= =?utf8?q?grind=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- test/Template/Define.mk | 2 ++ test/Template/Test.mk | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/Template/Define.mk b/test/Template/Define.mk index 0b04fce..da36d60 100644 --- a/test/Template/Define.mk +++ b/test/Template/Define.mk @@ -27,12 +27,14 @@ DEV_NULL := /dev/null DIFF := diff -c ECHO := echo EXPR := expr +FILE := file -b -e ascii FIND := find GREP := grep LINECOUNT := wc -l LN := ln -s MKDIR := mkdir -p MV := mv +PRINTF := printf SED := sed TEST := test TIME := time diff --git a/test/Template/Test.mk b/test/Template/Test.mk index e6226c1..def57eb 100644 --- a/test/Template/Test.mk +++ b/test/Template/Test.mk @@ -39,11 +39,13 @@ define time_cmd ($(TIME) ./$1 1>$(DEV_NULL) 2>$(DEV_NULL)) 2>&1 | $(GREP) '^real' >$2 endef +CMD_VALGRIND = $(strip $(shell if test "`$(FILE) $(CMD_FILE)`" = "data"; then cat $(CMD_FILE); else $(PRINTF) "./$(CMD_FILE)"; fi)) + # valgrindによるメモリーチェック結果を、指定されたファイルに出力して表示 # 引数は、テスト名、コマンドファイル、出力ファイル # 用例: $(call valgrind_cmd,file_cmd,file_out) define valgrind_cmd - -$(VALGRIND) $(VALGRINDFLAG) $(strip $(shell tail -1 $(CMD_FILE))) 1>/dev/null 2>&1 + -$(VALGRIND) $(VALGRINDFLAG) $(CMD_VALGRIND) 1>/dev/null 2>&1 endef # テスト実行コマンド。 -- 2.18.0