aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-26 15:12:58 +0100
committerLoïc Hoguin <[email protected]>2018-11-26 15:12:58 +0100
commit5d710a24027dd56f5c0d9b3d3b4c85055440df44 (patch)
tree4170522b92ac85c1ea4f7ff9734ad7f53f0c5b5f
parent6eaf07deb49f3a9adb6e2efcba44a8bfce3fd87c (diff)
downloaderlang.mk-5d710a24027dd56f5c0d9b3d3b4c85055440df44.tar.gz
erlang.mk-5d710a24027dd56f5c0d9b3d3b4c85055440df44.tar.bz2
erlang.mk-5d710a24027dd56f5c0d9b3d3b4c85055440df44.zip
Add or improve tests based on false flag reports
-rw-r--r--test/plugin_ct.mk3
-rw-r--r--test/plugin_relx.mk41
2 files changed, 42 insertions, 2 deletions
diff --git a/test/plugin_ct.mk b/test/plugin_ct.mk
index 82d42e3..e58f01b 100644
--- a/test/plugin_ct.mk
+++ b/test/plugin_ct.mk
@@ -78,6 +78,9 @@ ct-apps: build clean
$t $(MAKE) -C $(APP) ct $v
$i "Check that Common Test runs tests from a specific test suite"
+ $t $(MAKE) -C $(APP) ct-my_root $v
+
+ $i "Check that Common Test runs tests from a specific test suite using CT_SUITES"
$t $(MAKE) -C $(APP) ct CT_SUITES=my_root $v
ct-apps-only: build clean
diff --git a/test/plugin_relx.mk b/test/plugin_relx.mk
index b5b6033..d48e131 100644
--- a/test/plugin_relx.mk
+++ b/test/plugin_relx.mk
@@ -53,6 +53,40 @@ relx-rel: build clean
$i "Check that the output directory was removed entirely"
$t test ! -d $(APP)/_rel/
+relx-apps-with-deps: build clean
+
+ $i "Bootstrap a new release as a multi application repository"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib bootstrap-rel $v
+
+ $i "Create a new application my_app"
+ $t $(MAKE) -C $(APP) new-app in=my_app $v
+
+ $i "Include my_app in the release"
+ $t perl -pi.bak -e 's/$(APP),/$(APP), my_app,/' $(APP)/relx.config
+
+ $i "Add Cowlib to the list of dependencies for my_app"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\n"}' $(APP)/apps/my_app/Makefile
+
+ifdef LEGACY
+ $i "Add Cowlib to the applications key in the my_app.app.src file"
+ $t perl -ni.bak -e 'print;if ($$.==7) {print "\t\tcowlib,\n"}' $(APP)/apps/my_app/src/my_app.app.src
+endif
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that all compiled files exist"
+ $t test -f $(APP)/apps/my_app/my_app.d
+ $t test -f $(APP)/apps/my_app/ebin/my_app.app
+ $t test -f $(APP)/apps/my_app/ebin/my_app_app.beam
+ $t test -f $(APP)/apps/my_app/ebin/my_app_sup.beam
+ $t test -f $(APP)/deps/cowlib/ebin/cowlib.app
+
+ $i "Check that Cowlib was included in the release"
+ $t test -d $(APP)/_rel/test_relx_apps_with_deps_release/lib/cowlib-1.0.2
+
relx-bare-rel: build clean
$i "Bootstrap a new release named $(APP)"
@@ -84,6 +118,7 @@ relx-post-rel: build clean
$i "Add relx-post-rel target to Makefile"
$t echo "relx-post-rel::" >> $(APP)/Makefile
$t echo " echo test post rel > _rel/$(APP)_release/test_post_rel" >> $(APP)/Makefile
+
$i "Build the release"
$t $(MAKE) -C $(APP) $v
@@ -93,12 +128,12 @@ relx-post-rel: build clean
$i "Check that the release was built"
$t test -d $(APP)/_rel
$t test -d $(APP)/_rel/$(APP)_release
- $t test -f $(APP)/_rel/$(APP)_release/test_post_rel
- $t test "test post rel" = "`cat $(APP)/_rel/$(APP)_release/test_post_rel`"
$t test -d $(APP)/_rel/$(APP)_release/bin
$t test -d $(APP)/_rel/$(APP)_release/lib
$t test -d $(APP)/_rel/$(APP)_release/releases
$t test -d $(APP)/_rel/$(APP)_release/releases/1
+ $t test -f $(APP)/_rel/$(APP)_release/test_post_rel
+ $t test "test post rel" = "`cat $(APP)/_rel/$(APP)_release/test_post_rel`"
$i "Clean the application"
$t $(MAKE) -C $(APP) clean $v
@@ -110,6 +145,8 @@ relx-post-rel: build clean
$t test -d $(APP)/_rel/$(APP)_release/lib
$t test -d $(APP)/_rel/$(APP)_release/releases
$t test -d $(APP)/_rel/$(APP)_release/releases/1
+ $t test -f $(APP)/_rel/$(APP)_release/test_post_rel
+ $t test "test post rel" = "`cat $(APP)/_rel/$(APP)_release/test_post_rel`"
$i "Distclean the application"
$t $(MAKE) -C $(APP) distclean $v