core_deps.mk 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413
  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_rebuild_dep\` returns false"
  146. $t touch $(APP)/EXPECT
  147. $t $(SLEEP)
  148. $t $(MAKE) -C $(APP) force_rebuild_dep='test $$(1) != $(CURDIR)/$(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_rebuild_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_rebuild_dep='test $$(1) = $(CURDIR)/$(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. # We use force_rebuild_dep to ensure it gets rebuilt even on Windows.
  799. $t perl -ni.bak -e "print;if ($$.==1) {print \"DEPS = my_dep\ndep_my_dep = ln $(CURDIR)/$(APP)/my_dep/\nforce_rebuild_dep = test \";print '\$$1';print \" = $(CURDIR)/$(APP)/deps/my_dep\n\"}" $(APP)/Makefile
  800. ifdef LEGACY
  801. $i "Add my_dep to the applications key in the .app.src file"
  802. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
  803. endif
  804. $i "Build the application"
  805. $t $(MAKE) -C $(APP) NO_AUTOPATCH=my_dep $v
  806. $i "Add Cowlib to the list of dependencies in my_dep"
  807. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib_commit = master\n"}' $(APP)/deps/my_dep/Makefile
  808. ifdef LEGACY
  809. $i "Add Cowlib to the applications key in my_dep's .app.src file"
  810. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowlib,\n"}' $(APP)/deps/my_dep/src/my_dep.app.src
  811. endif
  812. $i "Build the application again"
  813. $t $(MAKE) -C $(APP) $v
  814. $i "Check that Cowlib was included in my_dep's .app file"
  815. $t $(ERL) -pa $(APP)/deps/my_dep/ebin/ -eval " \
  816. ok = application:load(my_dep), \
  817. {ok, Apps} = application:get_key(my_dep, applications), \
  818. true = lists:member(cowlib, Apps), \
  819. halt()."
  820. core-deps-mv: init
  821. $i "Bootstrap a new OTP library named $(APP)"
  822. $t mkdir $(APP)/
  823. $t cp ../erlang.mk $(APP)/
  824. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  825. $i "Add Cowlib to the list of dependencies"
  826. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/Makefile
  827. $i "Build the application"
  828. $t $(MAKE) -C $(APP) $v
  829. $i "Check that all dependencies were fetched"
  830. $t test -d $(APP)/deps/cowlib
  831. $i "Move the application elsewhere"
  832. $t mv $(APP) $(APP)-moved
  833. $i "Build the application"
  834. $t $(MAKE) -C $(APP)-moved $v
  835. core-deps-mv-rebar: init
  836. $i "Bootstrap a new OTP library named $(APP)"
  837. $t mkdir $(APP)/
  838. $t cp ../erlang.mk $(APP)/
  839. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  840. $i "Add Lager to the list of dependencies"
  841. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = lager\n"}' $(APP)/Makefile
  842. $i "Build the application"
  843. $t $(MAKE) -C $(APP) $v
  844. $i "Check that all dependencies were fetched"
  845. $t test -d $(APP)/deps/goldrush
  846. $t test -d $(APP)/deps/lager
  847. $i "Move the application elsewhere"
  848. $t mv $(APP) $(APP)-moved
  849. $i "Build the application"
  850. $t $(MAKE) -C $(APP)-moved $v
  851. # A lower-level dependency of the first dependency always
  852. # wins over a lower-level dependency of the second dependency.
  853. core-deps-order-first: init
  854. $i "Bootstrap a new OTP library named $(APP)"
  855. $t mkdir $(APP)/
  856. $t cp ../erlang.mk $(APP)/
  857. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  858. $i "Add Cowboy package and my_dep to the list of dependencies"
  859. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep cowboy\ndep_my_dep = cp $(CURDIR)/$(APP)/my_dep/\n"}' $(APP)/Makefile
  860. $i "Bootstrap a new OTP library named my_dep inside $(APP)"
  861. $t mkdir $(APP)/my_dep
  862. $t cp ../erlang.mk $(APP)/my_dep/
  863. $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v
  864. $i "Add Cowlib 1.0.0 to the list of dependencies for my_dep"
  865. $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
  866. ifdef LEGACY
  867. $i "Add Cowboy and my_dep to the applications key in the .app.src file"
  868. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
  869. endif
  870. $i "Build the application"
  871. $t $(MAKE) -C $(APP) $v
  872. $i "Check that all dependencies were fetched"
  873. $t test -d $(APP)/deps/cowboy
  874. $t test -d $(APP)/deps/cowlib
  875. $t test -d $(APP)/deps/my_dep
  876. $t test -d $(APP)/deps/ranch
  877. $i "Check that the application was compiled correctly"
  878. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  879. [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, my_dep, ranch]], \
  880. {ok, Deps} = application:get_key($(APP), applications), \
  881. true = lists:member(cowboy, Deps), \
  882. {ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \
  883. halt()"
  884. # A higher-level dependency always wins.
  885. core-deps-order-top: init
  886. $i "Bootstrap a new OTP library named $(APP)"
  887. $t mkdir $(APP)/
  888. $t cp ../erlang.mk $(APP)/
  889. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  890. $i "Add Cowboy package and Cowlib 1.0.0 to the list of dependencies"
  891. $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
  892. ifdef LEGACY
  893. $i "Add Cowboy to the applications key in the .app.src file"
  894. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  895. endif
  896. $i "Build the application"
  897. $t $(MAKE) -C $(APP) $v
  898. $i "Check that all dependencies were fetched"
  899. $t test -d $(APP)/deps/cowboy
  900. $t test -d $(APP)/deps/cowlib
  901. $t test -d $(APP)/deps/ranch
  902. $i "Check that the application was compiled correctly"
  903. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  904. [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
  905. {ok, Deps} = application:get_key($(APP), applications), \
  906. true = lists:member(cowboy, Deps), \
  907. {ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \
  908. halt()"
  909. ifndef LEGACY
  910. core-deps-otp: init
  911. $i "Bootstrap a new OTP library named $(APP)"
  912. $t mkdir $(APP)/
  913. $t cp ../erlang.mk $(APP)/
  914. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  915. $i "Add Crypto to the list of OTP dependencies"
  916. $t perl -ni.bak -e 'print;if ($$.==1) {print "LOCAL_DEPS = crypto\n"}' $(APP)/Makefile
  917. $i "Build the application"
  918. $t $(MAKE) -C $(APP) $v
  919. $i "Check that no dependencies were fetched"
  920. $t test ! -e $(APP)/deps
  921. $i "Check that the application was compiled correctly"
  922. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  923. [ok = application:load(App) || App <- [$(APP), crypto]], \
  924. {ok, Deps} = application:get_key($(APP), applications), \
  925. true = lists:member(crypto, Deps), \
  926. halt()"
  927. endif
  928. core-deps-pkg: init
  929. $i "Bootstrap a new OTP library named $(APP)"
  930. $t mkdir $(APP)/
  931. $t cp ../erlang.mk $(APP)/
  932. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  933. $i "Add Cowboy to the list of dependencies"
  934. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\n"}' $(APP)/Makefile
  935. ifdef LEGACY
  936. $i "Add Cowboy to the applications key in the .app.src file"
  937. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  938. endif
  939. $i "Build the application"
  940. $t $(MAKE) -C $(APP) $v
  941. $i "Check that all dependencies were fetched"
  942. $t test -d $(APP)/deps/cowboy
  943. $t test -d $(APP)/deps/cowlib
  944. $t test -d $(APP)/deps/ranch
  945. $i "Check that the application was compiled correctly"
  946. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  947. [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
  948. {ok, Deps} = application:get_key($(APP), applications), \
  949. true = lists:member(cowboy, Deps), \
  950. halt()"
  951. core-deps-rel: init
  952. $i "Bootstrap a new release-enabled OTP library named $(APP)"
  953. $t mkdir $(APP)/
  954. $t cp ../erlang.mk $(APP)/
  955. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib bootstrap-rel $v
  956. $i "Add Recon to the list of release dependencies"
  957. $t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = recon\n"}' $(APP)/Makefile
  958. $i "Add Recon to the relx.config file"
  959. $t $(ERL) -eval " \
  960. {ok, Conf0} = file:consult(\"$(APP)/relx.config\"), \
  961. Conf = lists:keyreplace(release, 1, Conf0, {release, {$(APP)_release, \"1\"}, [$(APP), recon]}), \
  962. ok = file:write_file(\"$(APP)/relx.config\", \
  963. lists:map(fun(Term) -> io_lib:format(\"~p.~n\", [Term]) end, Conf)), \
  964. halt()"
  965. $i "Build the application and its dependencies"
  966. $t $(MAKE) -C $(APP) deps app $v
  967. $i "Check that no dependencies were fetched"
  968. $t test ! -e $(APP)/deps
  969. $i "Check that the application was compiled correctly"
  970. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  971. [ok = application:load(App) || App <- [$(APP)]], \
  972. {ok, Deps} = application:get_key($(APP), applications), \
  973. false = lists:member(recon, Deps), \
  974. halt()"
  975. $i "Build the release"
  976. $t $(MAKE) -C $(APP) $v
  977. $i "Check that all dependencies were fetched"
  978. $t test -d $(APP)/deps/recon
  979. $i "Check that the application was compiled correctly"
  980. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  981. [ok = application:load(App) || App <- [$(APP), recon]], \
  982. {ok, Deps} = application:get_key($(APP), applications), \
  983. false = lists:member(recon, Deps), \
  984. halt()"
  985. # @todo Add check for MSYS2 when releases under Windows become usable.
  986. # $i "Start the release and check that Recon is loaded"
  987. ifeq ($(PLATFORM),msys2)
  988. # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd install $v
  989. # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd start $v
  990. # $t test -n "`$(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd rpcterms \
  991. # application loaded_applications | grep recon`"
  992. # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd stop $v
  993. # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd uninstall $v
  994. else
  995. $i "Start the release and check that Recon is loaded"
  996. $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release start $v
  997. $t apps="Node is not running!"; \
  998. while test "$$apps" = "Node is not running!"; do \
  999. apps=$$($(APP)/_rel/$(APP)_release/bin/$(APP)_release \
  1000. rpcterms \ application loaded_applications); \
  1001. done; \
  1002. echo "$$apps" | grep -q recon
  1003. $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release stop $v
  1004. endif
  1005. core-deps-search: init
  1006. $i "Bootstrap a new OTP library named $(APP)"
  1007. $t mkdir $(APP)/
  1008. $t cp ../erlang.mk $(APP)/
  1009. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  1010. $i "Run 'make search' and check that it prints packages"
  1011. $t test -n "`$(MAKE) -C $(APP) search`"
  1012. $i "Run 'make search q=cowboy' and check that it prints packages"
  1013. $t test -n "`$(MAKE) -C $(APP) search q=cowboy`"
  1014. core-deps-shell: init
  1015. $i "Bootstrap a new OTP library named $(APP)"
  1016. $t mkdir $(APP)/
  1017. $t cp ../erlang.mk $(APP)/
  1018. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  1019. $i "Add TDDReloader to the list of shell dependencies"
  1020. $t perl -ni.bak -e 'print;if ($$.==1) {print "SHELL_DEPS = tddreloader\n"}' $(APP)/Makefile
  1021. $i "Build the application and its dependencies"
  1022. $t $(MAKE) -C $(APP) deps app $v
  1023. $i "Check that no dependencies were fetched"
  1024. $t test ! -e $(APP)/deps
  1025. $i "Check that the application was compiled correctly"
  1026. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  1027. [ok = application:load(App) || App <- [$(APP)]], \
  1028. {ok, Deps} = application:get_key($(APP), applications), \
  1029. false = lists:member(tddreloader, Deps), \
  1030. halt()"
  1031. $i "Run the shell"
  1032. $t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval \" \
  1033. ok = application:load($(APP)), \
  1034. ok = application:load(tddreloader), \
  1035. halt()\"" $v
  1036. $i "Check that all dependencies were fetched"
  1037. $t test -d $(APP)/deps/tddreloader
  1038. $i "Check that the application was compiled correctly"
  1039. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  1040. [ok = application:load(App) || App <- [$(APP), tddreloader]], \
  1041. {ok, Deps} = application:get_key($(APP), applications), \
  1042. false = lists:member(tddreloader, Deps), \
  1043. halt()"
  1044. core-deps-skip: init
  1045. $i "Bootstrap a new OTP library named $(APP)"
  1046. $t mkdir $(APP)/
  1047. $t cp ../erlang.mk $(APP)/
  1048. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  1049. $i "Add Cowboy to the list of dependencies"
  1050. $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\n"}' $(APP)/Makefile
  1051. ifdef LEGACY
  1052. $i "Add Cowboy to the applications key in the .app.src file"
  1053. $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
  1054. endif
  1055. $i "Build the application with SKIP_DEPS=1"
  1056. $t $(MAKE) -C $(APP) SKIP_DEPS=1 $v
  1057. $i "Check that no dependencies were fetched"
  1058. $t test ! -e $(APP)/deps
  1059. $i "Build the application"
  1060. $t $(MAKE) -C $(APP) $v
  1061. $i "Check that all dependencies were fetched"
  1062. $t test -d $(APP)/deps/cowlib
  1063. $t test -d $(APP)/deps/cowboy
  1064. $t test -d $(APP)/deps/ranch
  1065. $i "Distclean with SKIP_DEPS=1"
  1066. $t $(MAKE) -C $(APP) distclean SKIP_DEPS=1 $v
  1067. $i "Check that no dependencies were removed"
  1068. $t test -d $(APP)/deps/cowlib
  1069. $t test -d $(APP)/deps/cowboy
  1070. $t test -d $(APP)/deps/ranch
  1071. core-deps-test: init
  1072. $i "Bootstrap a new OTP library named $(APP)"
  1073. $t mkdir $(APP)/
  1074. $t cp ../erlang.mk $(APP)/
  1075. $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
  1076. $i "Generate .erl files"
  1077. $t echo "-module(boy)." > $(APP)/src/boy.erl
  1078. $t echo "-module(girl)." > $(APP)/src/girl.erl
  1079. $i "Add triq to the list of test dependencies"
  1080. $t perl -ni.bak -e 'print;if ($$.==1) {print "TEST_DEPS = triq\n"}' $(APP)/Makefile
  1081. $i "Build the application and its dependencies"
  1082. $t $(MAKE) -C $(APP) deps app $v
  1083. $i "Check that no dependencies were fetched"
  1084. $t test ! -e $(APP)/deps
  1085. $i "Check that the application was compiled correctly"
  1086. $t $(ERL) -pa $(APP)/ebin/ -eval " \
  1087. [ok = application:load(App) || App <- [$(APP)]], \
  1088. {ok, Deps} = application:get_key($(APP), applications), \
  1089. false = lists:member(triq, Deps), \
  1090. halt()"
  1091. $i "Run tests"
  1092. $t $(MAKE) -C $(APP) tests $v
  1093. $i "Check that all dependencies were fetched"
  1094. $t test -d $(APP)/deps/triq
  1095. $i "Check that the application was compiled correctly"
  1096. $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
  1097. [ok = application:load(App) || App <- [$(APP), triq]], \
  1098. {ok, Deps} = application:get_key($(APP), applications), \
  1099. false = lists:member(triq, Deps), \
  1100. halt()"