aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlexey Lebedeff <[email protected]>2016-11-09 18:29:30 +0300
committerLoïc Hoguin <[email protected]>2017-05-12 17:18:48 +0200
commita40abed1616da47fbd83f1548228e8129bd42deb (patch)
tree2be3657b33b935bc8dae67befa58523f4de399fc /test
parentdd60a25e0f8c134c67b720de7bafb7da7150c41f (diff)
downloaderlang.mk-a40abed1616da47fbd83f1548228e8129bd42deb.tar.gz
erlang.mk-a40abed1616da47fbd83f1548228e8129bd42deb.tar.bz2
erlang.mk-a40abed1616da47fbd83f1548228e8129bd42deb.zip
Add test for CT on root app with sub-apps
Diffstat (limited to 'test')
-rw-r--r--test/plugin_ct.mk30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/plugin_ct.mk b/test/plugin_ct.mk
index 50410c9..fe054e9 100644
--- a/test/plugin_ct.mk
+++ b/test/plugin_ct.mk
@@ -1,6 +1,6 @@
# Common Test plugin.
-CT_CASES = all apps-only case check group logs-dir opts suite tests
+CT_CASES = all apps apps-only case check group logs-dir opts suite tests
CT_TARGETS = $(addprefix ct-,$(CT_CASES))
.PHONY: ct $(CT_TARGETS)
@@ -50,6 +50,34 @@ ct-all: build clean
$t $(MAKE) -C $(APP) distclean $v
$t test ! -e $(APP)/logs/index.html
+ct-apps: build clean
+
+ $i "Create a multi application repository with root application"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/.
+ $t echo "include erlang.mk" > $(APP)/Makefile
+
+ $i "Create a new library named my_lib"
+ $t $(MAKE) -C $(APP) new-lib in=my_lib $v
+
+ $i "Populate my_lib"
+ $t printf "%s\n" \
+ "-module(my_lib)." \
+ "-export([random_int/0])." \
+ "random_int() -> 4." > $(APP)/apps/my_lib/src/my_lib.erl
+
+ $i "Generate a Common Test suite in root application"
+ $t mkdir $(APP)/test
+ $t printf "%s\n" \
+ "-module(my_root_SUITE)." \
+ "-export([all/0, ok/1, call_my_lib/1])." \
+ "all() -> [ok, call_my_lib]." \
+ "ok(_) -> ok." \
+ "call_my_lib(_) -> 4 = my_lib:random_int()." > $(APP)/test/my_root_SUITE.erl
+
+ $i "Check that Common Test runs tests"
+ $t $(MAKE) -C $(APP) ct $v CT_SUITES=my_root
+
ct-apps-only: build clean
$i "Create a multi application repository with no root application"