aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/core_compat.mk72
-rw-r--r--test/core_deps.mk12
2 files changed, 74 insertions, 10 deletions
diff --git a/test/core_compat.mk b/test/core_compat.mk
index 238d7ad..b759a2b 100644
--- a/test/core_compat.mk
+++ b/test/core_compat.mk
@@ -91,7 +91,71 @@ core-compat-rebar: init
$i "Use rebar3 to build the application"
$t cd $(APP) && ./rebar3 compile $v
-core-compat-rebar-deps-git: init
+core-compat-rebar-deps-git-branch: init
+
+ $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 as a dependency"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy = git https://github.com/ninenines/cowboy master\n"}' $(APP)/Makefile
+
+ $i "Run 'make rebar.config'"
+ $t $(MAKE) -C $(APP) rebar.config $v
+
+ $i "Check that rebar.config was created"
+ $t test -f $(APP)/rebar.config
+
+ $i "Check that Cowboy is listed in rebar.config with a branch"
+ $t $(ERL) -eval " \
+ {ok, C} = file:consult(\"$(APP)/rebar.config\"), \
+ {_, [{cowboy, _, {git, _, {branch, \"master\"}}}]} = lists:keyfind(deps, 1, C), \
+ halt()"
+
+ $i "Distclean the application"
+ $t $(MAKE) -C $(APP) distclean $v
+
+ $i "Download rebar3"
+ $t curl --retry 5 -s -L -o $(APP)/rebar3 $(REBAR3_BINARY)
+ $t chmod +x $(APP)/rebar3
+
+ $i "Use rebar3 to build the application"
+ $t cd $(APP) && ./rebar3 compile $v
+
+core-compat-rebar-deps-git-ref: init
+
+ $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 as a dependency"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy = git https://github.com/ninenines/cowboy 7e160b49\n"}' $(APP)/Makefile
+
+ $i "Run 'make rebar.config'"
+ $t $(MAKE) -C $(APP) rebar.config $v
+
+ $i "Check that rebar.config was created"
+ $t test -f $(APP)/rebar.config
+
+ $i "Check that Cowboy is listed in rebar.config with a branch"
+ $t $(ERL) -eval " \
+ {ok, C} = file:consult(\"$(APP)/rebar.config\"), \
+ {_, [{cowboy, _, {git, _, {ref, \"7e160b49\"}}}]} = lists:keyfind(deps, 1, C), \
+ halt()"
+
+ $i "Distclean the application"
+ $t $(MAKE) -C $(APP) distclean $v
+
+ $i "Download rebar3"
+ $t curl --retry 5 -s -L -o $(APP)/rebar3 $(REBAR3_BINARY)
+ $t chmod +x $(APP)/rebar3
+
+ $i "Use rebar3 to build the application"
+ $t cd $(APP) && ./rebar3 compile $v
+
+core-compat-rebar-deps-git-tag: init
$i "Bootstrap a new OTP library named $(APP)"
$t mkdir $(APP)/
@@ -107,10 +171,10 @@ core-compat-rebar-deps-git: init
$i "Check that rebar.config was created"
$t test -f $(APP)/rebar.config
- $i "Check that Cowboy is listed in rebar.config"
+ $i "Check that Cowboy is listed in rebar.config with a tag"
$t $(ERL) -eval " \
{ok, C} = file:consult(\"$(APP)/rebar.config\"), \
- {_, [{cowboy, _, {git, _, \"2.9.0\"}}]} = lists:keyfind(deps, 1, C), \
+ {_, [{cowboy, _, {git, _, {tag, \"2.9.0\"}}}]} = lists:keyfind(deps, 1, C), \
halt()"
$i "Distclean the application"
@@ -174,7 +238,7 @@ core-compat-rebar-deps-pkg: init
$i "Check that Cowboy is listed in rebar.config"
$t $(ERL) -eval " \
{ok, C} = file:consult(\"$(APP)/rebar.config\"), \
- {_, [{cowboy, _, {git, \"https://github.com/\" ++ _, _}}]} = lists:keyfind(deps, 1, C), \
+ {_, [{cowboy, _, {git, \"https://github.com/\" ++ _, {branch, _}}}]} = lists:keyfind(deps, 1, C), \
halt()"
$i "Distclean the application"
diff --git a/test/core_deps.mk b/test/core_deps.mk
index 76aa763..0308e0c 100644
--- a/test/core_deps.mk
+++ b/test/core_deps.mk
@@ -1281,8 +1281,8 @@ core-deps-order-first: init
$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
+ $i "Add Cowlib 2.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 2.0.0\n"}' $(APP)/my_dep/Makefile
ifdef LEGACY
$i "Add Cowboy and my_dep to the applications key in the .app.src file"
@@ -1303,7 +1303,7 @@ endif
[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), \
+ {ok, \"2.0.0\"} = application:get_key(cowlib, vsn), \
halt()"
# A higher-level dependency always wins.
@@ -1314,8 +1314,8 @@ core-deps-order-top: init
$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
+ $i "Add Cowboy package and Cowlib 2.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 2.0.0\n"}' $(APP)/Makefile
ifdef LEGACY
$i "Add Cowboy to the applications key in the .app.src file"
@@ -1335,7 +1335,7 @@ endif
[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), \
+ {ok, \"2.0.0\"} = application:get_key(cowlib, vsn), \
halt()"
ifndef LEGACY