1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186 |
- # Core: Packages and dependencies.
- CORE_DEPS_TARGETS = $(call list_targets,core-deps)
- .PHONY: core-deps $(CORE_DEPS_TARGETS)
- core-deps: $(CORE_DEPS_TARGETS)
- core-deps-autopatch-rebar: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add erlsha2 to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = erlsha2\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that erlsha2 was fetched and built"
- $t test -d $(APP)/deps/erlsha2
- $t test -f $(APP)/deps/erlsha2/ebin/erlsha2.beam
- ifneq ($(PLATFORM),msys2)
- $t test -f $(APP)/deps/erlsha2/priv/erlsha2_nif.so
- endif
- # This test is expected to fail when run in parallel and flock/lockf is not available.
- core-deps-autopatch-two-rebar: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add two Rebar projects to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = epgsql mochiweb\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- ifneq ($(PLATFORM),msys2)
- core-deps-build-c-8cc: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add 8cc to the list of build dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "BUILD_DEPS = 8cc\ndep_8cc = git https://github.com/rui314/8cc master\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/8cc
- $i "Check that 8cc can be started"
- $t $(APP)/deps/8cc/8cc -h $v
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP)]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member('8cc', Deps), \
- halt()"
- endif
- core-deps-build-c-lz4: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add lz4 to the list of build dependencies"
- $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
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/lz4_src
- $i "Check that lz4 was compiled"
- $t test -f $(APP)/deps/lz4_src/lib/liblz4.a
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP)]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member(lz4, Deps), \
- halt()"
- core-deps-build-erl: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add cowlib to the list of build dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "BUILD_DEPS = cowlib\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowlib
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), cowlib]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member(cowlib, Deps), \
- halt()"
- core-deps-build-js: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add jquery to the list of build dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "BUILD_DEPS = jquery\ndep_jquery = git https://github.com/jquery/jquery master\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/jquery
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP)]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member(jquery, Deps), \
- halt()"
- core-deps-dep-commit: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowboy 1.0.0 to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy_commit = 1.0.0\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add Cowboy to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowboy
- $t test -d $(APP)/deps/cowlib
- $t test -d $(APP)/deps/ranch
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(cowboy, Deps), \
- {ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
- halt()"
- core-deps-dir: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowboy to the list of dependencies with a custom DEPS_DIR"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\nDEPS_DIR ?= \$$(CURDIR)/deep/libs\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add Cowboy to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched in the custom DEPS_DIR"
- $t test -d $(APP)/deep/libs/cowboy
- $t test -d $(APP)/deep/libs/cowlib
- $t test -d $(APP)/deep/libs/ranch
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deep/libs/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(cowboy, Deps), \
- halt()"
- core-deps-doc: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Generate .erl files"
- $t echo "-module(boy)." > $(APP)/src/boy.erl
- $t echo "-module(girl)." > $(APP)/src/girl.erl
- $i "Add Edown as a documentation building dependency"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DOC_DEPS = edown\nEDOC_OPTS = {doclet, edown_doclet}\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that no dependencies were fetched"
- $t test ! -e $(APP)/deps
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP)]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member(edown, Deps), \
- halt()"
- $i "Build the application documentation"
- $t $(MAKE) -C $(APP) edoc $v
- $i "Check that documentation dependencies were fetched"
- $t test -d $(APP)/deps/edown
- $i "Check the Edown generated Markdown documentation"
- $t test -f $(APP)/doc/boy.md
- $t test -f $(APP)/doc/girl.md
- core-deps-fetch-cp: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Bootstrap a new OTP library named my_dep inside $(APP)"
- $t mkdir $(APP)/my_dep
- $t cp ../erlang.mk $(APP)/my_dep/
- $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v
- $i "Add my_dep to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep\ndep_my_dep = cp $(CURDIR)/$(APP)/my_dep/\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add my_dep to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/my_dep
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), my_dep]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(my_dep, Deps), \
- halt()"
- core-deps-fetch-custom: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add dependency boop using custom fetch method beep to the list of dependencies"
- $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
- ifdef LEGACY
- $i "Add boop to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tboop,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/boop
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- ok = application:load($(APP)), \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(boop, Deps), \
- halt()"
- core-deps-fetch-fail-bad: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowlib as a dependency using a non-existing fetch method named oops"
- $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
- $i "Check that building the application fails"
- $t ! $(MAKE) -C $(APP) $v
- core-deps-fetch-fail-unknown: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add an unknown application as a dependency"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = unknown\n"}' $(APP)/Makefile
- $i "Check that building the application fails"
- $t ! $(MAKE) -C $(APP) $v
- core-deps-fetch-git: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowboy 1.0.0 to the list of dependencies"
- $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
- ifdef LEGACY
- $i "Add Cowboy to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowboy
- $t test -d $(APP)/deps/cowlib
- $t test -d $(APP)/deps/ranch
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(cowboy, Deps), \
- {ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
- halt()"
- core-deps-fetch-git-subfolder: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Bootstrap a new OTP library named my_dep as a subfolder inside $(APP)"
- $t mkdir -p $(APP)/git_repo/my_dep
- $t cp ../erlang.mk $(APP)/git_repo/my_dep/
- $t $(MAKE) -C $(APP)/git_repo/my_dep/ -f erlang.mk bootstrap-lib $v
- # Create an empty file so src/ gets committed.
- $t touch $(APP)/git_repo/my_dep/src/README
- $t cd $(APP)/git_repo && \
- git init -q && \
- git config user.email "testsuite@erlang.mk" && \
- git config user.name "test suite" && \
- git add . && \
- git commit -q --no-gpg-sign -m "Tests"
- $i "Add my_dep to the list of dependencies"
- $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
- ifdef LEGACY
- $i "Add my_dep to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that the dependency was fetched"
- $t test -d $(APP)/deps/my_dep
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), my_dep]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(my_dep, Deps), \
- halt()"
- core-deps-fetch-git-submodule: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Bootstrap a new OTP library named my_dep inside $(APP)"
- $t mkdir $(APP)/my_dep
- $t cp ../erlang.mk $(APP)/my_dep/
- $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v
- # Create an empty file so src/ gets committed.
- $t touch $(APP)/my_dep/src/README
- $t cd $(APP)/my_dep && \
- git init -q && \
- git config user.email "testsuite@erlang.mk" && \
- git config user.name "test suite" && \
- git add . && \
- git commit -q --no-gpg-sign -m "Tests"
- $i "Add the submodule to my_dep"
- $t mkdir $(APP)/deps
- $t cd $(APP) && \
- git init -q && \
- git submodule -q add file://$(abspath $(APP)/my_dep) deps/my_dep && \
- git config user.email "testsuite@erlang.mk" && \
- git config user.name "test suite" && \
- git add . && \
- git commit -q --no-gpg-sign -m "Tests"
- $i "Distclean the application"
- $t $(MAKE) -C $(APP) distclean $v
- $i "Add my_dep to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep\ndep_my_dep = git-submodule\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add my_dep to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/my_dep
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), my_dep]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(my_dep, Deps), \
- halt()"
- core-deps-fetch-hex: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowboy 1.0.0 to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy = hex 1.0.0\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add Cowboy to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowboy
- $t test -d $(APP)/deps/cowlib
- $t test -d $(APP)/deps/ranch
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(cowboy, Deps), \
- {ok, \"1.0.0\"} = application:get_key(cowboy, vsn), \
- halt()"
- core-deps-fetch-hg: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Ehsa 4.0.3 to the list of dependencies"
- $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
- ifdef LEGACY
- $i "Add ehsa to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tehsa,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/ehsa
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), ehsa]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(ehsa, Deps), \
- {ok, \"4.0.3\"} = application:get_key(ehsa, vsn), \
- halt()"
- # Legacy must fail for the top-level application, but work for dependencies.
- core-deps-fetch-legacy: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowlib as a dependency using a non-existing fetch method named oops"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib = https://github.com/ninenines/cowlib 1.0.0\n"}' $(APP)/Makefile
- $i "Check that building the application fails"
- $t ! $(MAKE) -C $(APP) $v
- $i "Check that building the application works with IS_DEP=1"
- $t $(MAKE) -C $(APP) IS_DEP=1 $v
- core-deps-fetch-ln: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Bootstrap a new OTP library named my_dep inside $(APP)"
- $t mkdir $(APP)/my_dep
- $t cp ../erlang.mk $(APP)/my_dep/
- $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v
- $i "Add my_dep to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep\ndep_my_dep = ln $(CURDIR)/$(APP)/my_dep/\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add my_dep to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/my_dep
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), my_dep]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(my_dep, Deps), \
- halt()"
- core-deps-fetch-svn: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowlib 1.0.0 to the list of dependencies"
- $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
- ifdef LEGACY
- $i "Add Cowlib to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowlib,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowlib
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), cowlib]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(cowlib, Deps), \
- {ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \
- halt()"
- core-deps-ignore: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowboy to dependencies, Ranch to the ignore list and to test dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\nIGNORE_DEPS = ranch\nTEST_DEPS = ranch\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add Cowboy to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that the correct dependencies were fetched"
- $t test -d $(APP)/deps/cowboy
- $t test -d $(APP)/deps/cowlib
- $t test ! -e $(APP)/deps/ranch
- $i "Build the test dependencies"
- $t $(MAKE) -C $(APP) test-deps $v
- $i "Check that the correct dependencies were fetched"
- $t test -d $(APP)/deps/ranch
- define add_dep_and_subdep
- $i "Bootstrap a new OTP library named $(APP)_$(1)subdep"
- $t mkdir $(APP)_$(1)subdep/
- $t cp ../erlang.mk $(APP)_$(1)subdep/
- $t $2 -C $(APP)_$(1)subdep --no-print-directory -f erlang.mk bootstrap-lib $$v
- $i "Create a Git repository for $(APP)_$(1)subdep"
- $t (cd $(APP)_$(1)subdep && \
- git init -q && \
- git config user.name "Testsuite" && \
- git config user.email "testsuite@erlang.mk" && \
- git add . && \
- git commit -q --no-gpg-sign -m "Initial commit")
- $i "Bootstrap a new OTP library named $(APP)_$(1)dep"
- $t mkdir $(APP)_$(1)dep/
- $t cp ../erlang.mk $(APP)_$(1)dep/
- $t $2 -C $(APP)_$(1)dep --no-print-directory -f erlang.mk bootstrap-lib $$v
- $i "Add $(APP)_$(1)subdep as a dependency"
- $t perl -ni.bak -e \
- 'print;if ($$.==1) {print "DEPS = $(1)subdep\ndep_$(1)subdep = git file://$(abspath $(APP)_$(1)subdep) master\n"}' \
- $(APP)_$(1)dep/Makefile
- $t rm $(APP)_$(1)dep/Makefile.bak
- $i "Create a Git repository for $(APP)_$(1)dep"
- $t (cd $(APP)_$(1)dep && \
- git init -q && \
- git config user.name "Testsuite" && \
- git config user.email "testsuite@erlang.mk" && \
- git add . && \
- git commit -q --no-gpg-sign -m "Initial commit")
- endef
- core-deps-list-deps: build clean
- # We pass $(MAKE) directly so that GNU Make can pass its context forward.
- # If we didn't then $(MAKE) would be expanded in the call without context.
- $(call add_dep_and_subdep,,$(MAKE))
- $(call add_dep_and_subdep,doc,$(MAKE))
- $(call add_dep_and_subdep,rel,$(MAKE))
- $(call add_dep_and_subdep,test,$(MAKE))
- $(call add_dep_and_subdep,shell,$(MAKE))
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add $(APP)-dep and $(APP)-testdep as a dependency"
- $t sed -i.bak '2i\
- DEPS = dep\
- DOC_DEPS = docdep\
- REL_DEPS = reldep\
- TEST_DEPS = testdep\
- SHELL_DEPS = shelldep\
- dep_dep = git file://$(abspath $(APP)_dep) master\
- dep_docdep = git file://$(abspath $(APP)_docdep) master\
- dep_reldep = git file://$(abspath $(APP)_reldep) master\
- dep_testdep = git file://$(abspath $(APP)_testdep) master\
- dep_shelldep = git file://$(abspath $(APP)_shelldep) master\
- ' $(APP)/Makefile
- $t rm $(APP)/Makefile.bak
- $i "Create a Git repository for $(APP)"
- $t (cd $(APP) && \
- git init -q && \
- git config user.name "Testsuite" && \
- git config user.email "testsuite@erlang.mk" && \
- git add . && \
- git commit -q --no-gpg-sign -m "Initial commit")
- $i "List application dependencies"
- $t $(MAKE) -C $(APP) --no-print-directory list-deps $v
- $t test -d $(APP)/deps/subdep
- $t printf "%s\n%s\n" $(abspath $(APP)/deps/dep $(APP)/deps/subdep) > $(APP)/expected-deps.txt
- $t cmp $(APP)/expected-deps.txt $(APP)/.erlang.mk/recursive-deps-list.log
- $t $(MAKE) -C $(APP) --no-print-directory distclean $v
- $i "List application doc dependencies"
- $t $(MAKE) -C $(APP) --no-print-directory list-doc-deps $v
- $t test -d $(APP)/deps/subdep
- $t test -d $(APP)/deps/docsubdep
- $t printf "%s\n%s\n%s\n%s\n" \
- $(abspath $(APP)/deps/dep $(APP)/deps/subdep $(APP)/deps/docdep $(APP)/deps/docsubdep) \
- | sort > $(APP)/expected-doc-deps.txt
- $t cmp $(APP)/expected-doc-deps.txt $(APP)/.erlang.mk/recursive-doc-deps-list.log
- $t $(MAKE) -C $(APP) --no-print-directory distclean $v
- $i "List application rel dependencies"
- $t $(MAKE) -C $(APP) --no-print-directory list-rel-deps $v
- $t test -d $(APP)/deps/subdep
- $t test -d $(APP)/deps/relsubdep
- $t printf "%s\n%s\n%s\n%s\n" \
- $(abspath $(APP)/deps/dep $(APP)/deps/subdep $(APP)/deps/reldep $(APP)/deps/relsubdep) \
- | sort > $(APP)/expected-rel-deps.txt
- $t cmp $(APP)/expected-rel-deps.txt $(APP)/.erlang.mk/recursive-rel-deps-list.log
- $t $(MAKE) -C $(APP) --no-print-directory distclean $v
- $i "List application test dependencies"
- $t $(MAKE) -C $(APP) --no-print-directory list-test-deps $v
- $t test -d $(APP)/deps/subdep
- $t test -d $(APP)/deps/testsubdep
- $t printf "%s\n%s\n%s\n%s\n" \
- $(abspath $(APP)/deps/dep $(APP)/deps/subdep $(APP)/deps/testdep $(APP)/deps/testsubdep) \
- | sort > $(APP)/expected-test-deps.txt
- $t cmp $(APP)/expected-test-deps.txt $(APP)/.erlang.mk/recursive-test-deps-list.log
- $t $(MAKE) -C $(APP) --no-print-directory distclean $v
- $i "List application shell dependencies"
- $t $(MAKE) -C $(APP) --no-print-directory list-shell-deps $v
- $t test -d $(APP)/deps/subdep
- $t test -d $(APP)/deps/shellsubdep
- $t printf "%s\n%s\n%s\n%s\n" \
- $(abspath $(APP)/deps/dep $(APP)/deps/subdep $(APP)/deps/shelldep $(APP)/deps/shellsubdep) \
- | sort > $(APP)/expected-shell-deps.txt
- $t cmp $(APP)/expected-shell-deps.txt $(APP)/.erlang.mk/recursive-shell-deps-list.log
- $t $(MAKE) -C $(APP) --no-print-directory distclean $v
- $i "List application all dependencies (all kinds)"
- $t $(MAKE) -C $(APP) --no-print-directory list-deps DEP_TYPES='doc rel test shell' $v
- $t test -d $(APP)/deps/subdep
- $t test -d $(APP)/deps/docsubdep
- $t test -d $(APP)/deps/relsubdep
- $t test -d $(APP)/deps/testsubdep
- $t test -d $(APP)/deps/shellsubdep
- $t printf "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n" \
- $(abspath \
- $(APP)/deps/dep $(APP)/deps/subdep \
- $(APP)/deps/docdep $(APP)/deps/docsubdep \
- $(APP)/deps/reldep $(APP)/deps/relsubdep \
- $(APP)/deps/testdep $(APP)/deps/testsubdep \
- $(APP)/deps/shelldep $(APP)/deps/shellsubdep) \
- | sort > $(APP)/expected-all-deps.txt
- $t cmp $(APP)/expected-all-deps.txt $(APP)/.erlang.mk/recursive-deps-list.log
- $t $(MAKE) -C $(APP) --no-print-directory distclean $v
- core-deps-mv: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowlib to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowlib
- $i "Move the application elsewhere"
- $t mv $(APP) $(APP)-moved
- $i "Build the application"
- $t $(MAKE) -C $(APP)-moved $v
- core-deps-mv-rebar: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Lager to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = lager\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/goldrush
- $t test -d $(APP)/deps/lager
- $i "Move the application elsewhere"
- $t mv $(APP) $(APP)-moved
- $i "Build the application"
- $t $(MAKE) -C $(APP)-moved $v
- # A lower-level dependency of the first dependency always
- # wins over a lower-level dependency of the second dependency.
- core-deps-order-first: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowboy package and my_dep to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = my_dep cowboy\ndep_my_dep = cp $(CURDIR)/$(APP)/my_dep/\n"}' $(APP)/Makefile
- $i "Bootstrap a new OTP library named my_dep inside $(APP)"
- $t mkdir $(APP)/my_dep
- $t cp ../erlang.mk $(APP)/my_dep/
- $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap-lib $v
- $i "Add Cowlib 1.0.0 to the list of dependencies for my_dep"
- $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
- ifdef LEGACY
- $i "Add Cowboy and my_dep to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n\t\tmy_dep,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowboy
- $t test -d $(APP)/deps/cowlib
- $t test -d $(APP)/deps/my_dep
- $t test -d $(APP)/deps/ranch
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, my_dep, ranch]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(cowboy, Deps), \
- {ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \
- halt()"
- # A higher-level dependency always wins.
- core-deps-order-top: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowboy package and Cowlib 1.0.0 to the list of dependencies"
- $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
- ifdef LEGACY
- $i "Add Cowboy to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowboy
- $t test -d $(APP)/deps/cowlib
- $t test -d $(APP)/deps/ranch
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(cowboy, Deps), \
- {ok, \"1.0.0\"} = application:get_key(cowlib, vsn), \
- halt()"
- core-deps-no-autopatch: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowboy to the list of dependencies and Cowlib to the NO_AUTOPATCH list"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\nNO_AUTOPATCH = cowlib\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowboy
- $t test -d $(APP)/deps/cowlib
- $t test -d $(APP)/deps/ranch
- $i "Check that Cowlib was not autopatched"
- $t grep -q Hoguin $(APP)/deps/cowlib/erlang.mk
- core-deps-no-autopatch-erlang-mk: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowlib to the list of dependencies and set NO_AUTOPATCH_ERLANG_MK=1"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\nNO_AUTOPATCH_ERLANG_MK = 1\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowlib
- $i "Check that Erlang.mk was not autopatched"
- $t grep -q Hoguin $(APP)/deps/cowlib/erlang.mk
- core-deps-no-autopatch-rebar: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Lager to the list of dependencies and to the NO_AUTOPATCH list"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = lager\nNO_AUTOPATCH = lager\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/goldrush
- $t test -d $(APP)/deps/lager
- $i "Check that Lager was not autopatched"
- $t if grep -q erlang\.mk $(APP)/deps/goldrush/Makefile; then false; fi
- $t if grep -q erlang\.mk $(APP)/deps/lager/Makefile; then false; fi
- ifndef LEGACY
- core-deps-otp: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Crypto to the list of OTP dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "LOCAL_DEPS = crypto\n"}' $(APP)/Makefile
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that no dependencies were fetched"
- $t test ! -e $(APP)/deps
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), crypto]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(crypto, Deps), \
- halt()"
- endif
- core-deps-pkg: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowboy to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add Cowboy to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowboy
- $t test -d $(APP)/deps/cowlib
- $t test -d $(APP)/deps/ranch
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), cowboy, cowlib, ranch]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- true = lists:member(cowboy, Deps), \
- halt()"
- core-deps-rel: build clean
- $i "Bootstrap a new release-enabled OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib bootstrap-rel $v
- $i "Add Recon to the list of release dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = recon\n"}' $(APP)/Makefile
- $i "Add Recon to the relx.config file"
- $t $(ERL) -eval " \
- {ok, Conf0} = file:consult(\"$(APP)/relx.config\"), \
- Conf = lists:keyreplace(release, 1, Conf0, {release, {$(APP)_release, \"1\"}, [$(APP), recon]}), \
- ok = file:write_file(\"$(APP)/relx.config\", \
- lists:map(fun(Term) -> io_lib:format(\"~p.~n\", [Term]) end, Conf)), \
- halt()"
- $i "Build the application and its dependencies"
- $t $(MAKE) -C $(APP) deps app $v
- $i "Check that no dependencies were fetched"
- $t test ! -e $(APP)/deps
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP)]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member(recon, Deps), \
- halt()"
- $i "Build the release"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/recon
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), recon]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member(recon, Deps), \
- halt()"
- # @todo Add check for MSYS2 when releases under Windows become usable.
- # $i "Start the release and check that Recon is loaded"
- ifeq ($(PLATFORM),msys2)
- # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd install $v
- # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd start $v
- # $t test -n "`$(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd rpcterms \
- # application loaded_applications | grep recon`"
- # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd stop $v
- # $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release.cmd uninstall $v
- else
- $i "Start the release and check that Recon is loaded"
- $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release start $v
- $t apps="Node is not running!"; \
- while test "$$apps" = "Node is not running!"; do \
- apps=$$($(APP)/_rel/$(APP)_release/bin/$(APP)_release \
- rpcterms \ application loaded_applications); \
- done; \
- echo "$$apps" | grep -q recon
- $t $(APP)/_rel/$(APP)_release/bin/$(APP)_release stop $v
- endif
- core-deps-search: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Run 'make search' and check that it prints packages"
- $t test -n "`$(MAKE) -C $(APP) search`"
- $i "Run 'make search q=cowboy' and check that it prints packages"
- $t test -n "`$(MAKE) -C $(APP) search q=cowboy`"
- core-deps-shell: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add TDDReloader to the list of shell dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "SHELL_DEPS = tddreloader\n"}' $(APP)/Makefile
- $i "Build the application and its dependencies"
- $t $(MAKE) -C $(APP) deps app $v
- $i "Check that no dependencies were fetched"
- $t test ! -e $(APP)/deps
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP)]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member(tddreloader, Deps), \
- halt()"
- $i "Run the shell"
- $t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval \" \
- ok = application:load($(APP)), \
- ok = application:load(tddreloader), \
- halt()\"" $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/tddreloader
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), tddreloader]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member(tddreloader, Deps), \
- halt()"
- core-deps-skip: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Add Cowboy to the list of dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\n"}' $(APP)/Makefile
- ifdef LEGACY
- $i "Add Cowboy to the applications key in the .app.src file"
- $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowboy,\n"}' $(APP)/src/$(APP).app.src
- endif
- $i "Build the application with SKIP_DEPS=1"
- $t $(MAKE) -C $(APP) SKIP_DEPS=1 $v
- $i "Check that no dependencies were fetched"
- $t test ! -e $(APP)/deps
- $i "Build the application"
- $t $(MAKE) -C $(APP) $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/cowlib
- $t test -d $(APP)/deps/cowboy
- $t test -d $(APP)/deps/ranch
- $i "Distclean with SKIP_DEPS=1"
- $t $(MAKE) -C $(APP) distclean SKIP_DEPS=1 $v
- $i "Check that no dependencies were removed"
- $t test -d $(APP)/deps/cowlib
- $t test -d $(APP)/deps/cowboy
- $t test -d $(APP)/deps/ranch
- core-deps-test: build clean
- $i "Bootstrap a new OTP library named $(APP)"
- $t mkdir $(APP)/
- $t cp ../erlang.mk $(APP)/
- $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
- $i "Generate .erl files"
- $t echo "-module(boy)." > $(APP)/src/boy.erl
- $t echo "-module(girl)." > $(APP)/src/girl.erl
- $i "Add triq to the list of test dependencies"
- $t perl -ni.bak -e 'print;if ($$.==1) {print "TEST_DEPS = triq\n"}' $(APP)/Makefile
- $i "Build the application and its dependencies"
- $t $(MAKE) -C $(APP) deps app $v
- $i "Check that no dependencies were fetched"
- $t test ! -e $(APP)/deps
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP)]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member(triq, Deps), \
- halt()"
- $i "Run tests"
- $t $(MAKE) -C $(APP) tests $v
- $i "Check that all dependencies were fetched"
- $t test -d $(APP)/deps/triq
- $i "Check that the application was compiled correctly"
- $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \
- [ok = application:load(App) || App <- [$(APP), triq]], \
- {ok, Deps} = application:get_key($(APP), applications), \
- false = lists:member(triq, Deps), \
- halt()"
|