Skip to content

Commit

Permalink
Make module_type_of_size.t portable and maintainable
Browse files Browse the repository at this point in the history
It's now easier to change the size of the test as the intermediate mli
files are no longer in the source code.
The test is also easier to read.
  • Loading branch information
Julow committed Feb 21, 2024
1 parent e188a11 commit 299dfcc
Show file tree
Hide file tree
Showing 17 changed files with 9 additions and 104 deletions.
16 changes: 0 additions & 16 deletions test/xref2/module_type_of_size.t/compile.sh

This file was deleted.

13 changes: 0 additions & 13 deletions test/xref2/module_type_of_size.t/gen.sh

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m10.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m11.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m12.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m13.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m14.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m2.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m3.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m4.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m5.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m6.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m7.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m8.mli

This file was deleted.

2 changes: 0 additions & 2 deletions test/xref2/module_type_of_size.t/m9.mli

This file was deleted.

16 changes: 0 additions & 16 deletions test/xref2/module_type_of_size.t/odoc.sh

This file was deleted.

42 changes: 9 additions & 33 deletions test/xref2/module_type_of_size.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,16 @@ Start with a base module:
module N : sig type t end
module T : sig type t type u end

Script to compile the modules:
$ ./compile.sh
+ ocamlc -c m1.mli -bin-annot
+ ocamlc -c m2.mli -bin-annot
+ ocamlc -c m3.mli -bin-annot
+ ocamlc -c m4.mli -bin-annot
+ ocamlc -c m5.mli -bin-annot
+ ocamlc -c m6.mli -bin-annot
+ ocamlc -c m7.mli -bin-annot
+ ocamlc -c m8.mli -bin-annot
+ ocamlc -c m9.mli -bin-annot
+ ocamlc -c m10.mli -bin-annot
+ ocamlc -c m11.mli -bin-annot
+ ocamlc -c m12.mli -bin-annot
+ ocamlc -c m13.mli -bin-annot
+ ocamlc -c m14.mli -bin-annot

And one to run odoc on the files:
$ ./odoc.sh
+ odoc compile -I . m1.cmti
+ odoc compile -I . m2.cmti
+ odoc compile -I . m3.cmti
+ odoc compile -I . m4.cmti
+ odoc compile -I . m5.cmti
+ odoc compile -I . m6.cmti
+ odoc compile -I . m7.cmti
+ odoc compile -I . m8.cmti
+ odoc compile -I . m9.cmti
+ odoc compile -I . m10.cmti
+ odoc compile -I . m11.cmti
+ odoc compile -I . m12.cmti
+ odoc compile -I . m13.cmti
+ odoc compile -I . m14.cmti
Generate a chain of `module type of`s:

$ N=14
$ for i in `seq 2 $N`; do echo "module type M = module type of M$((i-1)) with module N = M1.T" > m$i.mli; echo "module N : sig type t end" >> m$i.mli; done

Compile the modules:

$ for i in `seq 1 $N`; do ocamlc -c "m$i.mli" -bin-annot; done

$ for i in `seq 1 $N`; do odoc compile -I . "m$i.cmti"; done

None of the files really ought to be bigger than 1M!

Expand Down

0 comments on commit 299dfcc

Please sign in to comment.