Re: [Chicken-users] test egg

2011-11-01 Thread Mario Domenech Goulart
Hi Curtis,

On Mon, 31 Oct 2011 20:07:57 -0700 Curtis Cooley curtis.coo...@gmail.com 
wrote:

 I'm trying to get the test egg working, but I'm not getting very far.
 I'm using chicken to learn scheme, so I'm really new at all this. I'm
 running Linux Mint 11, but I've downloaded and compiled chicken 4.7
 because Mint came with 4.2 and I could not even get the test egg to
 load. Any help or pointers are much appreciated. I'm trying to take a
 TDD pass through SICM.

 Here's the output from csi:

 #;1 (require-extension test)
 ; loading /usr/local/lib/chicken/6/test.import.so ...
 ; loading /usr/local/lib/chicken/6/regex.import.so ...
 ; loading /usr/local/lib/chicken/6/irregex.import.so ...
 ; loading /usr/local/lib/chicken/6/extras.import.so ...
 ; loading /usr/local/lib/chicken/6/test.so ...
 ; loading /usr/local/lib/chicken/6/regex.so ...
 #;2 (test 4 (+ 2 2))

 Error: (cdr) bad argument type: #f

It seems that the latest release of the test egg is broken.  You can try
version 0.9.9.2, which is the last before the latest (alas, you'd need a
copy of the svn repo to find that out, since the version history in the
docs has not been updated).

To install 0.9.9.2 you can run:

$ chicken-install test:0.9.9.2

I hope that helps.


Best wishes.
Mario
-- 
http://parenteses.org/mario

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] test egg

2011-11-01 Thread Alex Shinn
On Tue, Nov 1, 2011 at 6:47 PM, Mario Domenech Goulart
mario.goul...@gmail.com wrote:
 Hi Curtis,

 On Mon, 31 Oct 2011 20:07:57 -0700 Curtis Cooley curtis.coo...@gmail.com 
 wrote:

 I'm trying to get the test egg working, but I'm not getting very far.
 I'm using chicken to learn scheme, so I'm really new at all this. I'm
 running Linux Mint 11, but I've downloaded and compiled chicken 4.7
 because Mint came with 4.2 and I could not even get the test egg to
 load. Any help or pointers are much appreciated. I'm trying to take a
 TDD pass through SICM.

 Here's the output from csi:

 #;1 (require-extension test)
 ; loading /usr/local/lib/chicken/6/test.import.so ...
 ; loading /usr/local/lib/chicken/6/regex.import.so ...
 ; loading /usr/local/lib/chicken/6/irregex.import.so ...
 ; loading /usr/local/lib/chicken/6/extras.import.so ...
 ; loading /usr/local/lib/chicken/6/test.so ...
 ; loading /usr/local/lib/chicken/6/regex.so ...
 #;2 (test 4 (+ 2 2))

 Error: (cdr) bad argument type: #f

 It seems that the latest release of the test egg is broken.  You can try
 version 0.9.9.2, which is the last before the latest (alas, you'd need a
 copy of the svn repo to find that out, since the version history in the
 docs has not been updated).

 To install 0.9.9.2 you can run:

    $ chicken-install test:0.9.9.2

 I hope that helps.

It's not completely broken, you just need to call

(test-begin)

before any tests (or use test-group).

I'll fix this as soon as I get home, but it's not
very meaningful to use tests without any group.

-- 
Alex

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] test egg

2011-11-01 Thread Christian Kellermann
* Alex Shinn alexsh...@gmail.com [01 11:06]:
  #;2 (test 4 (+ 2 2))
 
  Error: (cdr) bad argument type: #f
 
 I'll fix this as soon as I get home, but it's not
 very meaningful to use tests without any group.

Ah I guess the confusion comes from the example above which is the
one from the docs...

-- 
Who can (make) the muddy water (clear)? Let it be still, and it will
gradually become clear. Who can secure the condition of rest? Let
movement go on, and the condition of rest will gradually arise.
 -- Lao Tse. 

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] test egg

2011-11-01 Thread Alex Shinn
On Tue, Nov 1, 2011 at 7:24 PM, Christian Kellermann
ck...@pestilenz.org wrote:
 * Alex Shinn alexsh...@gmail.com [01 11:06]:
  #;2 (test 4 (+ 2 2))
 
  Error: (cdr) bad argument type: #f

 I'll fix this as soon as I get home, but it's not
 very meaningful to use tests without any group.

 Ah I guess the confusion comes from the example above which is the
 one from the docs...

Yes - you basically always want to use a group,
but it's nice to be able to run simple examples in
the repl.

Fixed now.

-- 
Alex

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] test egg

2011-11-01 Thread Mario Domenech Goulart
On Tue, 1 Nov 2011 20:17:44 +0900 Alex Shinn alexsh...@gmail.com wrote:

 On Tue, Nov 1, 2011 at 7:24 PM, Christian Kellermann
 ck...@pestilenz.org wrote:
 * Alex Shinn alexsh...@gmail.com [01 11:06]:
  #;2 (test 4 (+ 2 2))
 
  Error: (cdr) bad argument type: #f

 I'll fix this as soon as I get home, but it's not
 very meaningful to use tests without any group.

 Ah I guess the confusion comes from the example above which is the
 one from the docs...

 Yes - you basically always want to use a group,
 but it's nice to be able to run simple examples in
 the repl.

 Fixed now.

Thanks for the quick fix, Alex.

Curtis: version 0.9.9.4 is available.  chicken-install test should
install it.

Best wishes.
Mario
-- 
http://parenteses.org/mario

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Test egg question

2007-11-04 Thread Alex Shinn
Hi,

On Nov 4, 2007 12:02 AM, Peter Busser [EMAIL PROTECTED] wrote:

 I'm writing a number of test cases using the test egg. I would like to use
 the test program for automated testing. Is it possible to know that one of
 the tests failed, so I can exit the program with an error value?

I was thinking of adding something like this.  In the meantime
you can hack it with something like this:

(define (test-group-ref group key default)
  (cond ((assq key (cdr (current-test-group))) = cdr)
(else default)))

(define all-tests-passed?
  (zero? (+ (or (test-group-ref (current-test-group) 'FAIL #f) 0)
(or (test-group-ref (current-test-group) 'ERROR #f) 0

(test-end)

(exit (if all-tests-passed? 0 1))

-- 
Alex


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Test egg question

2007-11-04 Thread Alex Shinn
 On Nov 4, 2007 12:02 AM, Peter Busser [EMAIL PROTECTED] wrote:
 
  I'm writing a number of test cases using the test egg. I would like to use
  the test program for automated testing. Is it possible to know that one of
  the tests failed, so I can exit the program with an error value?

OK, I just checked in a test-exit procedure:

  (test-exit [failure-code])

which exits the process with 0 if all tests have passed,
and the optional exit code (default 1) if there have been
any errors at all.

-- 
Alex


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users