From 3803446bcd539205af129cc5776ca4034e356629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 28 Nov 2018 14:57:05 +0100 Subject: Add option DTL_PREFIX for erlydtl-produced module names --- test/plugin_erlydtl.mk | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test') diff --git a/test/plugin_erlydtl.mk b/test/plugin_erlydtl.mk index a6619dc..1735595 100644 --- a/test/plugin_erlydtl.mk +++ b/test/plugin_erlydtl.mk @@ -198,6 +198,31 @@ erlydtl-path-full-path-suffix: build clean {ok, [one_suffix, two_three_suffix]} = application:get_key($(APP), modules), \ halt()" +erlydtl-prefix: build clean + + $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 "Generate ErlyDTL templates" + $t mkdir $(APP)/templates/ + $t touch $(APP)/templates/one.dtl + $t touch $(APP)/templates/two.dtl + + $i "Build the application" + $t $(MAKE) -C $(APP) DEPS=erlydtl DTL_PREFIX=number_ $v + + $i "Check that ErlyDTL templates are compiled" + $t test -f $(APP)/ebin/number_one_dtl.beam + $t test -f $(APP)/ebin/number_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, [number_one_dtl, number_two_dtl]} = application:get_key($(APP), modules), \ + halt()" + erlydtl-suffix: build clean $i "Bootstrap a new OTP library named $(APP)" -- cgit v1.2.3