From 77c0ec834fcf57aaf8460a515829066377756b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sun, 25 Nov 2018 14:24:22 +0100 Subject: 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. --- test/plugin_ct.mk | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'test/plugin_ct.mk') 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 -- cgit v1.2.3