Просмотр исходного кода

Default COVER_DATA_DIR now the same as COVER_REPORT_DIR

We have a dedicated folder for cover stuff, let's use it.
Loïc Hoguin 6 лет назад
Родитель
Сommit
44fe1e993f
3 измененных файлов с 16 добавлено и 13 удалено
  1. 3 0
      CHANGELOG.asciidoc
  2. 1 1
      plugins/cover.mk
  3. 12 12
      test/plugin_cover.mk

+ 3 - 0
CHANGELOG.asciidoc

@@ -7,3 +7,6 @@
             information. A quick fix if this causes an
             information. A quick fix if this causes an
             issue is to add `FULL = 1` at the top of your
             issue is to add `FULL = 1` at the top of your
             Makefile.
             Makefile.
+
+2018/12/06: Change the default COVER_DATA_DIR to be the
+            same as COVER_REPORT_DIR.

+ 1 - 1
plugins/cover.mk

@@ -3,7 +3,7 @@
 # This file is part of erlang.mk and subject to the terms of the ISC License.
 # This file is part of erlang.mk and subject to the terms of the ISC License.
 
 
 COVER_REPORT_DIR ?= cover
 COVER_REPORT_DIR ?= cover
-COVER_DATA_DIR ?= $(CURDIR)
+COVER_DATA_DIR ?= $(COVER_REPORT_DIR)
 
 
 # Hook in coverage to ct
 # Hook in coverage to ct
 
 

+ 12 - 12
test/plugin_cover.mk

@@ -25,12 +25,12 @@ cover-ct: build clean
 	$t $(MAKE) -C $(APP) ct COVER=1 $v
 	$t $(MAKE) -C $(APP) ct COVER=1 $v
 
 
 	$i "Check that the generated files exist"
 	$i "Check that the generated files exist"
-	$t test -f $(APP)/ct.coverdata
+	$t test -f $(APP)/cover/ct.coverdata
 	$t test -f $(APP)/test/ct.cover.spec
 	$t test -f $(APP)/test/ct.cover.spec
 
 
 	$i "Check that the generated files are removed on clean"
 	$i "Check that the generated files are removed on clean"
 	$t $(MAKE) -C $(APP) clean $v
 	$t $(MAKE) -C $(APP) clean $v
-	$t test ! -e $(APP)/ct.coverdata
+	$t test ! -e $(APP)/cover/ct.coverdata
 	$t test ! -e $(APP)/test/ct.cover.spec
 	$t test ! -e $(APP)/test/ct.cover.spec
 
 
 cover-custom-dir: build clean
 cover-custom-dir: build clean
@@ -108,11 +108,11 @@ cover-eunit: build clean
 	$t $(MAKE) -C $(APP) eunit COVER=1 $v
 	$t $(MAKE) -C $(APP) eunit COVER=1 $v
 
 
 	$i "Check that the generated file exists"
 	$i "Check that the generated file exists"
-	$t test -f $(APP)/eunit.coverdata
+	$t test -f $(APP)/cover/eunit.coverdata
 
 
 	$i "Check that the generated file is removed on clean"
 	$i "Check that the generated file is removed on clean"
 	$t $(MAKE) -C $(APP) clean $v
 	$t $(MAKE) -C $(APP) clean $v
-	$t test ! -e $(APP)/eunit.coverdata
+	$t test ! -e $(APP)/cover/eunit.coverdata
 
 
 cover-eunit-apps-only: build clean
 cover-eunit-apps-only: build clean
 
 
@@ -136,10 +136,10 @@ cover-eunit-apps-only: build clean
 	$t $(MAKE) -C $(APP) eunit COVER=1 $v
 	$t $(MAKE) -C $(APP) eunit COVER=1 $v
 
 
 	$i "Check that no file was generated in the top-level directory"
 	$i "Check that no file was generated in the top-level directory"
-	$t ! test -f $(APP)/eunit.coverdata
+	$t ! test -f $(APP)/cover/eunit.coverdata
 
 
 	$i "Check that the generated file exists"
 	$i "Check that the generated file exists"
-	$t test -f $(APP)/apps/my_app/eunit.coverdata
+	$t test -f $(APP)/apps/my_app/cover/eunit.coverdata
 
 
 cover-report-and-merge: build clean
 cover-report-and-merge: build clean
 
 
@@ -170,19 +170,19 @@ cover-report-and-merge: build clean
 	$i "Check that the generated files exist"
 	$i "Check that the generated files exist"
 	$t test -f $(APP)/cover/$(APP).COVER.html
 	$t test -f $(APP)/cover/$(APP).COVER.html
 	$t test -f $(APP)/cover/index.html
 	$t test -f $(APP)/cover/index.html
-	$t test -f $(APP)/ct.coverdata
-	$t test -f $(APP)/eunit.coverdata
+	$t test -f $(APP)/cover/ct.coverdata
+	$t test -f $(APP)/cover/eunit.coverdata
 	$t test -f $(APP)/test/ct.cover.spec
 	$t test -f $(APP)/test/ct.cover.spec
 
 
 	$i "Merge coverdata files into all.coverdata"
 	$i "Merge coverdata files into all.coverdata"
 	$t $(MAKE) -C $(APP) all.coverdata $v
 	$t $(MAKE) -C $(APP) all.coverdata $v
-	$t test -f $(APP)/all.coverdata
+	$t test -f $(APP)/cover/all.coverdata
 
 
 	$i "Check that the generated files are removed on clean"
 	$i "Check that the generated files are removed on clean"
 	$t $(MAKE) -C $(APP) clean $v
 	$t $(MAKE) -C $(APP) clean $v
-	$t test ! -e $(APP)/all.coverdata
-	$t test ! -e $(APP)/ct.coverdata
-	$t test ! -e $(APP)/eunit.coverdata
+	$t test ! -e $(APP)/cover/all.coverdata
+	$t test ! -e $(APP)/cover/ct.coverdata
+	$t test ! -e $(APP)/cover/eunit.coverdata
 	$t test ! -e $(APP)/test/ct.cover.spec
 	$t test ! -e $(APP)/test/ct.cover.spec
 
 
 	$i "Check that the cover report is removed on distclean"
 	$i "Check that the cover report is removed on distclean"