aboutsummaryrefslogtreecommitdiffstats
path: root/test/Makefile
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-06-08 01:36:37 +0300
committerLoïc Hoguin <[email protected]>2015-06-08 01:36:37 +0300
commit947eac7733512bf9c3b97ab61a1561e11aa673d0 (patch)
treec4248e90d382e32e02ae4ec2fa8ca28e29ddbb30 /test/Makefile
parenta8a89751986c2c10fd8aea6f181c9750988e4b3e (diff)
downloaderlang.mk-947eac7733512bf9c3b97ab61a1561e11aa673d0.tar.gz
erlang.mk-947eac7733512bf9c3b97ab61a1561e11aa673d0.tar.bz2
erlang.mk-947eac7733512bf9c3b97ab61a1561e11aa673d0.zip
Maintain an error log rather than stop for packages
There's a *lot* of packages. It's better to maintain a log of failures rather than having to restart all the time.
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile58
1 files changed, 39 insertions, 19 deletions
diff --git a/test/Makefile b/test/Makefile
index 8885d37..23a1880 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -48,7 +48,7 @@ all: clean app ct eunit tests-cover docs pkgs
$i '+---------------------+'
clean:
- $t rm -rf app1 $(ERLANG_MK_TMP)
+ $t rm -rf app1 pkgs.log $(ERLANG_MK_TMP)
app: app1
$i "app: Testing the 'app' target."
@@ -233,29 +233,49 @@ pkg-$(1): pkg-$(1)-clean pkg-$(1)-app1
"include erlang.mk" \
> app1/Makefile
cp ../packages.v2.tsv app1/.erlang.mk.packages.v2
- $t $(MAKE) -C app1
- $t $(MAKE) -C app1
- if [ `find -type f -name erl_crash.dump` ]; then exit 33; fi
- erl +A0 -noinput -boot start_clean -pa app1/deps/*/ebin -eval " \
- Apps = [list_to_atom(App) || \"app1/deps/\" ++ App <- filelib:wildcard(\"app1/deps/*\")], \
- [begin \
- io:format(\"Loading application ~p~n\", [App]), \
- case application:load(App) of \
- {error, _} -> ok; \
- ok -> \
- {ok, Mods} = application:get_key(App, modules), \
- [try io:format(\" Loading module ~p~n\", [Mod]), \
- {module, Mod} = code:load_file(Mod) \
- catch C:R -> timer:sleep(500), erlang:C(R) \
- end || Mod <- Mods] \
- end \
- end || App <- Apps], \
- halt()."
+ $t \
+ $(MAKE) -C app1; if [ $$$$? -ne 0 ]; then \
+ echo "$(1): make error" >> pkgs.log; \
+ else \
+ $(MAKE) -C app1; if [ $$$$? -ne 0 ]; then \
+ echo "$(1): re-make error" >> pkgs.log; \
+ else \
+ find -type f -name erl_crash.dump; if [ $$$$? -ne 0 ]; then \
+ echo "$(1): erl_crash.dump found" >> pkgs.log; \
+ else \
+ erl +A0 -noinput -boot start_clean -pa app1/deps/*/ebin -eval " \
+ Apps = [list_to_atom(App) || \"app1/deps/\" ++ App \
+ <- filelib:wildcard(\"app1/deps/*\")], \
+ [begin \
+ io:format(\"Loading application ~p~n\", [App]), \
+ case application:load(App) of \
+ {error, _} -> ok; \
+ ok -> \
+ {ok, Mods} = application:get_key(App, modules), \
+ [try io:format(\" Loading module ~p~n\", [Mod]), \
+ {module, Mod} = code:load_file(Mod) \
+ catch C:R -> timer:sleep(500), erlang:C(R) \
+ end || Mod <- Mods] \
+ end \
+ end || App <- Apps], \
+ halt()."; if [ $$$$? -ne 0 ]; then \
+ echo "$(1): load error" >> pkgs.log; \
+ fi \
+ fi \
+ fi \
+ fi
endef
$(foreach pkg,$(shell awk '{print $$1}' ../packages.v2.tsv),$(eval $(call pkg_test_target,$(pkg))))
pkgs: $(foreach pkg,$(shell awk '{print $$1}' ../packages.v2.tsv),pkg-$(pkg))
+ @if [ -f pkgs.log ]; then \
+ echo "+-------------------------------+"; \
+ echo "| ERRORS WHILE TESTING PACKAGES |"; \
+ echo "+-------------------------------+"; \
+ cat pkgs.log; \
+ exit 33; \
+ fi
# Test application used for testing.
app1: