unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: "Aleix Conchillo Flaqué" <aconchillo@gmail.com>
To: guile-user <guile-user@gnu.org>
Subject: issues unit testing with srfi-64
Date: Sat, 29 Dec 2018 15:50:18 -0800	[thread overview]
Message-ID: <CA+XASoUJcDOgQkfPQ1Zhy=MC6U8R8zbUasm2RP0yARLLe6o=Ng@mail.gmail.com> (raw)

Hi!

happy holidays and almost happy new year to everyone!

I've added unit tests to guile-json and I have found a couple of
issues. This is the branch:

https://github.com/aconchillo/guile-json/tree/switch-to-alist-and-vectors

First one (which might not be a real issue) is that (test-end) doesn't
exit with an exit status different than 0 if a test fails. And this
will cause automake to believe the tests passed when they actually did
not. I have solved this with the following which works for my use
case, but I'm not sure if that's the right way:
   ...
   (test-end "test-builder")

   (exit (if (eqv? 0 (test-runner-fail-count (test-runner-current))) 0 1))

(I could have returned the fail-count directly, but since there are
only 255 exit values I thought it could wrap around.)

The other issue is that the beginning of the log files are corrupted:

%%%% Starting test test-builder  (Writing full log to "test-builder.log")
# of expected passes      19
r.scm"
  source-line: 33
  source-form: (test-equal "1234" (scm->json-string 1234))

This should be something like:

Test begin:
  source-file: "tests/test-builder.scm"
  source-line: 33
  source-form: (test-equal "1234" (scm->json-string 1234))
Test end:
  result-kind: pass
  actual-value: "1234"
  expected-value: "1234"

I don't know how to fix this one yet.

Has anyone else found these issues before?

Thanks in advance!

Aleix



             reply	other threads:[~2018-12-29 23:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29 23:50 Aleix Conchillo Flaqué [this message]
2018-12-30  2:17 ` issues unit testing with srfi-64 Christopher Lam
2018-12-30  6:03   ` Aleix Conchillo Flaqué
2018-12-30 19:47     ` Taylan Kammer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+XASoUJcDOgQkfPQ1Zhy=MC6U8R8zbUasm2RP0yARLLe6o=Ng@mail.gmail.com' \
    --to=aconchillo@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).