Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Fort?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Patrick M Doane <patrick@w...>
Subject: Re: [Caml-list] Fort?
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

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

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

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.


Bug reports:  FAQ:
To unsubscribe, mail  Archives: