From 4895ccd356b01a8a984eded115531c45b0e40004 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Sun, 14 Mar 2010 09:02:35 +0900 Subject: [PATCH] =?utf8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E5=87=BA?= =?utf8?q?=E5=8A=9B=E3=81=AB=E3=83=86=E3=82=B9=E3=83=88=E3=82=B0=E3=83=AB?= =?utf8?q?=E3=83=BC=E3=83=97=E5=90=8D=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- test/Makefile.TESTGROUPS.mk | 19 +++++++++--------- test/integration/casl2/Makefile | 9 +++++---- test/integration/comet2/Makefile | 27 +++++++++++--------------- test/integration/dumpword/Makefile | 31 +++++++++++++----------------- 4 files changed, 39 insertions(+), 47 deletions(-) diff --git a/test/Makefile.TESTGROUPS.mk b/test/Makefile.TESTGROUPS.mk index 22dd7ec..6e32f36 100644 --- a/test/Makefile.TESTGROUPS.mk +++ b/test/Makefile.TESTGROUPS.mk @@ -6,26 +6,27 @@ # make cleanall: すべてのテストで、「make」と「make prepare」で生成されたファイルをクリア # make prepare : すべてのテストの、想定結果を出力 # make create : UNITNAMEで指定されたテストを新規に作成 +GROUPNAME = `pwd | xargs basename` TESTS = `ls | grep "^[^A-Z].*"` LOGFILE = Test.log -.PHONY: all check report clean cleanall prepare create -all: check report -check: +.PHONY: all check checkeach report clean cleanall prepare create +check: checkeach report +checkeach: @rm -f $(LOGFILE) @for target in $(TESTS); do \ $(MAKE) check -C $$target; \ done $(LOGFILE): @for target in $(TESTS); do \ - cat <$$target/report.txt >>$(LOGFILE); \ + cat <$$target/report.txt >>$(LOGFILE) || echo $$target ": no report" >>$(LOGFILE); \ done report: $(LOGFILE) @success=`grep "Success" $(LOGFILE) | wc -l`; \ all=`cat $(LOGFILE) | wc -l`; \ - echo "$$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \ + echo "$(GROUPNAME): $$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \ if test $$success -eq $$all; then \ - echo "All tests are succeded."; \ + echo "$(GROUPNAME): All tests are succeded."; \ fi clean: @for target in $(TESTS); do $(MAKE) clean -C $$target; done @@ -36,10 +37,10 @@ cleanall: prepare: @for target in $(TESTS) ; do $(MAKE) prepare -C $$target ; done create: -ifdef UNITNAME +ifndef UNITNAME + @echo "no test created. set UNITNAME" +else @mkdir $(UNITNAME) @echo 'CMD = ' >>$(UNITNAME)/Makefile; \ echo 'include ../TEST.mk' >>$(UNITNAME)/Makefile -else - @echo "no test created. set UNITNAME" endif diff --git a/test/integration/casl2/Makefile b/test/integration/casl2/Makefile index 6b81f1f..45c3f79 100644 --- a/test/integration/casl2/Makefile +++ b/test/integration/casl2/Makefile @@ -6,6 +6,7 @@ # make cleanall: すべてのテストで、「make」と「make prepare」で生成されたファイルをクリア # make prepare : すべてのテストの、想定結果を出力 # make create : UNITNAMEで指定されたテストを新規に作成 +GROUPNAME = `pwd | xargs basename` TESTS = `ls | grep "^[^A-Z].*"` LOGFILE = Test.log @@ -23,9 +24,9 @@ $(LOGFILE): report: $(LOGFILE) @success=`grep "Success" $(LOGFILE) | wc -l`; \ all=`cat $(LOGFILE) | wc -l`; \ - echo "$$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \ + echo "$(GROUPNAME): $$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \ if test $$success -eq $$all; then \ - echo "All tests are succeded."; \ + echo "$(GROUPNAME): All tests are succeded."; \ fi clean: @for target in $(TESTS); do $(MAKE) clean -C $$target; done @@ -50,11 +51,11 @@ ifdef ASFILE @echo 'ASFILE = $(ASFILE)' >>$(UNITNAME)/Makefile endif ifdef INFILE - @echo 'INFILE = $(INFILE)' >>$(UNITNAME)/Makefile + @echo 'INFILE = $$(INFILE)' >>$(UNITNAME)/Makefile endif @echo -n 'CMD = $$(CASL2) $$(CASL2FLAG) $$(ASFILE)' >>$(UNITNAME)/Makefile ifdef INFILE - @echo -n ' >$$(IN)' >>$(UNITNAME)/Makefile + @echo '< $$(INFILE)' >>$(UNITNAME)/Makefile endif @echo >>$(UNITNAME)/Makefile; \ echo 'include ../TEST.mk' >>$(UNITNAME)/Makefile diff --git a/test/integration/comet2/Makefile b/test/integration/comet2/Makefile index aa6807b..2da7452 100644 --- a/test/integration/comet2/Makefile +++ b/test/integration/comet2/Makefile @@ -6,41 +6,36 @@ # make cleanall: すべてのテストで、「make」と「make prepare」で生成されたファイルをクリア # make prepare : すべてのテストの、想定結果を出力 # make create : UNITNAMEで指定されたテストを新規に作成 +GROUPNAME = `pwd | xargs basename` TESTS = `ls | grep "^[^A-Z].*"` LOGFILE = Test.log -.PHONY: all check report clean cleanall prepare create -all: check report -check: +.PHONY: all check checkeach report clean cleanall prepare create +check: checkeach report +checkeach: @rm -f $(LOGFILE) @for target in $(TESTS); do \ $(MAKE) check -C $$target; \ done $(LOGFILE): @for target in $(TESTS); do \ - if test -s $^; then cat <$$target/report.txt >>$(LOGFILE); else echo "Failure:" $$target "no report" >>$(LOGFILE); fi; \ + cat <$$target/report.txt >>$(LOGFILE) || echo $$target ": no report" >>$(LOGFILE); \ done report: $(LOGFILE) @success=`grep "Success" $(LOGFILE) | wc -l`; \ all=`cat $(LOGFILE) | wc -l`; \ - echo "$$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \ + echo "$(GROUPNAME): $$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \ if test $$success -eq $$all; then \ - echo "All tests are succeded."; \ + echo "$(GROUPNAME): All tests are succeded."; \ fi clean: - @for target in $(TESTS); do \ - $(MAKE) clean -C $$target; \ - done + @for target in $(TESTS); do $(MAKE) clean -C $$target; done @rm -f $(LOGFILE) cleanall: - @for target in $(TESTS); do \ - $(MAKE) cleanall -C $$target; \ - done + @for target in $(TESTS); do $(MAKE) cleanall -C $$target; done @rm -f $(LOGFILE) prepare: - @for target in $(TESTS) ; do \ - $(MAKE) prepare -C $$target ;\ - done + @for target in $(TESTS) ; do $(MAKE) prepare -C $$target ; done create: ifndef UNITNAME @echo "no test created. set UNITNAME" @@ -61,7 +56,7 @@ ifdef INFILE endif @echo -n 'EXECCMD = $$(COMET2) $$(COMET2FLAG) $$(OBJFILE)' >>$(UNITNAME)/Makefile ifdef INFILE - @echo '< $(INFILE)' >>$(UNITNAME)/Makefile + @echo '< $$(INFILE)' >>$(UNITNAME)/Makefile endif @echo >>$(UNITNAME)/Makefile; \ echo 'include ../TEST.mk' >>$(UNITNAME)/Makefile diff --git a/test/integration/dumpword/Makefile b/test/integration/dumpword/Makefile index 745a8a4..76b5c67 100644 --- a/test/integration/dumpword/Makefile +++ b/test/integration/dumpword/Makefile @@ -6,47 +6,42 @@ # make cleanall: すべてのテストで、「make」と「make prepare」で生成されたファイルをクリア # make prepare : すべてのテストの、想定結果を出力 # make create : UNITNAMEで指定されたテストを新規に作成 +GROUPNAME = `pwd | xargs basename` TESTS = `ls | grep "^[^A-Z].*"` LOGFILE = Test.log -.PHONY: all check report clean cleanall prepare create -all: check report -check: +.PHONY: all check checkeach report clean cleanall prepare create +check: checkeach report +checkeach: @rm -f $(LOGFILE) @for target in $(TESTS); do \ $(MAKE) check -C $$target; \ done $(LOGFILE): @for target in $(TESTS); do \ - cat <$$target/report.txt >>$(LOGFILE) || echo $$target ": no report"; \ + cat <$$target/report.txt >>$(LOGFILE) || echo $$target ": no report" >>$(LOGFILE); \ done report: $(LOGFILE) @success=`grep "Success" $(LOGFILE) | wc -l`; \ all=`cat $(LOGFILE) | wc -l`; \ - echo "$$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \ + echo "$(GROUPNAME): $$success / $$all tests passed. Details in `pwd`/$(LOGFILE)"; \ if test $$success -eq $$all; then \ - echo "All tests are succeded."; \ + echo "$(GROUPNAME): All tests are succeded."; \ fi clean: - @for target in $(TESTS); do \ - $(MAKE) clean -C $$target; \ - done + @for target in $(TESTS); do $(MAKE) clean -C $$target; done @rm -f $(LOGFILE) cleanall: - @for target in $(TESTS); do \ - $(MAKE) cleanall -C $$target; \ - done + @for target in $(TESTS); do $(MAKE) cleanall -C $$target; done @rm -f $(LOGFILE) prepare: - @for target in $(TESTS) ; do \ - $(MAKE) prepare -C $$target ;\ - done + @for target in $(TESTS) ; do $(MAKE) prepare -C $$target ; done create: -ifdef UNITNAME +ifndef UNITNAME + @echo "no test created. set UNITNAME" +else @mkdir $(UNITNAME) @echo 'include ../CMD.mk' >$(UNITNAME)/Makefile; \ echo 'CMD = ./dumpword_$$(UNITNAME).sh' >>$(UNITNAME)/Makefile; \ echo 'include ../TEST.mk' >>$(UNITNAME)/Makefile -else - @echo "no test created. set UNITNAME" endif -- 2.18.0