Skip to content

Commit

Permalink
Print a form suitable for exporting testcases defined by a package
Browse files Browse the repository at this point in the history
Also update the DOCSTRINGS file from SBCL 2.4.3.
  • Loading branch information
foretspaisibles committed Apr 13, 2024
1 parent 98b0b68 commit 9dec3db
Show file tree
Hide file tree
Showing 6 changed files with 227 additions and 134 deletions.
4 changes: 1 addition & 3 deletions development/makedoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ makedoc_extract()
makedoc_sbcl \
--eval "(ql:quickload :${makedocsystem})"\
--eval '(with-compilation-unit () (load "libexec/lisp/docstrings.lisp"))' \
--eval "(sb-texinfo:generate-includes \
\"obj/makedoc/include/\" \
(list :${makedocsystem}) :base-package :${makedocsystem})" \
--eval "(sb-texinfo:generate-includes \"obj/makedoc/include/\" :${makedocsystem})" \
--eval '(quit)'
}

Expand Down
69 changes: 40 additions & 29 deletions doc/org.melusina.confidence.texinfo
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ are also available at https://opensource.org/licenses/MIT

@c We use @andkey, etc to escape & from TeX in lambda lists --
@c so we need to define them for info as well.
@macro earmuffs{identifier}
*\identifier\*
@end macro
@macro andallowotherkeys
&allow-other-keys@tie{}
@end macro
Expand All @@ -57,9 +60,15 @@ are also available at https://opensource.org/licenses/MIT
&body@tie{}
@end macro

@ifnottex
@include include/package-macros.texinfo
@iftex
@macro orgmelusinaconfidence{name}
\name\
@end macro
@end iftex

@include include/ifnottex.texinfo

@ifnottex

@node Top, , ,
@comment node-name, next, previous, up
Expand Down Expand Up @@ -106,7 +115,7 @@ function. A special kind of function, but a function.

@menu
* Define Assertions::
* Basic Assertions::
* Comparison Assertions::
* Condition Assertions::
* Character Assertions::
* String Assertions::
Expand All @@ -115,12 +124,12 @@ function. A special kind of function, but a function.
* Floating Number Assertions::
@end menu

@node Define Assertions, Basic Assertions, Assertions, Assertions
@node Define Assertions, Comparison Assertions, Assertions, Assertions
@section Define Assertions
@include include/macro-org.melusina.confidence-define-assertion.texinfo

@node Basic Assertions, Condition Assertions, Define Assertions, Assertions
@section Basic Assertions
@node Comparison Assertions, Condition Assertions, Define Assertions, Assertions
@section Comparison Assertions

@include include/fun-org.melusina.confidence-assert-t.texinfo
@include include/fun-org.melusina.confidence-assert-t-star.texinfo
Expand All @@ -130,13 +139,13 @@ function. A special kind of function, but a function.
@include include/fun-org.melusina.confidence-assert-eql.texinfo
@include include/fun-org.melusina.confidence-assert-equal.texinfo
@include include/fun-org.melusina.confidence-assert-equalp.texinfo
@include include/fun-org.melusina.confidence-assert-equals.texinfo
@include include/fun-org.melusina.confidence-assert=.texinfo
@include include/fun-org.melusina.confidence-assert-lt.texinfo
@include include/fun-org.melusina.confidence-assert-gt.texinfo
@include include/fun-org.melusina.confidence-assert-lt-equals.texinfo
@include include/fun-org.melusina.confidence-assert-gt-equals.texinfo
@include include/fun-org.melusina.confidence-assert-lt=.texinfo
@include include/fun-org.melusina.confidence-assert-gt=.texinfo

@node Condition Assertions, Character Assertions, Basic Assertions, Assertions
@node Condition Assertions, Character Assertions, Comparison Assertions, Assertions
@section Condition Assertions

@include include/macro-org.melusina.confidence-assert-condition.texinfo
Expand All @@ -145,21 +154,21 @@ function. A special kind of function, but a function.
@section Character Assertions

@include include/fun-org.melusina.confidence-assert-char-equal.texinfo
@include include/fun-org.melusina.confidence-assert-char-equals.texinfo
@include include/fun-org.melusina.confidence-assert-char=.texinfo
@include include/fun-org.melusina.confidence-assert-char-gt.texinfo
@include include/fun-org.melusina.confidence-assert-char-gt-equals.texinfo
@include include/fun-org.melusina.confidence-assert-char-gt=.texinfo
@include include/fun-org.melusina.confidence-assert-char-lt.texinfo
@include include/fun-org.melusina.confidence-assert-char-lt-equals.texinfo
@include include/fun-org.melusina.confidence-assert-char-lt=.texinfo

@node String Assertions, List Assertions, Character Assertions, Assertions
@section String Assertions

@include include/fun-org.melusina.confidence-assert-string-equal.texinfo
@include include/fun-org.melusina.confidence-assert-string-equals.texinfo
@include include/fun-org.melusina.confidence-assert-string=.texinfo
@include include/fun-org.melusina.confidence-assert-string-gt.texinfo
@include include/fun-org.melusina.confidence-assert-string-gt-equals.texinfo
@include include/fun-org.melusina.confidence-assert-string-gt=.texinfo
@include include/fun-org.melusina.confidence-assert-string-lt.texinfo
@include include/fun-org.melusina.confidence-assert-string-lt-equals.texinfo
@include include/fun-org.melusina.confidence-assert-string-lt=.texinfo
@include include/fun-org.melusina.confidence-assert-string-match.texinfo

@node List Assertions, Vector Assertions, String Assertions, Assertions
Expand Down Expand Up @@ -255,9 +264,12 @@ into the debugger.

Defined testcases are automatically exported, which makes it easy to
call them from the REPL, the testsuite tool or to add them to
generated documentation.
generated documentation. It could however be desirable to explciitly
add them to the export list of a package. To support this, the
@b{Confidence} system exports the following function:

@include include/fun-org.melusina.confidence-print-export-list-for-testcases.texinfo

XXXX

@node Specialities, , Testcases, Top
@chapter Specialities
Expand All @@ -274,7 +286,7 @@ test resources is just working as expected.

It is simple enough to define a with-macro in Common Lisp so that
@b{Confidence} does not provide an extra feature to do so. Just mind
the `unwind-protect` operator.
the @code{unwind-protect} operator.


@section Test Hierarchies
Expand All @@ -296,31 +308,30 @@ functional tests journeys, adding fixtures to the defined testsuite.
Having a testcase explicitly listing the other testcases it must run
is a simple and reliable organisation that never lies to the
programmer. It also makes the test hierarchy navigable in IDEs
without extra tooling, which is a good thing.
without supplementary tooling.


@section Test Tags

Some test frameworks provide a tag feature so that it possible to run
tests according to some tags attached to them.

Using tags to decorate tests that need to be run in such or such
context, similarly to what popular Java test frameworks propose,
obfuscates the test workflow and nobody wants to discover after
several weeks of operation that some tests were not run by the
deployment pipeline.
tests according to some tags attached to them. Some popular Java
testing frameworks offer such a tag feature. Relying on this to decide
which tests to run obfuscates the test workflow and makes it hard to
understand which tests are run in a specific context.

Having a testcase explicitly listing the other testcases it must run
is a simple and reliable organisation that never lies to the
programmer. It also makes the test hierarchy navigable in IDEs
without extra tooling, which is a good thing.
without extra tooling.


@section Test Selection

When some tests are only relevant to some platform, or must be be
controlled by a feature, it is very easy to control their inclusion in
the testsuite using the feature-related reader macros. It does not
seem necessary for @b{Confidence} to provide extra tools here.
seem necessary for @b{Confidence} to provide special features as the
usual Common Lisp operstors @code{when}, @code{unless} and
@code{return-from} can be used here.

@bye
Loading

0 comments on commit 9dec3db

Please sign in to comment.