File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 28
28
29
29
30
30
(defmacro parametrized-test (name ((&rest parameter-names) &rest parameter-tuples) &body body)
31
+ " Generates a separate tests for each parameter combination.
32
+
33
+ - NAME is the prefix for all tests in the group. The rest of each test name consists of parameters and values.
34
+ - PARAMETER-NAMES should be a list of symbolic names of variables to be bound during BODY execution.
35
+ - PARAMETER-TUPLES should be a list of lists of values to be bound to variables given in PARAMETER-NAMES.
36
+
37
+ Example:
38
+
39
+ (parametrized-test bt-box-test
40
+ ((withreply-p timeout)
41
+ (nil nil)
42
+ (t 1)
43
+ (t nil))
44
+
45
+ (do-something with-reply-p timeout))
46
+
47
+ This form will be expanded to the code which will remove all 5AM tests starting with BT-BOX-TEST-
48
+ and then will create 3 tests like this one:
49
+
50
+
51
+ (test |BT-BOX-TEST-[WITHREPLY-P=T TIMEOUT=1]|
52
+ (let ((withreply-p t) (timeout 1))
53
+ (do-something with-reply-p timeout)))
54
+
55
+ As you can see, this test binds WITHREPLY-P and TIMEOUT variables to a values given in the second row of PARAMETER-TUPLES.
56
+
57
+ Name of each test will include parameter variables for this test. This way it will be easy to tell which parameter combination
58
+ fails.
59
+ "
31
60
(multiple-value-bind (forms decls docstring)
32
61
(parse-body body :documentation t :whole name)
33
62
(let* ((docstring (or docstring " " ))
You can’t perform that action at this time.
0 commit comments