# 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
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
# make cleanall: すべてのテストで、「make」と「make prepare」で生成されたファイルをクリア
# make prepare : すべてのテストの、想定結果を出力
# make create : UNITNAMEで指定されたテストを新規に作成
+GROUPNAME = `pwd | xargs basename`
TESTS = `ls | grep "^[^A-Z].*"`
LOGFILE = Test.log
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
@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
# 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"
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
# 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