Jelajahi Sumber

Moved code coverage configuration into .coveragerc file.

Taddeus Kroes 13 tahun lalu
induk
melakukan
1b904eb129
2 mengubah file dengan 18 tambahan dan 10 penghapusan
  1. 9 0
      .coveragerc
  2. 9 10
      Makefile

+ 9 - 0
.coveragerc

@@ -0,0 +1,9 @@
+[run]
+branch = true
+omit =
+    /usr/share/pyshared/*
+    test.py
+    tests/*
+
+[html]
+directory = coverage

+ 9 - 10
Makefile

@@ -1,20 +1,19 @@
 TEST := test.py
 COVERAGE_DIR := coverage
-COVERAGE_OMIT=/usr/share/pyshared/*,test.py,tests/*
 
 test:
 	@pyrg $(TEST)
 
-coverage:
-	coverage erase
-	@if [ -d $(COVERAGE_DIR) ]; then rm -rf $(COVERAGE_DIR)/* \
-	else mkdir $(COVERAGE_DIR); fi
+coverage: covclean
 	coverage run test.py
-	coverage html --omit=$(COVERAGE_OMIT) -d $(COVERAGE_DIR)
-	coverage report --omit=$(COVERAGE_OMIT)
+	coverage report
+	coverage html
 
-clean:
+covclean:
 	coverage erase
-	rm -rf $(COVERAGE_DIR) `find -name \*.pyc`
+	rm -rf $(COVERAGE_DIR)
+
+clean: covclean
+	rm `find -name \*.pyc`
 
-.PHONY: test clean coverage
+.PHONY: test clean coverage covclean