From e84fb7e10544c52b2540fab68ec1a85d4f60fb16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 16 Apr 2020 16:16:42 +0200 Subject: Use an ln dep for core-deps-shell to avoid intermittent errors --- test/core_deps.mk | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/test/core_deps.mk b/test/core_deps.mk index c4e2ad0..31b92f6 100644 --- a/test/core_deps.mk +++ b/test/core_deps.mk @@ -1333,8 +1333,14 @@ core-deps-shell: init $t cp ../erlang.mk $(APP)/ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v - $i "Add TDDReloader to the list of shell dependencies" - $t perl -ni.bak -e 'print;if ($$.==1) {print "SHELL_DEPS = tddreloader\n"}' $(APP)/Makefile + $i "Bootstrap a new OTP application named my_dep inside $(APP)" + $t mkdir $(APP)/my_dep + $t cp ../erlang.mk $(APP)/my_dep/ + $t $(MAKE) -C $(APP)/my_dep/ -f erlang.mk bootstrap $v + + $i "Add my_dep to the list of dependencies" +# We use FORCE_REBUILD to ensure it gets rebuilt even on Windows. + $t perl -ni.bak -e "print;if ($$.==1) {print \"SHELL_DEPS = my_dep\ndep_my_dep = ln $(CURDIR)/$(APP)/my_dep/\nFORCE_REBUILD = my_dep\n\"}" $(APP)/Makefile $i "Build the application and its dependencies" $t $(MAKE) -C $(APP) deps app $v @@ -1346,23 +1352,23 @@ core-deps-shell: init $t $(ERL) -pa $(APP)/ebin/ -eval " \ [ok = application:load(App) || App <- [$(APP)]], \ {ok, Deps} = application:get_key($(APP), applications), \ - false = lists:member(tddreloader, Deps), \ + false = lists:member(my_dep, Deps), \ halt()" $i "Run the shell" $t $(MAKE) -C $(APP) shell SHELL_OPTS="-eval \" \ ok = application:load($(APP)), \ - ok = application:load(tddreloader), \ + ok = application:load(my_dep), \ halt()\"" $v $i "Check that all dependencies were fetched" - $t test -d $(APP)/deps/tddreloader + $t test -d $(APP)/deps/my_dep $i "Check that the application was compiled correctly" $t $(ERL) -pa $(APP)/ebin/ $(APP)/deps/*/ebin/ -eval " \ - [ok = application:load(App) || App <- [$(APP), tddreloader]], \ + [ok = application:load(App) || App <- [$(APP), my_dep]], \ {ok, Deps} = application:get_key($(APP), applications), \ - false = lists:member(tddreloader, Deps), \ + false = lists:member(my_dep, Deps), \ halt()" core-deps-skip: init -- cgit v1.2.3