8c5554871e35 — Duncan Ross Palmer 9 months ago
c66021f6184a: Fix up all scripts to allow make report to be separate from make test
2 files changed, 17 insertions(+), 9 deletions(-)

M Makefile
M t/run.sh
M Makefile +10 -6
@@ 6,8 6,10 @@ PROFILE=default
 
 all : handler.zip
 
-clean:
-	cover -delete
+__cleandb:
+	@cover -delete
+
+clean: __cleandb
 	rm -f handler.zip
 
 handler.zip: FORCE

          
@@ 28,13 30,15 @@ update : test all
 		--function-name ${FUNCTION} \
 		--zip-file fileb://handler.zip
 
-check : test
-test:
-	cover -delete
+check: test
+test: __cleandb
 	$(SHELL) t/run.sh
+
+report: __cleandb
+	$(SHELL) t/run.sh report
 	cover --ignore_re ^t -report html
 	lynx -dump cover_db/coverage.html | ./bin/cover_check
 
 FORCE:
 
-.PHONY: update publish clean all test
+.PHONY: update publish clean all test report __cleandb

          
M t/run.sh +7 -3
@@ 1,7 1,7 @@ 
 #!/bin/sh
 #
-# Daybo Logic Podcast downloader
-# Copyright (c) 2012-2016, David Duncan Ross Palmer (2E0EOL) and others,
+# OverHam; An object-orientated ham radio math and tool library
+# Copyright (c) 2015-2019, Duncan Ross Palmer (2E0EOL),
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without

          
@@ 30,12 30,16 @@ 
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
+if [ "$1" = "report" ]; then
+	export PERL5OPT=-MDevel::Cover
+fi
+
 for t in t/*.t; do
 	if test ! -x $t; then
 		echo Found non executable test $t
 	else
 		echo "Running $t"
-		PERL5OPT=-MDevel::Cover PERL5LIB=lib $t
+		perl -Ilib $t
 		if test "0" -ne "$?"; then
 			echo $t failed.
 			exit 1;