aboutsummaryrefslogtreecommitdiffstats
path: root/test/plugin_erlydtl.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-10-12 12:50:22 +0200
committerLoïc Hoguin <[email protected]>2015-10-12 12:50:22 +0200
commitf7ac6d1b54f4d7faf3acb443a48f74b1ef5ea0cf (patch)
treed7bcaae13c90ba454356b1b00eb80929f1045a82 /test/plugin_erlydtl.mk
parent53703b7eded4e275f50e0b7d90a39648c90bbab3 (diff)
downloaderlang.mk-f7ac6d1b54f4d7faf3acb443a48f74b1ef5ea0cf.tar.gz
erlang.mk-f7ac6d1b54f4d7faf3acb443a48f74b1ef5ea0cf.tar.bz2
erlang.mk-f7ac6d1b54f4d7faf3acb443a48f74b1ef5ea0cf.zip
Add test for and fix DTL_FULL_PATH
Diffstat (limited to 'test/plugin_erlydtl.mk')
-rw-r--r--test/plugin_erlydtl.mk34
1 files changed, 31 insertions, 3 deletions
diff --git a/test/plugin_erlydtl.mk b/test/plugin_erlydtl.mk
index 2cae220..acfd74c 100644
--- a/test/plugin_erlydtl.mk
+++ b/test/plugin_erlydtl.mk
@@ -1,6 +1,6 @@
# ErlyDTL plugin.
-ERLYDTL_CASES = compile
+ERLYDTL_CASES = compile full-path
ERLYDTL_TARGETS = $(addprefix erlydtl-,$(ERLYDTL_CASES))
ERLYDTL_CLEAN_TARGETS = $(addprefix clean-,$(ERLYDTL_TARGETS))
@@ -24,7 +24,7 @@ erlydtl-compile: build clean-erlydtl-compile
$t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = erlydtl\n"}' $(APP)/Makefile
$i "Generate ErlyDTL templates"
- $t mkdir $(APP)/templates
+ $t mkdir $(APP)/templates/
$t touch $(APP)/templates/$(APP)_one.dtl
$t touch $(APP)/templates/$(APP)_two.dtl
@@ -33,10 +33,38 @@ erlydtl-compile: build clean-erlydtl-compile
$i "Check that ErlyDTL templates are compiled"
$t test -f $(APP)/ebin/$(APP)_one_dtl.beam
- $t test -f $(APP)/ebin/$(APP)_one_dtl.beam
+ $t test -f $(APP)/ebin/$(APP)_two_dtl.beam
$i "Check that ErlyDTL generated modules are included in .app file"
$t $(ERL) -pa $(APP)/ebin/ -eval " \
ok = application:load($(APP)), \
{ok, [$(APP_)_one_dtl, $(APP)_two_dtl]} = application:get_key($(APP), modules), \
halt()"
+
+erlydtl-full-path: build clean-erlydtl-full-path
+
+ $i "Bootstrap a new OTP library named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
+
+ $i "Add ErlyDTL to the list of dependencies; set DTL_FULL_PATH"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = erlydtl\nDTL_FULL_PATH = 1\n"}' $(APP)/Makefile
+
+ $i "Generate ErlyDTL templates"
+ $t mkdir -p $(APP)/templates/deep/
+ $t touch $(APP)/templates/$(APP)_one.dtl
+ $t touch $(APP)/templates/deep/$(APP)_two.dtl
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that ErlyDTL templates are compiled"
+ $t test -f $(APP)/ebin/$(APP)_one_dtl.beam
+ $t test -f $(APP)/ebin/deep_$(APP)_two_dtl.beam
+
+ $i "Check that ErlyDTL generated modules are included in .app file"
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
+ ok = application:load($(APP)), \
+ {ok, [deep_$(APP)_two_dtl, $(APP_)_one_dtl]} = application:get_key($(APP), modules), \
+ halt()"