<p>I would like to have a Guile script, which implements functions, which output test result messages according to the TAP protocol.</p>

[{'answer_id': 72272, 'author': 'Omer Zak', 'author_id': 11886, 'author_profile': 'https://Stackoverflow.com/users/11886', 'pm_score': 2, 'selected': False, 'text': '<p>The following script, to be named guiletap.scm, implements the frequently-needed functions for using the TAP protocol when running tests.</p>\n\n<pre>; Define functions for running Guile-written tests under the TAP protocol.\n; Copyright &#169; 2008 by Omer Zak\n; Released under the GNU LGPL 2.1 or (at your option) any later version.\n;;;\n;;; To invoke it:\n;;; (use-modules (guiletap))\n;;;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n(define-module (guiletap))\n(export plan)\n(export ok)\n(export bail_out)\n(export diag)\n(export is_ok)\n\n(use-modules (ice-9 format))\n\n; n is the number of tests.\n(define plan\n  (lambda (n) (display (format "1..~d~%" n))))\n\n; n -        test number\n; testdesc - test descriptor\n; res -      result which is #f at failure, other at success.\n(define ok\n  (lambda (n testdesc res)\n    (if (not res)(display "not "))\n    (display (format "ok ~d - ~a~%" n testdesc))))\n\n; testdesc - test descriptor\n(define bail_out\n  (lambda (testdesc)\n    (display (format "Bail out! - ~a~%" testdesc))))\n\n; diagmsg - diagnostic message\n(define diag\n  (lambda (diagmsg)\n    (display (format "# ~a~%" diagmsg))))\n\n; n -        test number\n; testdesc - test descriptor\n; expres -   expected test result\n; actres -   actual test result\n(define is_ok\n  (lambda (n testdesc expres actres)\n    (ok n testdesc (equal? expres actres))))\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n; !!! TODO:\n; !!! To be implemented also:\n; plan_no_plan\n; plan_skip_all [REASON]\n;\n; is RESULT EXPECTED [NAME]\n; isnt RESULT EXPECTED [NAME]\n; like RESULT PATTERN [NAME]\n; unlike RESULT PATTERN [NAME]\n; pass [NAME]\n; fail [NAME]\n;\n; skip CONDITION [REASON] [NB_TESTS=1]\n; Specify TODO mode by setting $TODO:\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n; End of guiletap.scm</pre>\n'}, {'answer_id': 21836368, 'author': 'Yawar', 'author_id': 20371, 'author_profile': 'https://Stackoverflow.com/users/20371', 'pm_score': 2, 'selected': False, 'text': '<p>There is also now <a href="https://github.com/yawaramin/ggspec" rel="nofollow">ggspec</a>, a Guile unit testing framework which can output results in (a subset of) TAP format. To do so, put all your test (Scheme) scripts in a project subdirectory named <code>spec</code> and run:</p>\n\n<pre><code>$ ggspec -f tap\n</code></pre>\n\n<p>Since ggspec is a full-fledged framework with setups, teardowns, and test skipping, there are more options. See the sample test file that comes with the project (<code>spec/lib-spec.scm</code>) for a good overview.</p>\n\n<p>Disclaimer: I wrote ggspec.</p>\n'}]
['https://Stackoverflow.com/questions/72057', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11886/']