diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/plugin_hex.mk | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/plugin_hex.mk b/test/plugin_hex.mk index 99e6356..27060b6 100644 --- a/test/plugin_hex.mk +++ b/test/plugin_hex.mk @@ -162,6 +162,36 @@ endif {_, <<\"2.13.0\">>} = lists:keyfind(<<\"requirement\">>, 1, Cowlib), \ halt(0)" +hex-tarball-create-with-req: init + + $i "Bootstrap a new OTP application named $(APP)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v + + $i "Add Cowlib to the list of dependencies" + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib_commit = 2.13.0\nhex_req_cowlib = ~> 2.13\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 "Create a release tarball" + $t $(MAKE) -C $(APP) hex-tarball-create $v + + $i "Confirm the tarball contents can be extracted" + $t cd $(APP)/.erlang.mk/ && tar xf $(APP).tar + + $i "Confirm the tarball contains a metadata.config file that lists Cowlib as requirement" + $t $(ERL) -eval " \ + {ok, Metadata} = file:consult(\"$(APP)/.erlang.mk/metadata.config\"), \ + {_, [{<<\"cowlib\">>, Cowlib}]} = lists:keyfind(<<\"requirements\">>, 1, Metadata), \ + {_, <<\"cowlib\">>} = lists:keyfind(<<\"app\">>, 1, Cowlib), \ + {_, false} = lists:keyfind(<<\"optional\">>, 1, Cowlib), \ + {_, <<\"~> 2.13\">>} = lists:keyfind(<<\"requirement\">>, 1, Cowlib), \ + halt(0)" + hex-release-publish: init $i "Bootstrap a new OTP application named $(APP)" |