2015-06-28 18:13:15 +00:00
|
|
|
#
|
|
|
|
# Makes new test cases
|
|
|
|
#
|
|
|
|
|
|
|
|
ECHO := echo
|
|
|
|
SED := sed
|
|
|
|
|
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
.PHONY: new
|
|
|
|
new:
|
|
|
|
ifdef name
|
|
|
|
@$(ECHO)
|
|
|
|
@$(ECHO) "Creating $(name)_tc..."
|
|
|
|
@$(SED) "s/\[template\]/$(name)/g" template/template.h > tc/$(name).h
|
|
|
|
@$(SED) "s/\[template\]/$(name)/g" template/template.py > tc/$(name).py
|
2015-06-28 19:06:45 +00:00
|
|
|
@$(SED) -i "s/\/\* \[new_tc\] \*\//\#include \"$(name).h\"\n\/\* \[new_tc\] \*\//" tmain.c
|
2015-07-14 20:46:03 +00:00
|
|
|
@$(ECHO) "Done!"
|
|
|
|
@$(ECHO)
|
2015-08-02 12:54:47 +00:00
|
|
|
@$(ECHO) "Your testcase is at tc/$(name).{py,h}"
|
2015-07-14 20:46:03 +00:00
|
|
|
@$(ECHO)
|
2015-06-28 18:13:15 +00:00
|
|
|
else
|
2015-07-14 20:46:03 +00:00
|
|
|
@$(ECHO) "Please specify a name for the test case!! Like 'make name=new'"
|
|
|
|
@$(ECHO) "(Note the '_tc' will be appended automatically)"
|
2015-06-28 18:13:15 +00:00
|
|
|
endif
|