* [Caml-list] Any tool for unit tests as comments in OCaml source?
@ 2012-05-15 1:48 Francois Berenger
2012-05-15 2:08 ` Thibault Suzanne
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Francois Berenger @ 2012-05-15 1:48 UTC (permalink / raw)
To: caml-list; +Cc: OCaml Beginners List
Hello,
What's the gold standard in OCaml to have
unit test as comments in source code in order
for a tool to automatically extract them
and generate a test suite?
Thanks,
F.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Caml-list] Any tool for unit tests as comments in OCaml source?
2012-05-15 1:48 [Caml-list] Any tool for unit tests as comments in OCaml source? Francois Berenger
@ 2012-05-15 2:08 ` Thibault Suzanne
2012-05-15 2:08 ` Edgar Friendly
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Thibault Suzanne @ 2012-05-15 2:08 UTC (permalink / raw)
To: caml-list
Hi
I don't know if it's a « gold standard », but Batteries uses qtest. The
documentation (clear and concise in my opinion) can be found at
http://batteries.vhugot.com/qtest/.
Thibault Suzanne
Le 15/05/2012 03:48, Francois Berenger a écrit :
> Hello,
>
> What's the gold standard in OCaml to have
> unit test as comments in source code in order
> for a tool to automatically extract them
> and generate a test suite?
>
> Thanks,
> F.
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Caml-list] Any tool for unit tests as comments in OCaml source?
2012-05-15 1:48 [Caml-list] Any tool for unit tests as comments in OCaml source? Francois Berenger
2012-05-15 2:08 ` Thibault Suzanne
@ 2012-05-15 2:08 ` Edgar Friendly
[not found] ` <4FB1B60F.3060408@riken.jp>
2012-05-15 5:29 ` [Caml-list] Any tool for unit tests as comments in OCaml source? Cedric Cellier
3 siblings, 0 replies; 10+ messages in thread
From: Edgar Friendly @ 2012-05-15 2:08 UTC (permalink / raw)
To: caml-list
On 05/14/2012 09:48 PM, Francois Berenger wrote:
> Hello,
>
> What's the gold standard in OCaml to have
> unit test as comments in source code in order
> for a tool to automatically extract them
> and generate a test suite?
>
> Thanks,
> F.
>
Batteries uses a program called qtest to do this; it's within the
batteries source tree at the moment. There are plans to move it outside
for other projects to use.
Docs here: http://batteries.vhugot.com/qtest/
E.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Caml-list] Any library for reading/writing compressed files?
[not found] ` <4FB1B60F.3060408@riken.jp>
@ 2012-05-15 2:12 ` Francois Berenger
2012-05-18 22:14 ` Richard W.M. Jones
0 siblings, 1 reply; 10+ messages in thread
From: Francois Berenger @ 2012-05-15 2:12 UTC (permalink / raw)
To: caml-list; +Cc: batteries-devel, OCaml Beginners List
Hello,
What's the gold standard in OCaml to read/write
compressed files?
I found this: http://forge.ocamlcore.org/projects/camlzip/
Wouldn't it be possible that the Marshall module
had an option to allow compression of the marshalled
values?
Or is there a simple way to achieve this?
Thanks,
F.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Caml-list] Any tool for unit tests as comments in OCaml source?
2012-05-15 1:48 [Caml-list] Any tool for unit tests as comments in OCaml source? Francois Berenger
` (2 preceding siblings ...)
[not found] ` <4FB1B60F.3060408@riken.jp>
@ 2012-05-15 5:29 ` Cedric Cellier
3 siblings, 0 replies; 10+ messages in thread
From: Cedric Cellier @ 2012-05-15 5:29 UTC (permalink / raw)
To: caml-list; +Cc: OCaml Beginners List
There's some work going on around batteries qtest program. See for instance this wiki page on batteries tests:
https://github.com/ocaml-batteries-team/batteries-included/wiki/Developers-Guidelines
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Caml-list] Any library for reading/writing compressed files?
2012-05-15 2:12 ` [Caml-list] Any library for reading/writing compressed files? Francois Berenger
@ 2012-05-18 22:14 ` Richard W.M. Jones
2012-05-19 1:25 ` Adrien
0 siblings, 1 reply; 10+ messages in thread
From: Richard W.M. Jones @ 2012-05-18 22:14 UTC (permalink / raw)
To: Francois Berenger; +Cc: caml-list, batteries-devel, OCaml Beginners List
On Tue, May 15, 2012 at 11:12:18AM +0900, Francois Berenger wrote:
> Hello,
>
> What's the gold standard in OCaml to read/write
> compressed files?
>
> I found this: http://forge.ocamlcore.org/projects/camlzip/
>
> Wouldn't it be possible that the Marshall module
> had an option to allow compression of the marshalled
> values?
> Or is there a simple way to achieve this?
If it's for Unix, then just open a pipe to or from an external
compression filter, eg:
open Unix
open Printf
let () =
let output = "output.xz" in
let chan =
open_process_out (sprintf "xz --best > %s"
(Filename.quote output)) in
output_value chan 42;
let status = close_process_out chan in
(* some code here to check status was ok *)
()
(Also a good way to generate images from OCaml programs: pipe
to pnmto* programs).
Rich.
--
Richard Jones
Red Hat
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Caml-list] Any library for reading/writing compressed files?
2012-05-18 22:14 ` Richard W.M. Jones
@ 2012-05-19 1:25 ` Adrien
2012-05-19 1:27 ` Adrien
0 siblings, 1 reply; 10+ messages in thread
From: Adrien @ 2012-05-19 1:25 UTC (permalink / raw)
To: Richard W.M. Jones
Cc: Francois Berenger, caml-list, batteries-devel, OCaml Beginners List
There are libarchive bindings by Sylvain Le Gall on the forge too.
They're partial but already work for reading iirc, and writing
shouldn't be a lot of work (if it hasn't been added since I last
looked at it). That will potentially give xz, gzip, bzip2, tar, cpio
and I don't know what else.
--
Adrien Nader
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Caml-list] Any library for reading/writing compressed files?
2012-05-19 1:25 ` Adrien
@ 2012-05-19 1:27 ` Adrien
2012-05-21 1:20 ` Francois Berenger
0 siblings, 1 reply; 10+ messages in thread
From: Adrien @ 2012-05-19 1:27 UTC (permalink / raw)
To: Richard W.M. Jones
Cc: Francois Berenger, caml-list, batteries-devel, OCaml Beginners List
Also, don't compress Marshal's output, it'll suck.
Marshal already does RLE compression IIRC (that might help for
situations constrained by memory-bandwidth) and that hinders other
compressions. In particular, with xz, it'll really be a waste of time.
--
Adrien Nader
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Caml-list] Any library for reading/writing compressed files?
2012-05-19 1:27 ` Adrien
@ 2012-05-21 1:20 ` Francois Berenger
2012-05-21 6:11 ` Adrien
0 siblings, 1 reply; 10+ messages in thread
From: Francois Berenger @ 2012-05-21 1:20 UTC (permalink / raw)
Cc: caml-list, batteries-devel
On 05/19/2012 10:27 AM, Adrien wrote:
> Also, don't compress Marshal's output, it'll suck.
My program generates large bitmasks:
ls -l X.mask.gz: 12K
gunzip X.mask.gz
ls -l X.mask: 2.1M
X.mask was generated by the Marshal module.
It was gzip -1 to compress.
The compression ratio looks amazing in my case
(which I measured in the first place before making
my program use it).
> Marshal already does RLE compression IIRC (that might help for
> situations constrained by memory-bandwidth) and that hinders other
> compressions. In particular, with xz, it'll really be a waste of time.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Caml-list] Any library for reading/writing compressed files?
2012-05-21 1:20 ` Francois Berenger
@ 2012-05-21 6:11 ` Adrien
0 siblings, 0 replies; 10+ messages in thread
From: Adrien @ 2012-05-21 6:11 UTC (permalink / raw)
To: Francois Berenger; +Cc: caml-list, batteries-devel
You should check the bitmasks and Marshal's output with a binary
editor. There's probably at least one thing to learn.
This is with 2.1MB of zeroes.
8:08 ~ % dd if=/dev/zero of=Z.mask bs=1M count=2
2+0 records in
2+0 records out
2097152 bytes (2.1 MB) copied, 0.00606737 s, 346 MB/s
8:09 ~ % gzip -1v Z.mask
Z.mask: 99.6% -- replaced with Z.mask.gz
8:09 ~ % ls -lh Z.mask.gz
-rw-r--r-- 1 adrien users 9.0K May 21 08:09 Z.mask.gz
--
Adrien Nader
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-05-21 6:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15 1:48 [Caml-list] Any tool for unit tests as comments in OCaml source? Francois Berenger
2012-05-15 2:08 ` Thibault Suzanne
2012-05-15 2:08 ` Edgar Friendly
[not found] ` <4FB1B60F.3060408@riken.jp>
2012-05-15 2:12 ` [Caml-list] Any library for reading/writing compressed files? Francois Berenger
2012-05-18 22:14 ` Richard W.M. Jones
2012-05-19 1:25 ` Adrien
2012-05-19 1:27 ` Adrien
2012-05-21 1:20 ` Francois Berenger
2012-05-21 6:11 ` Adrien
2012-05-15 5:29 ` [Caml-list] Any tool for unit tests as comments in OCaml source? Cedric Cellier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox