Welcome to the CHICKEN Scheme pasting service

test statistics for C5 pasted by mario-goulart on Sat Feb 29 20:05:18 2020

$ cat ~/tmp/test-stats.scm 
(import (chicken file)
        (chicken pathname)
        (chicken process-context))

(let ((egg-files (command-line-arguments))
      (eggs-with-tests 0)
      (depend-on-test 0)
      (no-test-deps 0))
  (for-each
   (lambda (egg-file)
     (let* ((egg-data (with-input-from-file egg-file read))
            (has-tests?
             (file-exists?
              (make-pathname (list (pathname-directory egg-file) "tests")
                             "run.scm")))
            (test-deps (alist-ref 'test-dependencies egg-data eq? '())))
       (when has-tests?
         (set! eggs-with-tests (+ eggs-with-tests 1))
         (when (memq 'test test-deps)
           (set! depend-on-test (+ depend-on-test 1)))
         (when (null? test-deps)
           (set! no-test-deps (+ no-test-deps 1))))))
   egg-files)

  (print "Eggs with tests: " eggs-with-tests)
  (print "Eggs with tests that depend on the test egg: " depend-on-test)
  (print "Eggs with tests that do not depend on the test egg: "
         (- eggs-with-tests depend-on-test))
  (print "Eggs with tests that don't depend on any egg: " no-test-deps)
  )



$ csi -s ~/tmp/test-stats.scm $(ls */*/*.egg)
Eggs with tests: 253
Eggs with tests that depend on the test egg: 200
Eggs with tests that do not depend on the test egg: 53
Eggs with tests that don't depend on any egg: 30

test statistics for C5 using coop-explorer pasted by mario-goulart on Sat Feb 29 23:46:55 2020

;;; Using https://github.com/mario-goulart/coop-explorer

$ cat test-stats.scm 
(import coop-explorer)
(import srfi-1)

(populate-coop-db! "/home/mario/src/eggs/eggs-5-latest")

(print "Eggs with tests: "
       (length (filter egg-has-tests? (coop-eggs))))

(print "Eggs with tests that depend on the test egg: "
       (length (filter egg-has-tests? (egg-what-test-depends 'test))))

(print "Eggs with tests that do not depend on the test egg: "
       (length (filter (lambda (egg)
                         (and (egg-has-tests? egg)
                              (not (memq 'test (egg-test-dependencies egg)))))
                       (coop-eggs))))

(print "Eggs with tests that don't depend on any egg: "
       (length (filter (lambda (egg)
                         (and (egg-has-tests? egg)
                              (null? (egg-test-dependencies egg))))
                       (coop-eggs))))


$ csi -s test-stats.scm
Eggs with tests: 253
Eggs with tests that depend on the test egg: 200
Eggs with tests that do not depend on the test egg: 53
Eggs with tests that don't depend on any egg: 30

more test statistics for C5 added by mario-goulart on Sun Mar 1 09:47:22 2020

$ cat test-stats.scm
(import coop-explorer)
(import srfi-1)

(populate-coop-db! "/home/mario/src/eggs/eggs-5-latest")

(print "Eggs with tests: "
       (length (filter egg-has-tests? (coop-eggs))))

(print "Eggs with tests that depend on the test egg: "
       (length (filter egg-has-tests? (egg-what-test-depends 'test))))

(print "Eggs with tests that do not depend on the test egg: "
       (length (filter (lambda (egg)
                         (and (egg-has-tests? egg)
                              (not (memq 'test (egg-test-dependencies egg)))))
                       (coop-eggs))))

(print "Eggs with tests that don't depend on any egg: "
       (length (filter (lambda (egg)
                         (and (egg-has-tests? egg)
                              (null? (egg-test-dependencies egg))))
                       (coop-eggs))))

(print "Eggs that don't have tests but depend on the test egg: "
       (length (filter (lambda (egg)
                         (and (not (egg-has-tests? egg))
                              (memq 'test (egg-test-dependencies egg))))
                       (coop-eggs))))

(print "Eggs that don't have tests but have test dependencies: "
       (length (filter (lambda (egg)
                         (and (not (egg-has-tests? egg))
                              (not (null? (egg-test-dependencies egg)))))
                       (coop-eggs))))



$ csi -s test-stats.scm
Eggs with tests: 253
Eggs with tests that depend on the test egg: 200
Eggs with tests that do not depend on the test egg: 53
Eggs with tests that don't depend on any egg: 30
Eggs that don't have tests but depend on the test egg: 9
Eggs that don't have tests but have test dependencies: 10

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Type in the text below:
  __     _  _      _        
 / _| __| |(_)_ __| |__ ____
| |_ / _` || | '__| '_ \_  /
|  _| (_| || | |  | |_) / / 
|_|  \__,_|/ |_|  |_.__/___|
         |__/               
Visually impaired? Let me spell it for you (wav file) download WAV