+++ /dev/null
-../../template/Define_group.mk
\ No newline at end of file
+++ /dev/null
-../../template/Define_test.mk
\ No newline at end of file
b: not exist
b/b.txt: not exist
-Makefile:14: *** a exists in /home/kazubito/2010_12/autotest.mk/selftest/unittest/chk_file_ext. 中止.
-Makefile:18: *** a/a.txt exists in /home/kazubito/2010_12/autotest.mk/selftest/unittest/chk_file_ext. 中止.
+Makefile:13: *** a exists in $PWD. Stop.
+Makefile:17: *** a/a.txt exists in $PWD. Stop.
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
.PHONY: utest utest_err1 utest_err2
VAR_0: 0
VAR_1: 1
VAR_NULL:
-Makefile:18: *** NULL argument. 中止.
+Makefile:17: *** NULL argument. Stop.
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
.PHONY: utest utest_err
atest
-Makefile:15: *** NULL argument. 中止.
-Makefile:12: *** atest exists in /home/kazubito/2010_12/autotest.mk/selftest/unittest/create_dir. 中止.
+Makefile:13: *** NULL argument. Stop.
+Makefile:10: *** atest exists in $PWD. Stop.
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
-include ../Define_group.mk
.PHONY: utest utest_err clean_utest
+++ /dev/null
-引数として指定したディレクトリーを作成
-引数が指定されない場合は、エラー終了
-ディレクトリーが既存の場合は、エラー終了
-create_dir: Test Success 2010-11-28 19:06:19
-make -s clean_utest
-make -s utest 2>&1 && ls | grep atest
-make -s utest_err 2>&1 && ls | grep atest
-make -s utest 2>&1 && ls | grep atest
-echo
-atest
-Makefile:15: *** NULL argument. 中止.
-Makefile:12: *** atest exists in /home/kazubito/2010_11/autotest.mk/selftest/unittest/create_dir. 中止.
-
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
-include ../Define_group.mk
-
override TEST_RES_FILES := $(TEST_RES_FILES) 0.mk
utest:
echo $(TEST_INCLUDE_FILES)
- $(call create_makefile,0.mk,$(TEST_MAKEFILES))
+ $(call create_makefile,0.mk,$(MAKEFILES))
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
utest:
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
.PHONY: utest clean_utest
-/home/kazubito/2010_12/autotest.mk/selftest/unittest/makefiles_abs/Define.mk /home/kazubito/2010_12/autotest.mk/selftest/unittest/makefiles_abs/Define_group.mk /home/kazubito/2010_12/autotest.mk/selftest/unittest/makefiles_abs/Define_test.mk /home/kazubito/2010_12/autotest.mk/selftest/unittest/makefiles_abs/Test.mk
+$PWD/Define.mk $PWD/Test.mk
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
utest:
== Makefile ==
----------------------------------------------------------------------
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
.PHONY: utest utest_err1 utest_err2 clean_utest
$(RM) detail.log
----------------------------------------------------------------------
-Makefile:13: *** NULL argument. 中止.
+Makefile:12: *** NULL argument. Stop.
cat: detail.log: No such file or directory
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
.PHONY: utest utest_err1 utest_err2 clean_utest
== Makefile ==
----------------------------------------------------------------------
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
.PHONY: utest utest_err1 utest_err2 clean_utest
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
.PHONY: utest utest_err1 utest_err2 clean_utest
-1.txt diff.txt err.txt test.log detail.log time.log
+1.txt diff.log err.log summary.log detail.log time.log
include ../Define.mk
-include ../Define_test.mk
include ../Test.mk
.PHONY: utest
LN ?= ln -s
+SED ?= sed
+
######################################################################
# テストグループとテストでの共通マクロ
######################################################################
$(if $(wildcard $1),$(error $1 exists in $(CURRDIR)))
endef
+# 指定したディレクトリーを作成
+# 引数は、ディレクトリー名
+# 用例: $(call create_dir,name)
+define create_dir
+ $(call chk_var_null,$1)
+ $(call chk_file_ext,$1)
+ $(MKDIR) $1
+endef
+
+# テストディレクトリーのMakefileを作成
+# 引数は、Makefile名、依存ファイル群
+# 用例: $(call create_makefile,file,list_include_file)
+define create_makefile
+ $(RM) $1
+ $(foreach infile,$2,$(ECHO) "include ../$(infile)" >>$1; )
+ $(if $(filter $(SRC),c),$(call puts_cmd_c,$1))
+endef
+
+# C言語の関数をテストするための設定を、指定されたファイルに出力
+# 引数は、ファイル名
+# 用例: $(call puts_cmd_c,file)
+define puts_cmd_c
+ $(ECHO) >>$1
+ $(ECHO) "CC := gcc" >>$1
+ $(ECHO) "CFLAGS := -Wall" >>$1
+ $(ECHO) >>$1
+ $(ECHO) ".INTERMEDIATE:" "$$""(CMD_FILE)" >>$1
+ $(ECHO) >>$1
+ $(ECHO) "CMDSRC_FILE := cmd.c" >>$1
+ $(ECHO) "TESTTARGET_FILES := # Set test target files" >>$1
+ $(ECHO) >>$1
+ $(ECHO) "$$""(CMD_FILE):" "$$""(CMDSRC_FILE)" "$$""(TESTTARGET_FILES)" >>$1
+ $(ECHO) " ""$$""(CC)" "$$""(CFLAGS)" "-o" "$$""@" "$$""^" >>$1
+endef
+
######################################################################
# テストグループのディレクトリー
######################################################################
# テストグループのマクロ
######################################################################
-# 指定したディレクトリーを作成
-# 引数は、ディレクトリー名
-# 用例: $(call create_dir,name)
-define create_dir
- $(call chk_var_null,$1)
- $(call chk_file_ext,$1)
- $(MKDIR) $1
-endef
-
-# テストディレクトリーのMakefileを作成
-# 引数は、Makefile名、依存ファイル群
-# 用例: $(call create_makefile,file,list_include_file)
-define create_makefile
- $(RM) $1
- $(foreach infile,$2,$(ECHO) "include ../$(infile)" >>$1; )
- $(if $(filter $(SRC),c),$(call puts_cmd_c,$1))
-endef
-
-# C言語の関数をテストするための設定を、指定されたファイルに出力
-# 引数は、ファイル名
-# 用例: $(call puts_cmd_c,file)
-define puts_cmd_c
- $(ECHO) >>$1
- $(ECHO) "CC := gcc" >>$1
- $(ECHO) "CFLAGS := -Wall" >>$1
- $(ECHO) >>$1
- $(ECHO) ".INTERMEDIATE:" "$$""(CMD_FILE)" >>$1
- $(ECHO) >>$1
- $(ECHO) "CMDSRC_FILE := cmd.c" >>$1
- $(ECHO) "TESTTARGET_FILES := # Set test target files" >>$1
- $(ECHO) >>$1
- $(ECHO) "$$""(CMD_FILE):" "$$""(CMDSRC_FILE)" "$$""(TESTTARGET_FILES)" >>$1
- $(ECHO) " ""$$""(CC)" "$$""(CFLAGS)" "-o" "$$""@" "$$""^" >>$1
-endef
-
# テストごとのファイルをグループファイルに出力
# 引数は、テストのリスト、グループファイル、テストファイル
# 用例: $(call group_log,files_test_log,file_group_log)
if test ! -x $1; then $(CHMOD) u+x $1; fi
./$1 >>$2 2>$3
if test -s $3; then $(CAT) $3 >>$2; fi
+ $(SED) -i '' -e "s%$(CURRDIR)%\$$PWD%g" $2
$(call rm_null,$3)
endef