From 3d4edcf31426a766be26caae329ff0cc688a83d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 26 Jun 2019 14:47:18 +0200 Subject: Fix "make eunit/ct" not fetching apps dependencies --- core/test.mk | 2 +- test/plugin_eunit.mk | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/core/test.mk b/core/test.mk index 3cc9d0a..bbacbbe 100644 --- a/core/test.mk +++ b/core/test.mk @@ -55,7 +55,7 @@ endif # We only care about compiling the current application. ifdef IS_APP test-build-app:: ERLC_OPTS=$(TEST_ERLC_OPTS) -test-build-app:: test-deps +test-build-app:: deps test-deps ifneq ($(wildcard $(TEST_DIR)),) $(verbose) $(MAKE) --no-print-directory test-dir ERLC_OPTS="$(call escape_dquotes,$(TEST_ERLC_OPTS))" endif diff --git a/test/plugin_eunit.mk b/test/plugin_eunit.mk index 8fa7b59..768358c 100644 --- a/test/plugin_eunit.mk +++ b/test/plugin_eunit.mk @@ -71,7 +71,7 @@ eunit-apps-include-lib: init $t $(MAKE) -C $(APP) $v $i "Run eunit" - $t $(MAKE) -C $(APP) $v + $t $(MAKE) -C $(APP) eunit $v $i "Distclean the application" $t $(MAKE) -C $(APP) distclean $v @@ -82,6 +82,25 @@ eunit-apps-include-lib: init $i "Distclean the application" $t $(MAKE) -C $(APP) distclean $v +eunit-apps-include-lib-deps: 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 "Create new library the_app" + $t $(MAKE) -C $(APP) new-lib in=the_app $v + + $i "Add Cowlib to the list of dependencies of the_app" + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib_commit = master\n"}' $(APP)/apps/the_app/Makefile + + $i "Generate .erl file that uses include_lib()" + $t echo '-module(the). -include_lib("cowlib/include/cow_parse.hrl"). -export([thing/0]). thing() -> true.' > $(APP)/apps/the_app/src/the.erl + + $i "Run eunit" + $t $(MAKE) -C $(APP) eunit $v + eunit-apps-one-app-tested: init $i "Bootstrap a new OTP library named $(APP)" -- cgit v1.2.3