git.fiddlerwoaroof.com
Browse code

Add package docstrings to testing code, fix benchmarking

Fernando Borretti authored on 22/04/2015 22:40:06
Showing 7 changed files
... ...
@@ -1,7 +1,8 @@
1 1
 (in-package :cl-user)
2 2
 (defpackage cl-yaml-test.bench
3 3
   (:use :cl :fiveam)
4
-  (:export :bench))
4
+  (:export :bench)
5
+  (:documentation "Benchmarks."))
5 6
 (in-package :cl-yaml-test.bench)
6 7
 
7 8
 ;;; Utilities
... ...
@@ -9,8 +10,9 @@
9 10
 (defmacro bench (string)
10 11
   `(finishes
11 12
      (format t "~%Benchmarking: ~S" ,string)
12
-     (benchmark:with-timing 1000
13
-       (yaml:parse ,string))))
13
+     (time
14
+      (benchmark:with-timing (1000)
15
+        (yaml:parse ,string)))))
14 16
 
15 17
 
16 18
 ;;; Tests
... ...
@@ -1,6 +1,7 @@
1 1
 (in-package :cl-user)
2 2
 (defpackage cl-yaml-test
3
-  (:use :cl :fiveam))
3
+  (:use :cl :fiveam)
4
+  (:documentation "Run all test suites."))
4 5
 (in-package :cl-yaml-test)
5 6
 
6 7
 (run! 'cl-yaml-test.float:float)
... ...
@@ -3,7 +3,8 @@
3 3
   (:use :cl :fiveam)
4 4
   (:import-from :alexandria
5 5
                 :alist-hash-table)
6
-  (:export :emitter))
6
+  (:export :emitter)
7
+  (:documentation "Emitter tests."))
7 8
 (in-package :cl-yaml-test.emitter)
8 9
 
9 10
 ;;; Macros
... ...
@@ -1,7 +1,8 @@
1 1
 (in-package :cl-user)
2 2
 (defpackage cl-yaml-test.float
3 3
   (:use :cl :fiveam)
4
-  (:export :float))
4
+  (:export :float)
5
+  (:documentation "Test floating-point number support."))
5 6
 (in-package :cl-yaml-test.float)
6 7
 
7 8
 (def-suite float
... ...
@@ -3,7 +3,8 @@
3 3
   (:use :cl :fiveam)
4 4
   (:import-from :alexandria
5 5
                 :alist-hash-table)
6
-  (:export :parser))
6
+  (:export :parser)
7
+  (:documentation "Parser tests."))
7 8
 (in-package :cl-yaml-test.parser)
8 9
 
9 10
 (def-suite parser
... ...
@@ -1,7 +1,8 @@
1 1
 (in-package :cl-user)
2 2
 (defpackage cl-yaml-test.scalar
3 3
   (:use :cl :fiveam)
4
-  (:export :scalar))
4
+  (:export :scalar)
5
+  (:documentation "Scalar parsing tests."))
5 6
 (in-package :cl-yaml-test.scalar)
6 7
 
7 8
 ;;; Macros
... ...
@@ -1,7 +1,8 @@
1 1
 (in-package :cl-user)
2 2
 (defpackage cl-yaml-test.spec
3 3
   (:use :cl :fiveam)
4
-  (:export :spec))
4
+  (:export :spec)
5
+  (:documentation "Run tests from the specification."))
5 6
 (in-package :cl-yaml-test.spec)
6 7
 
7 8
 (def-suite spec