unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* SRFI-64 implementation for Guile 2.0
@ 2012-04-12 21:53 Sunjoong Lee
  2012-04-14  1:39 ` Sunjoong Lee
  0 siblings, 1 reply; 15+ messages in thread
From: Sunjoong Lee @ 2012-04-12 21:53 UTC (permalink / raw)
  To: Per Bothner; +Cc: guile-user


[-- Attachment #1.1: Type: text/plain, Size: 2955 bytes --]

Hello, world! :)

I'm a newbie of scheme. I'd heard the testing framework SRFI-64 but failed
to use it on Guile 2.0.
After attempt to solve this problem, I made a guile module to pass the test
suite for SRFI-64 by Donovan Kolbly.

--
1. srfi/srfi-64.scm is a SRFI-64 implementation for Guile 2.0.
   srfi-64-test.scm is a test suite for SRFI-64 itself by Donovan Kolbly.

   $ ls -RF
   .:
   README  srfi/  srfi-64-test.scm
   ./srfi:
   srfi-64.scm
   $

2. srfi/srfi-64.scm provide the srfi-64 module for Guile.

   $ guile -L . --use-srfi=64 srfi-64-test.scm
   %%%% Starting test SRFI 64 - Meta-Test Suite  (Writing full log to "SRFI
64 - Meta-Test Suite.log")
   # of expected passes      51
   # of expected failures    2
   $ ls -F
   README  SRFI 64 - Meta-Test Suite.log  srfi/  srfi-64-test.scm
   $

3. Somethings were changed:
   1) test-log-to-file is a parameter object.
   2) test-on-test-end-simple and test-on-final-simple have a return value.
   3) and so on.

   Example of log to another file:

   $ guile -L `pwd`
   scheme@(guile-user)> (use-modules (srfi srfi-64))
   scheme@(guile-user)> (test-log-to-file (open-output-file "my-log.log"))
   scheme@(guile-user)> (load "srfi-64-test.scm")
   %%%% Starting test SRFI 64 - Meta-Test Suite
   # of expected passes      51
   # of expected failures    2
   $1 = (51 2 0 0 0)
   scheme@(guile-user)> (close-output-port (test-log-to-file))
   scheme@(guile-user)> ,q
   $

   Contents of log files are same:

   $ ls -F
   README  SRFI 64 - Meta-Test Suite.log  my-log.log  srfi/
 srfi-64-test.scm
   $ diff SRFI\ 64\ -\ Meta-Test\ Suite.log my-log.log
   $ rm SRFI\ 64\ -\ Meta-Test\ Suite.log my-log.log
   $ ls -F
   README  srfi/  srfi-64-test.scm
   $

   Example of not log:

   $ guile -L `pwd`
   scheme@(guile-user)> (use-modules (srfi srfi-64))
   scheme@(guile-user)> (test-log-to-file #f)
   scheme@(guile-user)> (load "srfi-64-test.scm")
   %%%% Starting test SRFI 64 - Meta-Test Suite
   # of expected passes      51
   # of expected failures    2
   $1 = (51 2 0 0 0)
   scheme@(guile-user)> ,q
   $

   The log file were not generated:

   $ ls -F
   README  srfi/  srfi-64-test.scm
   $

   Example in Guile interactive mode:

   $ guile -L `pwd`
   scheme@(guile-user)> (use-modules (srfi srfi-64))
   scheme@(guile-user)> (test-log-to-file #f)
   scheme@(guile-user)> (test-begin "vec-test")
   %%%% Starting test vec-test
   $1 = ("vec-test")
   scheme@(guile-user)> (define v (make-vector 5 99))
   scheme@(guile-user)> (test-assert (vector? v))
   $2 = pass
   scheme@(guile-user)> (test-eqv 99 (vector-ref v 2))
   $3 = pass
   scheme@(guile-user)> (vector-set! v 2 7)
   scheme@(guile-user)> (test-eqv 7 (vector-ref v 2))
   $4 = pass
   scheme@(guile-user)> (test-eqv 8 (vector-ref v 2))
   $5 = fail
   scheme@(guile-user)> (test-end "vec-test")
   # of expected passes      3
   # of unexpected failures  1
   $6 = (3 0 0 1 0)
   scheme@(guile-user)> ,q
   $

[-- Attachment #1.2: Type: text/html, Size: 4409 bytes --]

[-- Attachment #2: srfi-64-guile.tar.gz --]
[-- Type: application/x-gzip, Size: 11846 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-12-28  3:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-12 21:53 SRFI-64 implementation for Guile 2.0 Sunjoong Lee
2012-04-14  1:39 ` Sunjoong Lee
2012-04-14  2:06   ` Per Bothner
2012-04-14 12:43     ` Sunjoong Lee
2012-04-15 20:35       ` Sunjoong Lee
2012-04-20  2:50         ` Noah Lavine
2012-04-20  4:21           ` Per Bothner
2012-04-20 10:19             ` Sunjoong Lee
2012-04-20 18:27               ` Per Bothner
2012-04-20 20:53                 ` Sunjoong Lee
2012-04-20 15:18             ` Ludovic Courtès
2012-04-20 17:36               ` Sunjoong Lee
2012-04-21 23:08                 ` Ludovic Courtès
2012-04-23  6:07                   ` Sunjoong Lee
2012-12-28  3:22                     ` Per Bothner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).