aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_app.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-18 18:42:04 +0200
committerLoïc Hoguin <[email protected]>2015-09-18 18:42:04 +0200
commitefa8ba96cd3566f0cbfe66a37f2bd72abc7f07d8 (patch)
tree664e9c58bade705dad24897e13bdc380a0477a55 /test/core_app.mk
parented9a0be8bb1b900c823f24a1699a199cbfaa9b2f (diff)
downloaderlang.mk-efa8ba96cd3566f0cbfe66a37f2bd72abc7f07d8.tar.gz
erlang.mk-efa8ba96cd3566f0cbfe66a37f2bd72abc7f07d8.tar.bz2
erlang.mk-efa8ba96cd3566f0cbfe66a37f2bd72abc7f07d8.zip
Add a test for the auto generation of id key in .app file
Diffstat (limited to 'test/core_app.mk')
-rw-r--r--test/core_app.mk39
1 files changed, 38 insertions, 1 deletions
diff --git a/test/core_app.mk b/test/core_app.mk
index 1acaef1..953bca3 100644
--- a/test/core_app.mk
+++ b/test/core_app.mk
@@ -1,6 +1,6 @@
# Core: Building applications.
-CORE_APP_CASES = asn1 erlc-exclude erlc-opts erlc-opts-filter error generate-erl generate-erl-include generate-erl-prepend hrl hrl-recursive mib no-app no-makedep xrl xrl-include yrl yrl-include
+CORE_APP_CASES = asn1 auto-git-id erlc-exclude erlc-opts erlc-opts-filter error generate-erl generate-erl-include generate-erl-prepend hrl hrl-recursive mib no-app no-makedep xrl xrl-include yrl yrl-include
CORE_APP_TARGETS = $(addprefix core-app-,$(CORE_APP_CASES))
CORE_APP_CLEAN_TARGETS = $(addprefix clean-,$(CORE_APP_TARGETS))
@@ -132,6 +132,43 @@ endif
[{module, M} = code:load_file(M) || M <- Mods], \
halt()"
+core-app-auto-git-id: build clean-core-app-auto-git-id
+
+ $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 "Make it a git repository"
+ $t cd $(APP) && \
+ git init -q && \
+ git config user.email "[email protected]" && \
+ git config user.name "test suite" && \
+ git add . && \
+ git commit -q -m "Tests"
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that the generated .app file has no id key"
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
+ ok = application:start($(APP)), \
+ {ok, []} = application:get_key($(APP), id), \
+ halt()"
+
+ $i "Clean the application"
+ $t $(MAKE) -C $(APP) clean $v
+
+ $i "Build the application with IS_DEP=1"
+ $t $(MAKE) -C $(APP) IS_DEP=1 $v
+
+ $i "Check that the generated .app file has an id key"
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
+ ok = application:start($(APP)), \
+ {ok, ID} = application:get_key($(APP), id), \
+ true = ID =/= [], \
+ halt()"
+
core-app-erlc-exclude: build clean-core-app-erlc-exclude
$i "Bootstrap a new OTP library named $(APP)"