aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-25 14:24:22 +0100
committerLoïc Hoguin <[email protected]>2018-11-25 14:27:16 +0100
commit77c0ec834fcf57aaf8460a515829066377756b63 (patch)
treed440ca25638d595f7ab43a42461c185c3222477f /test
parenta59058e20c7c703d7bb9f6bcd2ac471d4d950d03 (diff)
downloaderlang.mk-77c0ec834fcf57aaf8460a515829066377756b63.tar.gz
erlang.mk-77c0ec834fcf57aaf8460a515829066377756b63.tar.bz2
erlang.mk-77c0ec834fcf57aaf8460a515829066377756b63.zip
Build issues testing multi-apps projects
I've reworked how the multi-apps projects are built. In particular I've made sure the test build is made from the top-level once, and then only tests are run on this build. It used to build multiple times and some builds would not include test mode, not good. I've also fixed issues with running tests in parallel. All tests now pass with -j8 on my machine. It's possible more issues remain that are not covered by tests yet though.
Diffstat (limited to 'test')
-rw-r--r--test/plugin_ct.mk42
1 files changed, 21 insertions, 21 deletions
diff --git a/test/plugin_ct.mk b/test/plugin_ct.mk
index 4c5945a..82d42e3 100644
--- a/test/plugin_ct.mk
+++ b/test/plugin_ct.mk
@@ -87,46 +87,46 @@ ct-apps-only: build clean
$t cp ../erlang.mk $(APP)/
$t echo "include erlang.mk" > $(APP)/Makefile
- $i "Create a new application named my_app"
- $t $(MAKE) -C $(APP) new-app in=my_app $v
+ $i "Create a new application named my_app_only"
+ $t $(MAKE) -C $(APP) new-app in=my_app_only $v
- $i "Create a new library named my_lib"
- $t $(MAKE) -C $(APP) new-lib in=my_lib $v
+ $i "Create a new library named my_lib_only"
+ $t $(MAKE) -C $(APP) new-lib in=my_lib_only $v
- $i "Populate my_lib"
+ $i "Populate my_lib_only"
$t printf "%s\n" \
- "-module(my_lib)." \
+ "-module(my_lib_only)." \
"-export([random_int/0])." \
- "random_int() -> 4." > $(APP)/apps/my_lib/src/my_lib.erl
+ "random_int() -> 4." > $(APP)/apps/my_lib_only/src/my_lib_only.erl
$i "Check that Common Test detects no tests"
$t $(MAKE) -C $(APP) ct | grep -c "Nothing to be done for 'ct'." | grep -q 2
- $i "Generate a Common Test suite in my_app"
- $t mkdir $(APP)/apps/my_app/test
+ $i "Generate a Common Test suite in my_app_only"
+ $t mkdir $(APP)/apps/my_app_only/test
$t printf "%s\n" \
- "-module(my_app_SUITE)." \
- "-export([all/0, ok/1, call_my_lib/1])." \
- "all() -> [ok, call_my_lib]." \
+ "-module(my_app_only_SUITE)." \
+ "-export([all/0, ok/1, call_my_lib_only/1])." \
+ "all() -> [ok, call_my_lib_only]." \
"ok(_) -> ok." \
- "call_my_lib(_) -> 4 = my_lib:random_int()." > $(APP)/apps/my_app/test/my_app_SUITE.erl
+ "call_my_lib_only(_) -> 4 = my_lib_only:random_int()." > $(APP)/apps/my_app_only/test/my_app_only_SUITE.erl
- $i "Generate a Common Test suite in my_lib"
- $t mkdir $(APP)/apps/my_lib/test
+ $i "Generate a Common Test suite in my_lib_only"
+ $t mkdir $(APP)/apps/my_lib_only/test
$t printf "%s\n" \
- "-module(my_lib_SUITE)." \
+ "-module(my_lib_only_SUITE)." \
"-export([all/0, ok/1])." \
"all() -> [ok]." \
- "ok(_) -> ok." > $(APP)/apps/my_lib/test/my_lib_SUITE.erl
+ "ok(_) -> ok." > $(APP)/apps/my_lib_only/test/my_lib_only_SUITE.erl
$i "Check that Common Test runs tests"
# We can't pipe CT's output without it crashing, so let's check that
# the command succeeds and log files are created instead.
- $t test ! -e $(APP)/apps/my_app/logs/index.html
- $t test ! -e $(APP)/apps/my_lib/logs/index.html
+ $t test ! -e $(APP)/apps/my_app_only/logs/index.html
+ $t test ! -e $(APP)/apps/my_lib_only/logs/index.html
$t $(MAKE) -C $(APP) ct $v
- $t test -f $(APP)/apps/my_app/logs/index.html
- $t test -f $(APP)/apps/my_lib/logs/index.html
+ $t test -f $(APP)/apps/my_app_only/logs/index.html
+ $t test -f $(APP)/apps/my_lib_only/logs/index.html
ct-case: build clean