aboutsummaryrefslogtreecommitdiffstats
path: root/test/plugin_ct.mk
diff options
context:
space:
mode:
authornevar <[email protected]>2016-11-25 14:08:46 +0700
committerLoïc Hoguin <[email protected]>2016-11-26 00:34:55 +0100
commite519628eec711ff295096358652f60f42828e6b4 (patch)
tree602758987520ad5c6d539efc1652b4203fe3cccf /test/plugin_ct.mk
parent5b67a3220b9fcc50a23064b52d3d328ac5e139f7 (diff)
downloaderlang.mk-e519628eec711ff295096358652f60f42828e6b4.tar.gz
erlang.mk-e519628eec711ff295096358652f60f42828e6b4.tar.bz2
erlang.mk-e519628eec711ff295096358652f60f42828e6b4.zip
Add CT_LOGS_DIR
Diffstat (limited to 'test/plugin_ct.mk')
-rw-r--r--test/plugin_ct.mk25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/plugin_ct.mk b/test/plugin_ct.mk
index c32fa36..50410c9 100644
--- a/test/plugin_ct.mk
+++ b/test/plugin_ct.mk
@@ -1,6 +1,6 @@
# Common Test plugin.
-CT_CASES = all apps-only case check group opts suite tests
+CT_CASES = all apps-only case check group logs-dir opts suite tests
CT_TARGETS = $(addprefix ct-,$(CT_CASES))
.PHONY: ct $(CT_TARGETS)
@@ -182,6 +182,29 @@ ct-opts: build clean
$i "Check that Common Test uses options from CT_OPTS"
$t grep -q hello_ct_opts $(APP)/logs/index.html
+ct-logs-dir: build clean
+
+ $i "Bootstrap a new OTP application named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
+
+ $i "Set CT_OPTS in the Makefile"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "CT_LOGS_DIR = custom_dir\n"}' $(APP)/Makefile
+
+ $i "Generate a Common Test suite"
+ $t mkdir $(APP)/test
+ $t printf "%s\n" \
+ "-module($(APP)_SUITE)." \
+ "-export([all/0, ok/1])." \
+ "all() -> [ok]." \
+ "ok(_) -> ok." > $(APP)/test/$(APP)_SUITE.erl
+
+ $i "Check that Common Test log in right place"
+ $t test ! -e $(APP)/custom_dir/index.html
+ $t $(MAKE) -C $(APP) ct $v
+ $t test -f $(APP)/custom_dir/index.html
+
ct-suite: build clean
$i "Bootstrap a new OTP application named $(APP)"