core_deps.mk 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412
  1. # Core: Packages and dependencies.
  2. CORE_DEPS_TARGETS = $(call list_targets,core-deps)
  3. .PHONY: core-deps $(CORE_DEPS_TARGETS)
  4. core-deps: $(CORE_DEPS_TARGETS)
  5. ifneq ($(PLATFORM),msys2)
  6. core-deps-build-c-8cc: init
  7. $i "Bootstrap a new OTP library named $(APP)"
  8. $t mkdir $(APP)/
  9. $t cp ../erlang.mk $(APP)/
  10. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  11. $i "Add 8cc to the list of build dependencies"
  12. $t perl -ni.bak -e 'print;if ($$.==1) {print "BUILD_DEPS = 8cc\ndep_8cc = git https://github.com/rui314/8cc master\n"}' $(APP)/Makefile
  13. $i "Build the application"
  14. $t $(MAKE) -C $(APP) $v
  15. $i "Check that all dependencies were fetched"
  16. $t test -d $(APP)/deps/8cc
  17. $i "Check that 8cc can be started"
  18. $t $(APP)/deps/8cc/8cc -h $v
  19. $i "Check that the application was compiled correctly"
  20. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  21. [ok = application:load(App) || App <- [$(APP)]], \
  22. {ok, Deps} = application:get_key($(APP), applications), \
  23. false = lists:member('8cc', Deps), \
  24. halt()"
  25. endif
  26. core-deps-build-c-lz4: init
  27. $i "Bootstrap a new OTP library named $(APP)"
  28. $t mkdir $(APP)/
  29. $t cp ../erlang.mk $(APP)/
  30. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  31. $i "Add lz4 to the list of build dependencies"
  32. $t perl -ni.bak -e 'print;if ($$.==1) {print "BUILD_DEPS = lz4_src\ndep_lz4_src = git https://github.com/lz4/lz4 v1.8.2\n"}' $(APP)/Makefile
  33. $i "Build the application"
  34. $t $(MAKE) -C $(APP) $v
  35. $i "Check that all dependencies were fetched"
  36. $t test -d $(APP)/deps/lz4_src
  37. $i "Check that lz4 was compiled"
  38. $t test -f $(APP)/deps/lz4_src/lib/liblz4.a
  39. $i "Check that the application was compiled correctly"
  40. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  41. [ok = application:load(App) || App <- [$(APP)]], \
  42. {ok, Deps} = application:get_key($(APP), applications), \
  43. false = lists:member(lz4, Deps), \
  44. halt()"
  45. core-deps-build-erl: init
  46. $i "Bootstrap a new OTP library named $(APP)"
  47. $t mkdir $(APP)/
  48. $t cp ../erlang.mk $(APP)/
  49. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  50. $i "Add cowlib to the list of build dependencies"
  51. $t perl -ni.bak -e 'print;if ($$.==1) {print "BUILD_DEPS = cowlib\n"}' $(APP)/Makefile
  52. $i "Build the application"
  53. $t $(MAKE) -C $(APP) $v
  54. $i "Check that all dependencies were fetched"
  55. $t test -d $(APP)/deps/cowlib
  56. $i "Check that the application was compiled correctly"
  57. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  58. [ok = application:load(App) || App <- [$(APP), cowlib]], \
  59. {ok, Deps} = application:get_key($(APP), applications), \
  60. false = lists:member(cowlib, Deps), \
  61. halt()"
  62. core-deps-build-js: init
  63. $i "Bootstrap a new OTP library named $(APP)"
  64. $t mkdir $(APP)/
  65. $t cp ../erlang.mk $(APP)/
  66. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  67. $i "Add jquery to the list of build dependencies"
  68. $t perl -ni.bak -e 'print;if ($$.==1) {print "BUILD_DEPS = jquery\ndep_jquery = git https://github.com/jquery/jquery master\n"}' $(APP)/Makefile
  69. $i "Build the application"
  70. $t $(MAKE) -C $(APP) $v
  71. $i "Check that all dependencies were fetched"
  72. $t test -d $(APP)/deps/jquery
  73. $i "Check that the application was compiled correctly"
  74. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  75. [ok = application:load(App) || App <- [$(APP)]], \
  76. {ok, Deps} = application:get_key($(APP), applications), \
  77. false = lists:member(jquery, Deps), \
  78. halt()"
  79. core-deps-dep-built: init
  80. $i "Bootstrap a new OTP library named $(APP)"
  81. $t mkdir $(APP)/
  82. $t cp ../erlang.mk $(APP)/
  83. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  84. $i "Add cowlib to the list of dependencies"
  85. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/Makefile
  86. $i "Build the application"
  87. $t $(MAKE) -C $(APP) $v
  88. $i "Touch one cowlib file to mark it for recompilation"
  89. $t $(SLEEP)
  90. $t touch $(APP)/deps/cowlib/src/cow_http.erl
  91. $i "Check that cowlib is not rebuilt"
  92. $t touch $(APP)/EXPECT
  93. $t $(SLEEP)
  94. $t $(MAKE) -C $(APP) $v
  95. $t find $(APP)/deps/cowlib -type f -newer $(APP)/EXPECT | sort | diff $(APP)/EXPECT -
  96. $t rm $(APP)/EXPECT
  97. $i "Delete the dep_built file"
  98. $t rm $(APP)/deps/cowlib/ebin/dep_built
  99. $i "Check that cowlib was rebuilt"
  100. $t printf "%s\n" \
  101. $(APP)/deps/cowlib/cowlib.d \
  102. $(APP)/deps/cowlib/ebin/cowlib.app \
  103. $(APP)/deps/cowlib/ebin/cow_http.beam \
  104. $(APP)/deps/cowlib/ebin/dep_built | sort > $(APP)/EXPECT
  105. $t $(SLEEP)
  106. $t $(MAKE) -C $(APP) $v
  107. # Files in .git might end up modified due to the id generation in the .app file.
  108. $t find $(APP)/deps/cowlib -type f -newer $(APP)/EXPECT | grep -v ".git" | sort | diff $(APP)/EXPECT -
  109. $t rm $(APP)/EXPECT
  110. core-deps-dep-built-full: init
  111. $i "Bootstrap a new OTP library named $(APP)"
  112. $t mkdir $(APP)/
  113. $t cp ../erlang.mk $(APP)/
  114. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  115. $i "Add cowlib to the list of dependencies"
  116. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/Makefile
  117. $i "Build the application"
  118. $t $(MAKE) -C $(APP) $v
  119. $i "Touch one cowlib file to mark it for recompilation"
  120. $t $(SLEEP)
  121. $t touch $(APP)/deps/cowlib/src/cow_http.erl
  122. $i "Check that cowlib is rebuilt with FULL=1"
  123. $t printf "%s\n" \
  124. $(APP)/deps/cowlib/cowlib.d \
  125. $(APP)/deps/cowlib/ebin/cowlib.app \
  126. $(APP)/deps/cowlib/ebin/cow_http.beam \
  127. $(APP)/deps/cowlib/ebin/dep_built | sort > $(APP)/EXPECT
  128. $t $(SLEEP)
  129. $t $(MAKE) -C $(APP) FULL=1 $v
  130. # Files in .git might end up modified due to the id generation in the .app file.
  131. $t find $(APP)/deps/cowlib -type f -newer $(APP)/EXPECT | grep -v ".git" | sort | diff $(APP)/EXPECT -
  132. $t rm $(APP)/EXPECT
  133. core-deps-dep-built-force-full: init
  134. $i "Bootstrap a new OTP library named $(APP)"
  135. $t mkdir $(APP)/
  136. $t cp ../erlang.mk $(APP)/
  137. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  138. $i "Add cowlib to the list of dependencies"
  139. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/Makefile
  140. $i "Build the application"
  141. $t $(MAKE) -C $(APP) $v
  142. $i "Touch one cowlib file to mark it for recompilation"
  143. $t $(SLEEP)
  144. $t touch $(APP)/deps/cowlib/src/cow_http.erl
  145. $i "Check that cowlib is not rebuilt if \`force_rebuilding_dep\` returns false"
  146. $t touch $(APP)/EXPECT
  147. $t $(SLEEP)
  148. $t $(MAKE) -C $(APP) force_rebuilding_dep='test $$(1) != $(APP)/deps/cowlib' $v
  149. $t find $(APP)/deps/cowlib -type f -newer $(APP)/EXPECT | sort | diff $(APP)/EXPECT -
  150. $t rm $(APP)/EXPECT
  151. $i "Check that cowlib is rebuilt if \`force_rebuilding_dep\` returns true"
  152. $t printf "%s\n" \
  153. $(APP)/deps/cowlib/cowlib.d \
  154. $(APP)/deps/cowlib/ebin/cowlib.app \
  155. $(APP)/deps/cowlib/ebin/cow_http.beam \
  156. $(APP)/deps/cowlib/ebin/dep_built | sort > $(APP)/EXPECT
  157. $t $(SLEEP)
  158. $t $(MAKE) -C $(APP) force_rebuilding_dep='test $$(1) = $(APP)/deps/cowlib' $v
  159. # Files in .git might end up modified due to the id generation in the .app file.
  160. $t find $(APP)/deps/cowlib -type f -newer $(APP)/EXPECT | grep -v ".git" | sort | diff $(APP)/EXPECT -
  161. $t rm $(APP)/EXPECT
  162. core-deps-dep-built-ln: init
  163. $i "Bootstrap a new OTP library named $(APP)"
  164. $t mkdir $(APP)/
  165. $t cp ../erlang.mk $(APP)/
  166. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  167. $i "Add cowlib to the list of dependencies"
  168. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/Makefile
  169. $i "Clone cowlib manually inside $(APP)"
  170. $t git clone -q https://github.com/ninenines/cowlib $(APP)/cowlib
  171. $i "Link to cowlib instead of fetching the dependency"
  172. $t mkdir -p $(APP)/deps
  173. $t ln -s ../cowlib $(APP)/deps/cowlib
  174. $i "Build the application"
  175. $t $(MAKE) -C $(APP) $v
  176. # On MSYS2 "ln" will by default not create symbolic links because
  177. # it requires an option to be enabled and administrative privileges.
  178. # The "rebuild" part of the test is therefore skipped on Windows.
  179. ifneq ($(PLATFORM),msys2)
  180. $i "Touch one cowlib file to mark it for recompilation"
  181. $t $(SLEEP)
  182. $t touch $(APP)/deps/cowlib/src/cow_http.erl
  183. $i "Check that cowlib is rebuilt; symlinked deps don't create dep_built"
  184. $t printf "%s\n" \
  185. $(APP)/cowlib/cowlib.d \
  186. $(APP)/cowlib/ebin/cowlib.app \
  187. $(APP)/cowlib/ebin/cow_http.beam | sort > $(APP)/EXPECT
  188. $t $(SLEEP)
  189. $t $(MAKE) -C $(APP) $v
  190. # Files in .git might end up modified due to the id generation in the .app file.
  191. $t find $(APP)/cowlib -type f -newer $(APP)/EXPECT | grep -v ".git" | sort | diff $(APP)/EXPECT -
  192. $t rm $(APP)/EXPECT
  193. endif
  194. core-deps-dep-commit: init
  195. $i "Bootstrap a new OTP library named $(APP)"
  196. $t mkdir $(APP)/
  197. $t cp ../erlang.mk $(APP)/
  198. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  199. $i "Add Cowboy 1.0.0 to the list of dependencies"
  200. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy_commit = 1.0.0\n"}' $(APP)/Makefile
  201. ifdef LEGACY
  202. $i "Add Cowboy to the applications key in the .app.src file"
  203. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  204. endif
  205. $i "Build the application"
  206. $t $(MAKE) -C $(APP) $v
  207. $i "Check that all dependencies were fetched"
  208. $t test -d $(APP)/deps/cowboy
  209. $t test -d $(APP)/deps/cowlib
  210. $t test -d $(APP)/deps/ranch
  211. $i "Check that the application was compiled correctly"
  212. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  213. [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
  214. {ok, Deps} = application:get_key($(APP), applications), \
  215. true = lists:member(cowboy, Deps), \
  216. {ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
  217. halt()"
  218. core-deps-dir: init
  219. $i "Bootstrap a new OTP library named $(APP)"
  220. $t mkdir $(APP)/
  221. $t cp ../erlang.mk $(APP)/
  222. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  223. $i "Add Cowboy to the list of dependencies with a custom DEPS_DIR"
  224. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\nDEPS_DIR ?= \$$(CURDIR)/deep/libs\n"}' $(APP)/Makefile
  225. ifdef LEGACY
  226. $i "Add Cowboy to the applications key in the .app.src file"
  227. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  228. endif
  229. $i "Build the application"
  230. $t $(MAKE) -C $(APP) $v
  231. $i "Check that all dependencies were fetched in the custom DEPS_DIR"
  232. $t test -d $(APP)/deep/libs/cowboy
  233. $t test -d $(APP)/deep/libs/cowlib
  234. $t test -d $(APP)/deep/libs/ranch
  235. $i "Check that the application was compiled correctly"
  236. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deep/libs/*/ebin/ -eval " \
  237. [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
  238. {ok, Deps} = application:get_key($(APP), applications), \
  239. true = lists:member(cowboy, Deps), \
  240. halt()"
  241. core-deps-doc: init
  242. $i "Bootstrap a new OTP library named $(APP)"
  243. $t mkdir $(APP)/
  244. $t cp ../erlang.mk $(APP)/
  245. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  246. $i "Generate .erl files"
  247. $t echo "-module(boy)." > $(APP)/src/boy.erl
  248. $t echo "-module(girl)." > $(APP)/src/girl.erl
  249. $i "Add Edown as a documentation building dependency"
  250. $t perl -ni.bak -e 'print;if ($$.==1) {print "DOC_DEPS = edown\nEDOC_OPTS = {doclet, edown_doclet}\n"}' $(APP)/Makefile
  251. $i "Build the application"
  252. $t $(MAKE) -C $(APP) $v
  253. $i "Check that no dependencies were fetched"
  254. $t test ! -e $(APP)/deps
  255. $i "Check that the application was compiled correctly"
  256. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  257. [ok = application:load(App) || App <- [$(APP)]], \
  258. {ok, Deps} = application:get_key($(APP), applications), \
  259. false = lists:member(edown, Deps), \
  260. halt()"
  261. $i "Build the application documentation"
  262. $t $(MAKE) -C $(APP) edoc $v
  263. $i "Check that documentation dependencies were fetched"
  264. $t test -d $(APP)/deps/edown
  265. $i "Check the Edown generated Markdown documentation"
  266. $t test -f $(APP)/doc/boy.md
  267. $t test -f $(APP)/doc/girl.md
  268. core-deps-fetch-cp: init
  269. $i "Bootstrap a new OTP library named $(APP)"
  270. $t mkdir $(APP)/
  271. $t cp ../erlang.mk $(APP)/
  272. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  273. $i "Bootstrap a new OTP library named my_dep inside $(APP)"
  274. $t mkdir $(APP)/my_dep
  275. $t cp ../erlang.mk $(APP)/my_dep/
  276. $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v
  277. $i "Add my_dep to the list of dependencies"
  278. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep\ndep_my_dep = cp $(CURDIR)/$(APP)/my_dep/\n"}' $(APP)/Makefile
  279. ifdef LEGACY
  280. $i "Add my_dep to the applications key in the .app.src file"
  281. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
  282. endif
  283. $i "Build the application"
  284. $t $(MAKE) -C $(APP) $v
  285. $i "Check that all dependencies were fetched"
  286. $t test -d $(APP)/deps/my_dep
  287. $i "Check that the application was compiled correctly"
  288. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  289. [ok = application:load(App) || App <- [$(APP), my_dep]], \
  290. {ok, Deps} = application:get_key($(APP), applications), \
  291. true = lists:member(my_dep, Deps), \
  292. halt()"
  293. core-deps-fetch-custom: init
  294. $i "Bootstrap a new OTP library named $(APP)"
  295. $t mkdir $(APP)/
  296. $t cp ../erlang.mk $(APP)/
  297. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  298. $i "Add dependency boop using custom fetch method beep to the list of dependencies"
  299. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = boop\ndep_boop = beep boop\ndep_fetch_beep = mkdir -p \$$(DEPS_DIR)/\$$1/ebin/\n"}' $(APP)/Makefile
  300. ifdef LEGACY
  301. $i "Add boop to the applications key in the .app.src file"
  302. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tboop,\n"}' $(APP)/src/$(APP).app.src
  303. endif
  304. $i "Build the application"
  305. $t $(MAKE) -C $(APP) $v
  306. $i "Check that all dependencies were fetched"
  307. $t test -d $(APP)/deps/boop
  308. $i "Check that the application was compiled correctly"
  309. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  310. ok = application:load($(APP)), \
  311. {ok, Deps} = application:get_key($(APP), applications), \
  312. true = lists:member(boop, Deps), \
  313. halt()"
  314. core-deps-fetch-fail-bad: init
  315. $i "Bootstrap a new OTP library named $(APP)"
  316. $t mkdir $(APP)/
  317. $t cp ../erlang.mk $(APP)/
  318. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  319. $i "Add Cowlib as a dependency using a non-existing fetch method named oops"
  320. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib = oops https://github.com/ninenines/cowlib 1.0.0\n"}' $(APP)/Makefile
  321. $i "Check that building the application fails"
  322. $t ! $(MAKE) -C $(APP) $v
  323. core-deps-fetch-fail-unknown: init
  324. $i "Bootstrap a new OTP library named $(APP)"
  325. $t mkdir $(APP)/
  326. $t cp ../erlang.mk $(APP)/
  327. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  328. $i "Add an unknown application as a dependency"
  329. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = unknown\n"}' $(APP)/Makefile
  330. $i "Check that building the application fails"
  331. $t ! $(MAKE) -C $(APP) $v
  332. core-deps-fetch-git: init
  333. $i "Bootstrap a new OTP library named $(APP)"
  334. $t mkdir $(APP)/
  335. $t cp ../erlang.mk $(APP)/
  336. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  337. $i "Add Cowboy 1.0.0 to the list of dependencies"
  338. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy = git https://github.com/ninenines/cowboy 1.0.0\n"}' $(APP)/Makefile
  339. ifdef LEGACY
  340. $i "Add Cowboy to the applications key in the .app.src file"
  341. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  342. endif
  343. $i "Build the application"
  344. $t $(MAKE) -C $(APP) $v
  345. $i "Check that all dependencies were fetched"
  346. $t test -d $(APP)/deps/cowboy
  347. $t test -d $(APP)/deps/cowlib
  348. $t test -d $(APP)/deps/ranch
  349. $i "Check that the application was compiled correctly"
  350. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  351. [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
  352. {ok, Deps} = application:get_key($(APP), applications), \
  353. true = lists:member(cowboy, Deps), \
  354. {ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
  355. halt()"
  356. core-deps-fetch-git-subfolder: init
  357. $i "Bootstrap a new OTP library named $(APP)"
  358. $t mkdir $(APP)/
  359. $t cp ../erlang.mk $(APP)/
  360. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  361. $i "Bootstrap a new OTP library named my_dep as a subfolder inside $(APP)"
  362. $t mkdir -p $(APP)/git_repo/my_dep
  363. $t cp ../erlang.mk $(APP)/git_repo/my_dep/
  364. $t $(MAKE) -C $(APP)/git_repo/my_dep/ -f erlang.mk bootstrap-lib $v
  365. # Create an empty file so src/ gets committed.
  366. $t touch $(APP)/git_repo/my_dep/src/README
  367. $t cd $(APP)/git_repo && \
  368. git init -q && \
  369. git config user.email "testsuite@erlang.mk" && \
  370. git config user.name "test suite" && \
  371. git add . && \
  372. git commit -q --no-gpg-sign -m "Tests"
  373. $i "Add my_dep to the list of dependencies"
  374. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep\ndep_my_dep = git-subfolder file://$(abspath $(APP)/git_repo) master my_dep\n"}' $(APP)/Makefile
  375. ifdef LEGACY
  376. $i "Add my_dep to the applications key in the .app.src file"
  377. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
  378. endif
  379. $i "Build the application"
  380. $t $(MAKE) -C $(APP) $v
  381. $i "Check that the dependency was fetched"
  382. $t test -d $(APP)/deps/my_dep
  383. $i "Check that the application was compiled correctly"
  384. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  385. [ok = application:load(App) || App <- [$(APP), my_dep]], \
  386. {ok, Deps} = application:get_key($(APP), applications), \
  387. true = lists:member(my_dep, Deps), \
  388. halt()"
  389. core-deps-fetch-git-submodule: init
  390. $i "Bootstrap a new OTP library named $(APP)"
  391. $t mkdir $(APP)/
  392. $t cp ../erlang.mk $(APP)/
  393. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  394. $i "Bootstrap a new OTP library named my_dep inside $(APP)"
  395. $t mkdir $(APP)/my_dep
  396. $t cp ../erlang.mk $(APP)/my_dep/
  397. $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v
  398. # Create an empty file so src/ gets committed.
  399. $t touch $(APP)/my_dep/src/README
  400. $t cd $(APP)/my_dep && \
  401. git init -q && \
  402. git config user.email "testsuite@erlang.mk" && \
  403. git config user.name "test suite" && \
  404. git add . && \
  405. git commit -q --no-gpg-sign -m "Tests"
  406. $i "Add the submodule to my_dep"
  407. $t mkdir $(APP)/deps
  408. $t cd $(APP) && \
  409. git init -q && \
  410. git submodule -q add file://$(abspath $(APP)/my_dep) deps/my_dep && \
  411. git config user.email "testsuite@erlang.mk" && \
  412. git config user.name "test suite" && \
  413. git add . && \
  414. git commit -q --no-gpg-sign -m "Tests"
  415. $i "Distclean the application"
  416. $t $(MAKE) -C $(APP) distclean $v
  417. $i "Add my_dep to the list of dependencies"
  418. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep\ndep_my_dep = git-submodule\n"}' $(APP)/Makefile
  419. ifdef LEGACY
  420. $i "Add my_dep to the applications key in the .app.src file"
  421. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
  422. endif
  423. $i "Build the application"
  424. $t $(MAKE) -C $(APP) $v
  425. $i "Check that all dependencies were fetched"
  426. $t test -d $(APP)/deps/my_dep
  427. $i "Check that the application was compiled correctly"
  428. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  429. [ok = application:load(App) || App <- [$(APP), my_dep]], \
  430. {ok, Deps} = application:get_key($(APP), applications), \
  431. true = lists:member(my_dep, Deps), \
  432. halt()"
  433. core-deps-fetch-hex: init
  434. $i "Bootstrap a new OTP library named $(APP)"
  435. $t mkdir $(APP)/
  436. $t cp ../erlang.mk $(APP)/
  437. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  438. $i "Add Cowboy 1.0.0 to the list of dependencies"
  439. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy = hex 1.0.0\n"}' $(APP)/Makefile
  440. ifdef LEGACY
  441. $i "Add Cowboy to the applications key in the .app.src file"
  442. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  443. endif
  444. $i "Build the application"
  445. $t $(MAKE) -C $(APP) $v
  446. $i "Check that all dependencies were fetched"
  447. $t test -d $(APP)/deps/cowboy
  448. $t test -d $(APP)/deps/cowlib
  449. $t test -d $(APP)/deps/ranch
  450. $i "Check that the application was compiled correctly"
  451. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  452. [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
  453. {ok, Deps} = application:get_key($(APP), applications), \
  454. true = lists:member(cowboy, Deps), \
  455. {ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
  456. halt()"
  457. core-deps-fetch-hg: init
  458. $i "Bootstrap a new OTP library named $(APP)"
  459. $t mkdir $(APP)/
  460. $t cp ../erlang.mk $(APP)/
  461. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  462. $i "Add Ehsa 4.0.3 to the list of dependencies"
  463. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = ehsa\ndep_ehsa = hg https://bitbucket.org/a12n/ehsa 4.0.3\n"}' $(APP)/Makefile
  464. ifdef LEGACY
  465. $i "Add ehsa to the applications key in the .app.src file"
  466. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tehsa,\n"}' $(APP)/src/$(APP).app.src
  467. endif
  468. $i "Build the application"
  469. $t $(MAKE) -C $(APP) $v
  470. $i "Check that all dependencies were fetched"
  471. $t test -d $(APP)/deps/ehsa
  472. $i "Check that the application was compiled correctly"
  473. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  474. [ok = application:load(App) || App <- [$(APP), ehsa]], \
  475. {ok, Deps} = application:get_key($(APP), applications), \
  476. true = lists:member(ehsa, Deps), \
  477. {ok, \"4.0.3\"} = application:get_key(ehsa, vsn), \
  478. halt()"
  479. # Legacy must fail for the top-level application, but work for dependencies.
  480. core-deps-fetch-legacy: init
  481. $i "Bootstrap a new OTP library named $(APP)"
  482. $t mkdir $(APP)/
  483. $t cp ../erlang.mk $(APP)/
  484. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  485. $i "Add Cowlib as a dependency using a non-existing fetch method named oops"
  486. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib = https://github.com/ninenines/cowlib 1.0.0\n"}' $(APP)/Makefile
  487. $i "Check that building the application fails"
  488. $t ! $(MAKE) -C $(APP) $v
  489. $i "Check that building the application works with IS_DEP=1"
  490. $t $(MAKE) -C $(APP) IS_DEP=1 $v
  491. core-deps-fetch-ln: init
  492. $i "Bootstrap a new OTP library named $(APP)"
  493. $t mkdir $(APP)/
  494. $t cp ../erlang.mk $(APP)/
  495. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  496. $i "Bootstrap a new OTP library named my_dep inside $(APP)"
  497. $t mkdir $(APP)/my_dep
  498. $t cp ../erlang.mk $(APP)/my_dep/
  499. $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v
  500. $i "Add my_dep to the list of dependencies"
  501. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep\ndep_my_dep = ln $(CURDIR)/$(APP)/my_dep/\n"}' $(APP)/Makefile
  502. ifdef LEGACY
  503. $i "Add my_dep to the applications key in the .app.src file"
  504. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
  505. endif
  506. $i "Build the application"
  507. $t $(MAKE) -C $(APP) $v
  508. $i "Check that all dependencies were fetched"
  509. $t test -d $(APP)/deps/my_dep
  510. $i "Check that the application was compiled correctly"
  511. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  512. [ok = application:load(App) || App <- [$(APP), my_dep]], \
  513. {ok, Deps} = application:get_key($(APP), applications), \
  514. true = lists:member(my_dep, Deps), \
  515. halt()"
  516. core-deps-fetch-svn: init
  517. $i "Bootstrap a new OTP library named $(APP)"
  518. $t mkdir $(APP)/
  519. $t cp ../erlang.mk $(APP)/
  520. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  521. $i "Add Cowlib 1.0.0 to the list of dependencies"
  522. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib = svn https://github.com/ninenines/cowlib/tags/1.0.0\n"}' $(APP)/Makefile
  523. ifdef LEGACY
  524. $i "Add Cowlib to the applications key in the .app.src file"
  525. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowlib,\n"}' $(APP)/src/$(APP).app.src
  526. endif
  527. $i "Build the application"
  528. $t $(MAKE) -C $(APP) $v
  529. $i "Check that all dependencies were fetched"
  530. $t test -d $(APP)/deps/cowlib
  531. $i "Check that the application was compiled correctly"
  532. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  533. [ok = application:load(App) || App <- [$(APP), cowlib]], \
  534. {ok, Deps} = application:get_key($(APP), applications), \
  535. true = lists:member(cowlib, Deps), \
  536. {ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \
  537. halt()"
  538. core-deps-ignore: init
  539. $i "Bootstrap a new OTP library named $(APP)"
  540. $t mkdir $(APP)/
  541. $t cp ../erlang.mk $(APP)/
  542. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  543. $i "Add Cowboy to dependencies, Ranch to the ignore list and to test dependencies"
  544. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\nIGNORE_DEPS = ranch\nTEST_DEPS = ranch\n"}' $(APP)/Makefile
  545. ifdef LEGACY
  546. $i "Add Cowboy to the applications key in the .app.src file"
  547. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  548. endif
  549. $i "Build the application"
  550. $t $(MAKE) -C $(APP) $v
  551. $i "Check that the correct dependencies were fetched"
  552. $t test -d $(APP)/deps/cowboy
  553. $t test -d $(APP)/deps/cowlib
  554. $t test ! -e $(APP)/deps/ranch
  555. $i "Build the test dependencies"
  556. $t $(MAKE) -C $(APP) test-deps $v
  557. $i "Check that the correct dependencies were fetched"
  558. $t test -d $(APP)/deps/ranch
  559. define add_dep_and_subdep
  560. $i "Bootstrap a new OTP library named $(APP)_$(1)subdep"
  561. $t mkdir $(APP)_$(1)subdep/
  562. $t cp ../erlang.mk $(APP)_$(1)subdep/
  563. $t $2 -C $(APP)_$(1)subdep --no-print-directory -f erlang.mk bootstrap-lib $$v
  564. $i "Create a Git repository for $(APP)_$(1)subdep"
  565. $t (cd $(APP)_$(1)subdep && \
  566. git init -q && \
  567. git config user.name "Testsuite" && \
  568. git config user.email "testsuite@erlang.mk" && \
  569. git add . && \
  570. git commit -q --no-gpg-sign -m "Initial commit")
  571. $i "Bootstrap a new OTP library named $(APP)_$(1)dep"
  572. $t mkdir $(APP)_$(1)dep/
  573. $t cp ../erlang.mk $(APP)_$(1)dep/
  574. $t $2 -C $(APP)_$(1)dep --no-print-directory -f erlang.mk bootstrap-lib $$v
  575. $i "Add $(APP)_$(1)subdep as a dependency"
  576. $t perl -ni.bak -e \
  577. 'print;if ($$.==1) {print "DEPS = $(1)subdep\ndep_$(1)subdep = git file://$(abspath $(APP)_$(1)subdep) master\n"}' \
  578. $(APP)_$(1)dep/Makefile
  579. $t rm $(APP)_$(1)dep/Makefile.bak
  580. $i "Create a Git repository for $(APP)_$(1)dep"
  581. $t (cd $(APP)_$(1)dep && \
  582. git init -q && \
  583. git config user.name "Testsuite" && \
  584. git config user.email "testsuite@erlang.mk" && \
  585. git add . && \
  586. git commit -q --no-gpg-sign -m "Initial commit")
  587. endef
  588. core-deps-list-deps: init
  589. # We pass $(MAKE) directly so that GNU Make can pass its context forward.
  590. # If we didn't then $(MAKE) would be expanded in the call without context.
  591. $(call add_dep_and_subdep,,$(MAKE))
  592. $(call add_dep_and_subdep,doc,$(MAKE))
  593. $(call add_dep_and_subdep,rel,$(MAKE))
  594. $(call add_dep_and_subdep,test,$(MAKE))
  595. $(call add_dep_and_subdep,shell,$(MAKE))
  596. $i "Bootstrap a new OTP library named $(APP)"
  597. $t mkdir $(APP)/
  598. $t cp ../erlang.mk $(APP)/
  599. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  600. $i "Add $(APP)-dep and $(APP)-testdep as a dependency"
  601. $t sed -i.bak '2i\
  602. DEPS = dep\
  603. DOC_DEPS = docdep\
  604. REL_DEPS = reldep\
  605. TEST_DEPS = testdep\
  606. SHELL_DEPS = shelldep\
  607. dep_dep = git file://$(abspath $(APP)_dep) master\
  608. dep_docdep = git file://$(abspath $(APP)_docdep) master\
  609. dep_reldep = git file://$(abspath $(APP)_reldep) master\
  610. dep_testdep = git file://$(abspath $(APP)_testdep) master\
  611. dep_shelldep = git file://$(abspath $(APP)_shelldep) master\
  612. ' $(APP)/Makefile
  613. $t rm $(APP)/Makefile.bak
  614. $i "Create a Git repository for $(APP)"
  615. $t (cd $(APP) && \
  616. git init -q && \
  617. git config user.name "Testsuite" && \
  618. git config user.email "testsuite@erlang.mk" && \
  619. git add . && \
  620. git commit -q --no-gpg-sign -m "Initial commit")
  621. $i "List application dependencies"
  622. $t $(MAKE) -C $(APP) --no-print-directory list-deps $v
  623. $t test -d $(APP)/deps/subdep
  624. $t printf "%s\n%s\n" $(abspath $(APP)/deps/dep $(APP)/deps/subdep) > $(APP)/expected-deps.txt
  625. $t cmp $(APP)/expected-deps.txt $(APP)/.erlang.mk/recursive-deps-list.log
  626. $t $(MAKE) -C $(APP) --no-print-directory distclean $v
  627. $i "List application doc dependencies"
  628. $t $(MAKE) -C $(APP) --no-print-directory list-doc-deps $v
  629. $t test -d $(APP)/deps/subdep
  630. $t test -d $(APP)/deps/docsubdep
  631. $t printf "%s\n%s\n%s\n%s\n" \
  632. $(abspath $(APP)/deps/dep $(APP)/deps/subdep $(APP)/deps/docdep $(APP)/deps/docsubdep) \
  633. | sort > $(APP)/expected-doc-deps.txt
  634. $t cmp $(APP)/expected-doc-deps.txt $(APP)/.erlang.mk/recursive-doc-deps-list.log
  635. $t $(MAKE) -C $(APP) --no-print-directory distclean $v
  636. $i "List application rel dependencies"
  637. $t $(MAKE) -C $(APP) --no-print-directory list-rel-deps $v
  638. $t test -d $(APP)/deps/subdep
  639. $t test -d $(APP)/deps/relsubdep
  640. $t printf "%s\n%s\n%s\n%s\n" \
  641. $(abspath $(APP)/deps/dep $(APP)/deps/subdep $(APP)/deps/reldep $(APP)/deps/relsubdep) \
  642. | sort > $(APP)/expected-rel-deps.txt
  643. $t cmp $(APP)/expected-rel-deps.txt $(APP)/.erlang.mk/recursive-rel-deps-list.log
  644. $t $(MAKE) -C $(APP) --no-print-directory distclean $v
  645. $i "List application test dependencies"
  646. $t $(MAKE) -C $(APP) --no-print-directory list-test-deps $v
  647. $t test -d $(APP)/deps/subdep
  648. $t test -d $(APP)/deps/testsubdep
  649. $t printf "%s\n%s\n%s\n%s\n" \
  650. $(abspath $(APP)/deps/dep $(APP)/deps/subdep $(APP)/deps/testdep $(APP)/deps/testsubdep) \
  651. | sort > $(APP)/expected-test-deps.txt
  652. $t cmp $(APP)/expected-test-deps.txt $(APP)/.erlang.mk/recursive-test-deps-list.log
  653. $t $(MAKE) -C $(APP) --no-print-directory distclean $v
  654. $i "List application shell dependencies"
  655. $t $(MAKE) -C $(APP) --no-print-directory list-shell-deps $v
  656. $t test -d $(APP)/deps/subdep
  657. $t test -d $(APP)/deps/shellsubdep
  658. $t printf "%s\n%s\n%s\n%s\n" \
  659. $(abspath $(APP)/deps/dep $(APP)/deps/subdep $(APP)/deps/shelldep $(APP)/deps/shellsubdep) \
  660. | sort > $(APP)/expected-shell-deps.txt
  661. $t cmp $(APP)/expected-shell-deps.txt $(APP)/.erlang.mk/recursive-shell-deps-list.log
  662. $t $(MAKE) -C $(APP) --no-print-directory distclean $v
  663. $i "List application all dependencies (all kinds)"
  664. $t $(MAKE) -C $(APP) --no-print-directory list-deps DEP_TYPES='doc rel test shell' $v
  665. $t test -d $(APP)/deps/subdep
  666. $t test -d $(APP)/deps/docsubdep
  667. $t test -d $(APP)/deps/relsubdep
  668. $t test -d $(APP)/deps/testsubdep
  669. $t test -d $(APP)/deps/shellsubdep
  670. $t printf "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n" \
  671. $(abspath \
  672. $(APP)/deps/dep $(APP)/deps/subdep \
  673. $(APP)/deps/docdep $(APP)/deps/docsubdep \
  674. $(APP)/deps/reldep $(APP)/deps/relsubdep \
  675. $(APP)/deps/testdep $(APP)/deps/testsubdep \
  676. $(APP)/deps/shelldep $(APP)/deps/shellsubdep) \
  677. | sort > $(APP)/expected-all-deps.txt
  678. $t cmp $(APP)/expected-all-deps.txt $(APP)/.erlang.mk/recursive-deps-list.log
  679. $t $(MAKE) -C $(APP) --no-print-directory distclean $v
  680. core-deps-list-deps-with-apps: init
  681. # We pass $(MAKE) directly so that GNU Make can pass its context forward.
  682. # If we didn't then $(MAKE) would be expanded in the call without context.
  683. $(call add_dep_and_subdep,,$(MAKE))
  684. $i "Bootstrap a new OTP library named $(APP)"
  685. $t mkdir $(APP)/
  686. $t cp ../erlang.mk $(APP)/
  687. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  688. $i "Bootstrap another APP named $(APP)_app in $(APP) repository"
  689. $t $(MAKE) -C $(APP) --no-print-directory new-lib in=my_app $v
  690. $i "Bootstrap another APP named $(APP)_dep_app in $(APP)_dep repository"
  691. $t $(MAKE) -C $(APP)_dep --no-print-directory new-lib in=my_dep_app $v
  692. $t sed -i.bak '2i\
  693. APPS_DIR := $$(CURDIR)/apps\
  694. LOCAL_DEPS = my_dep_app ssl\
  695. ' $(APP)_dep/Makefile
  696. $t echo 'unexport APPS_DIR' >> $(APP)_dep/Makefile
  697. $t rm $(APP)_dep/Makefile.bak
  698. $t git -C $(APP)_dep add .
  699. $t git -C $(APP)_dep commit -q --no-gpg-sign -m "Add application"
  700. $i "Add $(APP)-dep as a dependency"
  701. $t sed -i.bak '2i\
  702. DEPS = dep\
  703. dep_dep = git file://$(abspath $(APP)_dep) master\
  704. ' $(APP)/Makefile
  705. $t rm $(APP)/Makefile.bak
  706. $i "Create a Git repository for $(APP)"
  707. $t (cd $(APP) && \
  708. git init -q && \
  709. git config user.name "Testsuite" && \
  710. git config user.email "testsuite@erlang.mk" && \
  711. git add . && \
  712. git commit -q --no-gpg-sign -m "Initial commit")
  713. $i "List application dependencies ($(APP)_app is missing)"
  714. $t $(MAKE) -C $(APP) --no-print-directory list-deps $v
  715. $t test -d $(APP)/deps/subdep
  716. $t printf "%s\n%s\n%s\n" $(abspath $(APP)/deps/dep $(APP)/deps/dep/apps/my_dep_app $(APP)/deps/subdep) > $(APP)/expected-deps.txt
  717. $t cmp $(APP)/expected-deps.txt $(APP)/.erlang.mk/recursive-deps-list.log
  718. $t $(MAKE) -C $(APP) --no-print-directory distclean $v
  719. $i "Add $(APP)_app as a dependency"
  720. $t sed -i.bak '3i\
  721. LOCAL_DEPS = my_app\
  722. ' $(APP)/Makefile
  723. $t rm $(APP)/Makefile.bak
  724. $i "List application dependencies ($(APP)_app is listed)"
  725. $t $(MAKE) -C $(APP) --no-print-directory list-deps $v
  726. $t test -d $(APP)/deps/subdep
  727. $t printf "%s\n%s\n%s\n%s\n" $(abspath $(APP)/apps/my_app $(APP)/deps/dep $(APP)/deps/dep/apps/my_dep_app $(APP)/deps/subdep) > $(APP)/expected-deps.txt
  728. $t cmp $(APP)/expected-deps.txt $(APP)/.erlang.mk/recursive-deps-list.log
  729. $t $(MAKE) -C $(APP) --no-print-directory distclean $v
  730. core-deps-list-deps-with-specified-full-var: init
  731. # We pass $(MAKE) directly so that GNU Make can pass its context forward.
  732. # If we didn't then $(MAKE) would be expanded in the call without context.
  733. $(call add_dep_and_subdep,,$(MAKE))
  734. $i "Bootstrap a new OTP library named $(APP)"
  735. $t mkdir $(APP)/
  736. $t cp ../erlang.mk $(APP)/
  737. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  738. $i "Add $(APP)-dep as a dependency"
  739. $t sed -i.bak '2i\
  740. DEPS = dep\
  741. dep_dep = git file://$(abspath $(APP)_dep) master\
  742. ' $(APP)/Makefile
  743. $t rm $(APP)/Makefile.bak
  744. $i "Create a Git repository for $(APP)"
  745. $t (cd $(APP) && \
  746. git init -q && \
  747. git config user.name "Testsuite" && \
  748. git config user.email "testsuite@erlang.mk" && \
  749. git add . && \
  750. git commit -q --no-gpg-sign -m "Initial commit")
  751. $i "Build application"
  752. $t $(MAKE) -C $(APP) --no-print-directory $v
  753. $t test -d $(APP)/deps/subdep
  754. $i "List application dependencies without FULL"
  755. $t $(MAKE) -C $(APP) --no-print-directory list-deps $v
  756. $t printf "%s\n%s\n" $(abspath $(APP)/deps/dep $(APP)/deps/subdep) > $(APP)/expected-deps.txt
  757. $t cmp $(APP)/expected-deps.txt $(APP)/.erlang.mk/recursive-deps-list.log
  758. $i "List application dependencies with empty FULL"
  759. $t $(MAKE) -C $(APP) --no-print-directory list-deps FULL= $v
  760. $t printf "%s\n%s\n" $(abspath $(APP)/deps/dep $(APP)/deps/subdep) > $(APP)/expected-deps.txt
  761. $t cmp $(APP)/expected-deps.txt $(APP)/.erlang.mk/recursive-deps-list.log
  762. $i "List application dependencies with FULL=1"
  763. $t $(MAKE) -C $(APP) --no-print-directory list-deps FULL=1 $v
  764. $t printf "%s\n%s\n" $(abspath $(APP)/deps/dep $(APP)/deps/subdep) > $(APP)/expected-deps.txt
  765. $t cmp $(APP)/expected-deps.txt $(APP)/.erlang.mk/recursive-deps-list.log
  766. $t $(MAKE) -C $(APP) --no-print-directory distclean $v
  767. core-deps-makefile-change: init
  768. $i "Bootstrap a new OTP application named $(APP)"
  769. $t mkdir $(APP)/
  770. $t cp ../erlang.mk $(APP)/
  771. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
  772. $i "Build the application"
  773. $t $(MAKE) -C $(APP) $v
  774. $i "Add Cowlib to the list of dependencies"
  775. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/Makefile
  776. ifdef LEGACY
  777. $i "Add Cowlib to the applications key in the .app.src file"
  778. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowlib,\n"}' $(APP)/src/$(APP).app.src
  779. endif
  780. $i "Build the application again"
  781. $t $(MAKE) -C $(APP) $v
  782. $i "Check that Cowlib was included in the .app file"
  783. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  784. ok = application:load($(APP)), \
  785. {ok, Apps} = application:get_key($(APP), applications), \
  786. true = lists:member(cowlib, Apps), \
  787. halt()."
  788. core-deps-dep-makefile-change: init
  789. $i "Bootstrap a new OTP application named $(APP)"
  790. $t mkdir $(APP)/
  791. $t cp ../erlang.mk $(APP)/
  792. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
  793. $i "Bootstrap a new OTP library named my_dep inside $(APP)"
  794. $t mkdir $(APP)/my_dep
  795. $t cp ../erlang.mk $(APP)/my_dep/
  796. $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v
  797. $i "Add my_dep to the list of dependencies"
  798. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep\ndep_my_dep = ln $(CURDIR)/$(APP)/my_dep/\n"}' $(APP)/Makefile
  799. ifdef LEGACY
  800. $i "Add my_dep to the applications key in the .app.src file"
  801. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
  802. endif
  803. $i "Build the application"
  804. $t $(MAKE) -C $(APP) NO_AUTOPATCH=my_dep $v
  805. $i "Add Cowlib to the list of dependencies in my_dep"
  806. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/my_dep/Makefile
  807. ifdef LEGACY
  808. $i "Add Cowlib to the applications key in my_dep's .app.src file"
  809. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowlib,\n"}' $(APP)/my_dep/src/my_dep.app.src
  810. endif
  811. $i "Build the application again"
  812. $t $(MAKE) -C $(APP) $v
  813. $i "Check that Cowlib was included in my_dep's .app file"
  814. $t $(ERL) -pa $(APP)/my_dep/ebin/ -eval " \
  815. ok = application:load(my_dep), \
  816. {ok, Apps} = application:get_key(my_dep, applications), \
  817. true = lists:member(cowlib, Apps), \
  818. halt()."
  819. core-deps-mv: init
  820. $i "Bootstrap a new OTP library named $(APP)"
  821. $t mkdir $(APP)/
  822. $t cp ../erlang.mk $(APP)/
  823. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  824. $i "Add Cowlib to the list of dependencies"
  825. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/Makefile
  826. $i "Build the application"
  827. $t $(MAKE) -C $(APP) $v
  828. $i "Check that all dependencies were fetched"
  829. $t test -d $(APP)/deps/cowlib
  830. $i "Move the application elsewhere"
  831. $t mv $(APP) $(APP)-moved
  832. $i "Build the application"
  833. $t $(MAKE) -C $(APP)-moved $v
  834. core-deps-mv-rebar: init
  835. $i "Bootstrap a new OTP library named $(APP)"
  836. $t mkdir $(APP)/
  837. $t cp ../erlang.mk $(APP)/
  838. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  839. $i "Add Lager to the list of dependencies"
  840. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = lager\n"}' $(APP)/Makefile
  841. $i "Build the application"
  842. $t $(MAKE) -C $(APP) $v
  843. $i "Check that all dependencies were fetched"
  844. $t test -d $(APP)/deps/goldrush
  845. $t test -d $(APP)/deps/lager
  846. $i "Move the application elsewhere"
  847. $t mv $(APP) $(APP)-moved
  848. $i "Build the application"
  849. $t $(MAKE) -C $(APP)-moved $v
  850. # A lower-level dependency of the first dependency always
  851. # wins over a lower-level dependency of the second dependency.
  852. core-deps-order-first: init
  853. $i "Bootstrap a new OTP library named $(APP)"
  854. $t mkdir $(APP)/
  855. $t cp ../erlang.mk $(APP)/
  856. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  857. $i "Add Cowboy package and my_dep to the list of dependencies"
  858. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep cowboy\ndep_my_dep = cp $(CURDIR)/$(APP)/my_dep/\n"}' $(APP)/Makefile
  859. $i "Bootstrap a new OTP library named my_dep inside $(APP)"
  860. $t mkdir $(APP)/my_dep
  861. $t cp ../erlang.mk $(APP)/my_dep/
  862. $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v
  863. $i "Add Cowlib 1.0.0 to the list of dependencies for my_dep"
  864. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib = git https://github.com/ninenines/cowlib 1.0.0\n"}' $(APP)/my_dep/Makefile
  865. ifdef LEGACY
  866. $i "Add Cowboy and my_dep to the applications key in the .app.src file"
  867. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
  868. endif
  869. $i "Build the application"
  870. $t $(MAKE) -C $(APP) $v
  871. $i "Check that all dependencies were fetched"
  872. $t test -d $(APP)/deps/cowboy
  873. $t test -d $(APP)/deps/cowlib
  874. $t test -d $(APP)/deps/my_dep
  875. $t test -d $(APP)/deps/ranch
  876. $i "Check that the application was compiled correctly"
  877. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  878. [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, my_dep, ranch]], \
  879. {ok, Deps} = application:get_key($(APP), applications), \
  880. true = lists:member(cowboy, Deps), \
  881. {ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \
  882. halt()"
  883. # A higher-level dependency always wins.
  884. core-deps-order-top: init
  885. $i "Bootstrap a new OTP library named $(APP)"
  886. $t mkdir $(APP)/
  887. $t cp ../erlang.mk $(APP)/
  888. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  889. $i "Add Cowboy package and Cowlib 1.0.0 to the list of dependencies"
  890. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy cowlib\ndep_cowlib = git https://github.com/ninenines/cowlib 1.0.0\n"}' $(APP)/Makefile
  891. ifdef LEGACY
  892. $i "Add Cowboy to the applications key in the .app.src file"
  893. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  894. endif
  895. $i "Build the application"
  896. $t $(MAKE) -C $(APP) $v
  897. $i "Check that all dependencies were fetched"
  898. $t test -d $(APP)/deps/cowboy
  899. $t test -d $(APP)/deps/cowlib
  900. $t test -d $(APP)/deps/ranch
  901. $i "Check that the application was compiled correctly"
  902. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  903. [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
  904. {ok, Deps} = application:get_key($(APP), applications), \
  905. true = lists:member(cowboy, Deps), \
  906. {ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \
  907. halt()"
  908. ifndef LEGACY
  909. core-deps-otp: init
  910. $i "Bootstrap a new OTP library named $(APP)"
  911. $t mkdir $(APP)/
  912. $t cp ../erlang.mk $(APP)/
  913. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  914. $i "Add Crypto to the list of OTP dependencies"
  915. $t perl -ni.bak -e 'print;if ($$.==1) {print "LOCAL_DEPS = crypto\n"}' $(APP)/Makefile
  916. $i "Build the application"
  917. $t $(MAKE) -C $(APP) $v
  918. $i "Check that no dependencies were fetched"
  919. $t test ! -e $(APP)/deps
  920. $i "Check that the application was compiled correctly"
  921. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  922. [ok = application:load(App) || App <- [$(APP), crypto]], \
  923. {ok, Deps} = application:get_key($(APP), applications), \
  924. true = lists:member(crypto, Deps), \
  925. halt()"
  926. endif
  927. core-deps-pkg: init
  928. $i "Bootstrap a new OTP library named $(APP)"
  929. $t mkdir $(APP)/
  930. $t cp ../erlang.mk $(APP)/
  931. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  932. $i "Add Cowboy to the list of dependencies"
  933. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\n"}' $(APP)/Makefile
  934. ifdef LEGACY
  935. $i "Add Cowboy to the applications key in the .app.src file"
  936. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  937. endif
  938. $i "Build the application"
  939. $t $(MAKE) -C $(APP) $v
  940. $i "Check that all dependencies were fetched"
  941. $t test -d $(APP)/deps/cowboy
  942. $t test -d $(APP)/deps/cowlib
  943. $t test -d $(APP)/deps/ranch
  944. $i "Check that the application was compiled correctly"
  945. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  946. [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
  947. {ok, Deps} = application:get_key($(APP), applications), \
  948. true = lists:member(cowboy, Deps), \
  949. halt()"
  950. core-deps-rel: init
  951. $i "Bootstrap a new release-enabled OTP library named $(APP)"
  952. $t mkdir $(APP)/
  953. $t cp ../erlang.mk $(APP)/
  954. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib bootstrap-rel $v
  955. $i "Add Recon to the list of release dependencies"
  956. $t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = recon\n"}' $(APP)/Makefile
  957. $i "Add Recon to the relx.config file"
  958. $t $(ERL) -eval " \
  959. {ok, Conf0} = file:consult(\"$(APP)/relx.config\"), \
  960. Conf = lists:keyreplace(release, 1, Conf0, {release, {$(APP)_release, \"1\"}, [$(APP), recon]}), \
  961. ok = file:write_file(\"$(APP)/relx.config\", \
  962. lists:map(fun(Term) -> io_lib:format(\"~p.~n\", [Term]) end, Conf)), \
  963. halt()"
  964. $i "Build the application and its dependencies"
  965. $t $(MAKE) -C $(APP) deps app $v
  966. $i "Check that no dependencies were fetched"
  967. $t test ! -e $(APP)/deps
  968. $i "Check that the application was compiled correctly"
  969. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  970. [ok = application:load(App) || App <- [$(APP)]], \
  971. {ok, Deps} = application:get_key($(APP), applications), \
  972. false = lists:member(recon, Deps), \
  973. halt()"
  974. $i "Build the release"
  975. $t $(MAKE) -C $(APP) $v
  976. $i "Check that all dependencies were fetched"
  977. $t test -d $(APP)/deps/recon
  978. $i "Check that the application was compiled correctly"
  979. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  980. [ok = application:load(App) || App <- [$(APP), recon]], \
  981. {ok, Deps} = application:get_key($(APP), applications), \
  982. false = lists:member(recon, Deps), \
  983. halt()"
  984. # @todo Add check for MSYS2 when releases under Windows become usable.
  985. # $i "Start the release and check that Recon is loaded"
  986. ifeq ($(PLATFORM),msys2)
  987. # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd install $v
  988. # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd start $v
  989. # $t test -n "`$(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd rpcterms \
  990. # application loaded_applications | grep recon`"
  991. # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd stop $v
  992. # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd uninstall $v
  993. else
  994. $i "Start the release and check that Recon is loaded"
  995. $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release start $v
  996. $t apps="Node is not running!"; \
  997. while test "$$apps" = "Node is not running!"; do \
  998. apps=$$($(APP)/_rel/$(APP)_release/bin/$(APP)_release \
  999. rpcterms \ application loaded_applications); \
  1000. done; \
  1001. echo "$$apps" | grep -q recon
  1002. $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release stop $v
  1003. endif
  1004. core-deps-search: init
  1005. $i "Bootstrap a new OTP library named $(APP)"
  1006. $t mkdir $(APP)/
  1007. $t cp ../erlang.mk $(APP)/
  1008. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  1009. $i "Run 'make search' and check that it prints packages"
  1010. $t test -n "`$(MAKE) -C $(APP) search`"
  1011. $i "Run 'make search q=cowboy' and check that it prints packages"
  1012. $t test -n "`$(MAKE) -C $(APP) search q=cowboy`"
  1013. core-deps-shell: init
  1014. $i "Bootstrap a new OTP library named $(APP)"
  1015. $t mkdir $(APP)/
  1016. $t cp ../erlang.mk $(APP)/
  1017. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  1018. $i "Add TDDReloader to the list of shell dependencies"
  1019. $t perl -ni.bak -e 'print;if ($$.==1) {print "SHELL_DEPS = tddreloader\n"}' $(APP)/Makefile
  1020. $i "Build the application and its dependencies"
  1021. $t $(MAKE) -C $(APP) deps app $v
  1022. $i "Check that no dependencies were fetched"
  1023. $t test ! -e $(APP)/deps
  1024. $i "Check that the application was compiled correctly"
  1025. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  1026. [ok = application:load(App) || App <- [$(APP)]], \
  1027. {ok, Deps} = application:get_key($(APP), applications), \
  1028. false = lists:member(tddreloader, Deps), \
  1029. halt()"
  1030. $i "Run the shell"
  1031. $t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval \" \
  1032. ok = application:load($(APP)), \
  1033. ok = application:load(tddreloader), \
  1034. halt()\"" $v
  1035. $i "Check that all dependencies were fetched"
  1036. $t test -d $(APP)/deps/tddreloader
  1037. $i "Check that the application was compiled correctly"
  1038. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  1039. [ok = application:load(App) || App <- [$(APP), tddreloader]], \
  1040. {ok, Deps} = application:get_key($(APP), applications), \
  1041. false = lists:member(tddreloader, Deps), \
  1042. halt()"
  1043. core-deps-skip: init
  1044. $i "Bootstrap a new OTP library named $(APP)"
  1045. $t mkdir $(APP)/
  1046. $t cp ../erlang.mk $(APP)/
  1047. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  1048. $i "Add Cowboy to the list of dependencies"
  1049. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\n"}' $(APP)/Makefile
  1050. ifdef LEGACY
  1051. $i "Add Cowboy to the applications key in the .app.src file"
  1052. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  1053. endif
  1054. $i "Build the application with SKIP_DEPS=1"
  1055. $t $(MAKE) -C $(APP) SKIP_DEPS=1 $v
  1056. $i "Check that no dependencies were fetched"
  1057. $t test ! -e $(APP)/deps
  1058. $i "Build the application"
  1059. $t $(MAKE) -C $(APP) $v
  1060. $i "Check that all dependencies were fetched"
  1061. $t test -d $(APP)/deps/cowlib
  1062. $t test -d $(APP)/deps/cowboy
  1063. $t test -d $(APP)/deps/ranch
  1064. $i "Distclean with SKIP_DEPS=1"
  1065. $t $(MAKE) -C $(APP) distclean SKIP_DEPS=1 $v
  1066. $i "Check that no dependencies were removed"
  1067. $t test -d $(APP)/deps/cowlib
  1068. $t test -d $(APP)/deps/cowboy
  1069. $t test -d $(APP)/deps/ranch
  1070. core-deps-test: init
  1071. $i "Bootstrap a new OTP library named $(APP)"
  1072. $t mkdir $(APP)/
  1073. $t cp ../erlang.mk $(APP)/
  1074. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  1075. $i "Generate .erl files"
  1076. $t echo "-module(boy)." > $(APP)/src/boy.erl
  1077. $t echo "-module(girl)." > $(APP)/src/girl.erl
  1078. $i "Add triq to the list of test dependencies"
  1079. $t perl -ni.bak -e 'print;if ($$.==1) {print "TEST_DEPS = triq\n"}' $(APP)/Makefile
  1080. $i "Build the application and its dependencies"
  1081. $t $(MAKE) -C $(APP) deps app $v
  1082. $i "Check that no dependencies were fetched"
  1083. $t test ! -e $(APP)/deps
  1084. $i "Check that the application was compiled correctly"
  1085. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  1086. [ok = application:load(App) || App <- [$(APP)]], \
  1087. {ok, Deps} = application:get_key($(APP), applications), \
  1088. false = lists:member(triq, Deps), \
  1089. halt()"
  1090. $i "Run tests"
  1091. $t $(MAKE) -C $(APP) tests $v
  1092. $i "Check that all dependencies were fetched"
  1093. $t test -d $(APP)/deps/triq
  1094. $i "Check that the application was compiled correctly"
  1095. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  1096. [ok = application:load(App) || App <- [$(APP), triq]], \
  1097. {ok, Deps} = application:get_key($(APP), applications), \
  1098. false = lists:member(triq, Deps), \
  1099. halt()"