Просмотр исходного кода

Fix test about auto adding an id key when LEGACY=1

Loïc Hoguin 9 лет назад
Родитель
Сommit
8dec2350a3
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      test/core_app.mk

+ 11 - 0
test/core_app.mk

@@ -150,11 +150,22 @@ core-app-auto-git-id: build clean-core-app-auto-git-id
 	$i "Build the application"
 	$t $(MAKE) -C $(APP) $v
 
+ifdef LEGACY
+# Legacy replaces {id, "git"} always regardless of built as a dependency.
+	$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()"
+else
+# If there is no .app.src though, only fill in id when built as a dependency.
 	$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()"
+endif
 
 	$i "Clean the application"
 	$t $(MAKE) -C $(APP) clean $v