Note: This is taken from the Chicken Wiki, where a more recent version could be available.
TestBase test results database access procedures.
(require-extension testbase-results)
<parameter>(default-test-file-extension [EXTENSION])</parameter>
Get or set the test file source filename extension. EXTENSION is a string.
<parameter>(test-files-directory [DIRECTORY])</parameter>
Get or set the test file source repository directory. DIRECTORY is an absolute directory pathname string.
<parameter>(test-results-directory [DIRECTORY])</parameter>
Get or set the test file results repository directory. DIRECTORY is an absolute directory pathname string.
<procedure>(load-test-results-reader-extension EXTENSIONS)</procedure>
<procedure>(test-results-reader-setup EXPRESSIONS)</procedure>
<procedure>(make-test-file-pathname FILENAME)</procedure>
Returns an absolute pathname of a test file for FILENAME.
<procedure>(make-test-results-pathname FILENAME)</procedure>
Returns an absolute pathname of a results file for FILENAME.
<procedure>(create-test-results-file FILENAME)</procedure>
Creates a test results file FILENAME. If necessary an absolute pathname will be constructed using the current parameters.
<procedure>(delete-test-results-file FILENAME)</procedure>
Deletes the test results file FILENAME. If necessary an absolute pathname will be constructed using the current parameters.
<procedure>(read-test-results-file FILENAME [FOLD-PROCEDURE [INITIAL-VALUE]])</procedure>
Reads the contents of the test results file FILENAME and returns the last result of calling the FOLD-PROCEDURE. If necessary an absolute pathname will be constructed using the current parameters.
FOLD-PROCEDURE is a two argument procedure where the first argument is the current row and the second argument is the result of the previous call. The initial second argument is the empty list, '().
Default FOLD-PROCEDURE is cons.
Default INITIAL-VALUE is '().
<procedure>(append-test-results-row FILENAME ROW [HEADER '()])</procedure>
Write the test results file entry ROW to the test results file FILENAME, with the optional HEADER. If necessary an absolute pathname will be constructed using the current parameters.
The HEADER is a list of key+value pairs where the key is a symbol. The only recognized header entries are extension and setup.
<procedure>(read-test-results-rows PORT [FOLD-PROCEDURE [INITIAL-VALUE]])</procedure>
Reads the contents of the test results file from the open input PORT and calls the FOLD-PROCEDURE on each row and the accumulated result.
FOLD-PROCEDURE is a two argument procedure where the first argument is the current row and the second argument is the result of the previous call. The initial second argument is the empty list, '().
Default FOLD-PROCEDURE is cons.
Default INITIAL-VALUE is '().
<procedure>(make-test-results-row RESULTS [FIELD ...])</procedure>
Returns a test results file entry for the test results RESULTS and the optional FIELD ....
A FIELD is a pair of (KEY . VALUE).
<procedure>(test-results-row-field ROW KEY)</procedure>
Returns the test results file entry ROW field of the given name KEY.
<procedure>(test-results-row-when ROW)</procedure>
Returns the test results file entry ROW when field, a vector as returned by seconds->local-time.
<procedure>(test-results-row-results ROW)</procedure>
Returns the test results file entry ROW results field, a list.
<procedure>(test-results-failures RESULTS [TYPE-LIST '(expectation error)])</procedure>
Returns a list of the test failures in the RESULTS list for the given test types TYPE-LIST.
See Test Result Fields in the Test Result Object section.
<procedure>(test-results-remove! RESULTS IDENTIFIER-LIST)</procedure>
Returns the RESULTS list with all tests from the IDENTIFIER-LIST removed.
Object refers to any Scheme object. Atomic means boolean, number, string, symbol.
<procedure>(make-test-abnormal-exit-result EXIT-CODE ERROR-STRING)</procedure>
Returns a test result object that indicates a test process failed.
Really only for use by a test runner.
<procedure>(test-result-field RESULT KEY)</procedure>
Returns the test result RESULT field of the given name KEY.
<procedure>(test-result-fields RESULT [KEY ...])</procedure>
Returns the test result RESULT fields of the given name KEY as a list.
<procedure>(test-result-finding RESULT)</procedure>
Returns the test result RESULT finding field, which could be any object but usually a boolean. Since any object is possible use the test-result-passed? procedure to determine whether the test passed.
<procedure>(test-result-identifier RESULT)</procedure>
Returns the test result RESULT name, message, or id field, which could be any object but usually a string or symbol. The id field is returned when the name is missing.
<procedure>(test-result-passed? RESULT)</procedure>
Does the test result RESULT finding field indicate this test passed?
<procedure>(test-result-type RESULT)</procedure>
Returns the test result RESULT type field, a symbol.
(require-extension testbase-reports)
<procedure>(test-results-row-match? ROW [KEY OPER VAL] ...)</procedure>
Returns #t when all match expressions KEY OPER VAL are true, and #f otherwise. Operates as if there is an implicit AND between each match expression.
KEY is a symbol. A test-results-row field name.
OPER is one of = < > <= >= <>.
VAL is some object of the proper type for the test-results-row field.
<procedure>(declare-test-results-row-field [KEY PRED COMP] ...)</procedure>
Sets the type predicate PRED & comparison function COMP for the test-results-row field named KEY.
KEY is a symbol.
PRED is single-argument function returning #t when OBJECT is of the correct type, and #f otherwise.
COMP is a two-argument function returning a negative fixnum for A < B, zero fixnum for A = B, and positive fixnum for A > B.
The time-vector comparison checks the three-element time & three-element date components. Either must be complete (no #f elements) for a valid comparison.
Comparisons are case-sensitive.
<procedure>(print-test-result RESULT)</procedure>
Print the test result RESULT to the current output port.
<procedure>(print-test-results RESULTS)</procedure>
Print the test results list RESULTS to the current output port.
<procedure>(print-test-results-row ROW [KEY OPER VAL] ...)</procedure>
Print the test results file entry ROW to the current output port.
<procedure>(print-test-results-rows ROWS [KEY OPER VAL] ...)</procedure>
Print the test results file entry list ROWS to the current output port.
<procedure>(print-test-results-file FILENAME [KEY OPER VAL] ...)</procedure>
Print the test results file FILENAME to the current output port. If necessary an absolute pathname will be constructed using the current parameters.
numbers misc-extn miscmacros testbase
Copyright © 2007, 2008 Kon Lovett. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.