From e519628eec711ff295096358652f60f42828e6b4 Mon Sep 17 00:00:00 2001 From: nevar Date: Fri, 25 Nov 2016 14:08:46 +0700 Subject: Add CT_LOGS_DIR --- test/plugin_ct.mk | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'test/plugin_ct.mk') 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)" -- cgit v1.2.3