aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-10-28 23:29:53 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-11-06 00:46:25 +0100
commitd567e51cebf8e25b1030367d2b946faba91233d3 (patch)
tree7b87ba68e06b6b27121ec19b7411a3c5cfb67f61
parentRemove unused module (hnh util set). (diff)
downloadcalp-d567e51cebf8e25b1030367d2b946faba91233d3.tar.gz
calp-d567e51cebf8e25b1030367d2b946faba91233d3.tar.xz
Uncovered files now have ALL their lines marked as uncovered.
Only marking one line as uncovered gave 100% miss, but when grouped with other files would be missleading, (0% + 0% + 100% \simeq 99%). This is also incorrect, since non-code lines are marked non-covered. But it draws the attention to the right places.
-rwxr-xr-xtestrunner.scm21
1 files changed, 16 insertions, 5 deletions
diff --git a/testrunner.scm b/testrunner.scm
index fbab2585..97981251 100755
--- a/testrunner.scm
+++ b/testrunner.scm
@@ -20,7 +20,7 @@ exec "$GUILE" --debug --no-auto-compile -e main -s "$0" "$@"
(srfi srfi-64)
(srfi srfi-71)
(srfi srfi-111)
- ((rnrs io ports) :select (get-bytevector-all))
+ ((rnrs io ports) :select (get-bytevector-all get-u8))
((hnh util) :select (-> ->> for group-by))
(hnh util path)
(hnh util type)
@@ -57,6 +57,15 @@ exec "$GUILE" --debug --no-auto-compile -e main -s "$0" "$@"
(thread-start! thread)
thread))
+(define (line-count port)
+ (let loop ((count 0)
+ (chr (get-u8 port)))
+ (if (eof-object? chr)
+ count
+ (loop (+ count (if (= chr 10)
+ 1 0))
+ (get-u8 port)))))
+
(define print
@@ -418,10 +427,12 @@ Flags:
(for-each output-coverage merged-coverages)
(for-each output-coverage
(map (lambda (filename)
- (coverage-info filename: filename
- lines: '((2 . 0))
- total-lines: 1
- hit-lines: 0))
+ (let ((lines (call-with-input-file filename line-count)))
+ (coverage-info filename: filename
+ lines: (map (lambda (x) (cons x 0))
+ (iota lines 1))
+ total-lines: lines
+ hit-lines: 0)))
uncovered-files)))))
(format #t "~%== Gathered errors ==~%")