caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Fort?
@ 2002-01-08 18:52 Jeremy Fincher
  2002-01-08 19:30 ` Patrick M Doane
  0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Fincher @ 2002-01-08 18:52 UTC (permalink / raw)
  To: caml-list

I've been looking for a good framework to unit-test my software, and Fort seems to fit the bill.  There are, however, a few things standing in my way that I'd like to resolve.

First, I *need* to link against certain C libraries, like Unix and Pcre.  What do I need to do to make a fort executable that allows me to test modules linked with these libraries?

Also, are there any good examples of already-existing testing frameworks that I can base mine on?  The documentation I've found isn't the most extensive, and a good example would go far to help me use it.

If I can get these issues solved, I'd be able to use Fort quite extensively for testing my software, and I'd really like to do that :)

Thanks,
Jeremy
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] Fort?
  2002-01-08 18:52 [Caml-list] Fort? Jeremy Fincher
@ 2002-01-08 19:30 ` Patrick M Doane
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick M Doane @ 2002-01-08 19:30 UTC (permalink / raw)
  To: Jeremy Fincher; +Cc: caml-list

On Tue, 8 Jan 2002, Jeremy Fincher wrote:

> First, I *need* to link against certain C libraries, like Unix and
> Pcre.  What do I need to do to make a fort executable that allows me
> to test modules linked with these libraries?

With OCaml 3.04, this is really easy.

  fort unix.cma a.cmo a-test.ml

would be a typical invocation to test a module A that depends on the unix
library.

For older versions of OCaml, you must build a custom toplevel. If you need
help with that, let me know.

> Also, are there any good examples of already-existing testing
> frameworks that I can base mine on?  The documentation I've found
> isn't the most extensive, and a good example would go far to help me
> use it.

I plan on doing some work for the documentation the next time I need to
make a release, but things seem to have been fairly stable for awhile so
this has been a low priority.

Usually, I structure a test script to contain a number of test cases like
this:

Fort.expect_pass "name of test" (fun () ->
  expect_equal (3+4) 7;
  expect_equal_app failwith "hd" List.hd [];
  ...
);

The individual calls to expect_* usually include additional parameters to
define the various printers to help with failrues.

If a test case is expected to fail, and won't be fixed in the near future
than expect_pass should be replaced with expect_fail.

If anyone would like to volunteer some documentation beyond what is
provided in the .mli files, I'd gladly include it in the release.

> If I can get these issues solved, I'd be able to use Fort quite
> extensively for testing my software, and I'd really like to do that :)

Sounds great, testing is always a good thing!

Let me know if you have any other questions.

Patrick

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

end of thread, other threads:[~2002-01-08 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-08 18:52 [Caml-list] Fort? Jeremy Fincher
2002-01-08 19:30 ` Patrick M Doane

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).