caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Hendrik Tews <tews@tcs.inf.tu-dresden.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Testing Camlp4-generated code
Date: Mon, 07 Nov 2005 10:10:33 +0100	[thread overview]
Message-ID: <rlr79sq0vq.fsf@ithif59.inf.tu-dresden.de> (raw)
In-Reply-To: <436D3343.3020809@gushee.net>

Matt Gushee <matt@gushee.net> writes:

   I have developed a tool that generates a module using Camlp4, and I
   would like to be able to test the output. The structure is fairly small
   and simple, so it should be sufficient to verify that a generated module
   is equivalent to a certain hand-coded module ... 

In addition to Martin Jambon's suggestion you can also compare
the internal camlp4 abstract syntax trees of the generated and
the handcoded module:

- use camlp4 with a printer that marshal's the ast into a file
  for both, the generated and the handwritten module
- in a separate program marshal both files back and compare them

You probably want a handwritten equality test in the second step
because of the location info in the ast.

Bye,

Hendrik


      parent reply	other threads:[~2005-11-07  9:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-05 22:33 Matt Gushee
2005-11-06 22:10 ` [Caml-list] " Martin Jambon
2005-11-06 22:16   ` Martin Jambon
2005-11-07  9:10 ` Hendrik Tews [this message]

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

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

  git send-email \
    --in-reply-to=rlr79sq0vq.fsf@ithif59.inf.tu-dresden.de \
    --to=tews@tcs.inf.tu-dresden.de \
    --cc=caml-list@inria.fr \
    /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 NNTP newsgroup(s).