aboutsummaryrefslogtreecommitdiffstats
path: root/test/Makefile
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-05-12 15:07:05 +0300
committerLoïc Hoguin <[email protected]>2015-05-12 15:07:05 +0300
commit1643470a8772069d9984e217f6e2fd9b1c84fb4b (patch)
tree1be63098ee83e30c3d0b3961d7883f0d1f05baca /test/Makefile
parent789a4fb6be3bb92380e4314748872ab441ed5554 (diff)
downloaderlang.mk-1643470a8772069d9984e217f6e2fd9b1c84fb4b.tar.gz
erlang.mk-1643470a8772069d9984e217f6e2fd9b1c84fb4b.tar.bz2
erlang.mk-1643470a8772069d9984e217f6e2fd9b1c84fb4b.zip
Autopatch by default
Also fix a number of issues with packages from the index. Some packages were temporarily removed and will be added back once they build correctly.
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile36
1 files changed, 33 insertions, 3 deletions
diff --git a/test/Makefile b/test/Makefile
index 5449ee5..9b7d4a1 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -35,7 +35,9 @@ endif
.PHONY: all clean app ct eunit tests-cover docs
-all: clean app ct eunit tests-cover docs
+.NOTPARALLEL:
+
+all: clean app ct eunit tests-cover docs pkgs
$i '+---------------------+'
$i '| All tests passed. |'
$i '+---------------------+'
@@ -195,8 +197,7 @@ docs: app1
$t rm app1/Makefile-doc
$i "Test 'docs' passed."
-# Test application used for testing.
-app1:
+define app1_setup
$i "Setting up app."
$t mkdir -p app1
$t cd .. && make
@@ -207,6 +208,35 @@ app1:
"-export([succ/1])." \
"succ(N) -> N + 1." \
> app1/src/m.erl
+endef
+
+define pkg_test_target
+pkg-$(1)-clean:
+ $t rm -rf app1
+
+pkg-$(1)-app1:
+ $(call app1_setup)
+
+pkg-$(1): pkg-$(1)-clean pkg-$(1)-app1
+ $i
+ $i " pkgs: Checking that '$(1)' builds correctly"
+ $i
+ $t printf "%s\n" \
+ "PROJECT = app1" \
+ "DEPS = $(1)" \
+ "include erlang.mk" \
+ > app1/Makefile
+ cp ../packages.v2.tsv app1/.erlang.mk.packages.v2
+ $t make -C app1
+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))
+
+# Test application used for testing.
+app1:
+ $(call app1_setup)
# Extra module in app1 used for testing eunit
define create-module-t