* Tests (=./test=)

requires =sudo apt-get install dejagnu=

The idea is to run those tests before *each commit*.

All  tests  are  controlled  by file:test/Makefile;  which  runs  the
lus2lic compiler with various options on every files contained in

- file:tests/should_work/ that contains correct Lustre V6 programs
- file:tests/should_fail/ that contains incorrect  ones (e.g.,  that
  contains a type error).
-  file:tests/should_work/broken   and  file:tests/should_fail/broken
  that contain broken tests

a 'make test' in  this =test= dir will run quite a  lot of tests, and
generate several files:

- file:testslus2lic.sum: a summary generated by the runtest (dejagnu) program
- lus2lic.log: a log file generated by runtest
- lus2lic.diff: which is a diff betwenn lus2lic.log and lus2lic.log.ref

'make test' exits normally iff =lus2lic.diff= is empty.

'make utest' will update the =lus2lic.log.ref=

'make test' is actually equivalent to 'make nonreg' plus 'make prog'.
The goal is that:
- 'make nonreg'  have no unexpected failures/successes
- 'make prog' have no expected failures/successes

Hence, before issuing a 'make utest', it  is better if it is the case
unless you plan to fix the problems in the very short term.

* Sources (=./src=)

'make  html' in  the  top directory  produces html  doc  that can  be
browsed here: file:ocamldoc/index.html

Here  follows a  description of  the different  modules used  by this
lus2lic compiler (in src)

** First of all, the Lustre files are parsed

#+BEGIN_SRC text
lxm.{ml|mli}
lexer.mll
parser.mly
lv6parserUtils.ml
astCore.ml
astV6.ml
astPredef.ml
Lv6Id.{ml|mli}
#+END_SRC

** and put input tables performing some checks along the way (references)

#+BEGIN_SRC text 
astTab.{ml|mli}
astTabSymbol.{ml|mli}
astV6Dump.{ml|mli}
#+END_SRC

** Some source to source manip are performed of those tables

#+BEGIN_SRC text
astInstanciateModel.{ml|mli}
astRecognizePredef.{ml|mli}
#+END_SRC

** Then the source is statically evaluated and type/clock checked

#+BEGIN_SRC text
ast2lic.{ml|mli}
lic.ml
licTab.{ml|mli}
licDump.{ml|mli}
licMetaOp.{ml|mli}
licName.{ml|mli}
licPredef.ml
licEvalClock.{ml|mli}
licEvalConst.{ml|mli}
licEvalType.{ml|mli}
evalClock.{ml|mli}
evalConst.{ml|mli}
evalType.{ml|mli}
unifyClock.{ml|mli}
unifyType.{ml|mli}
#+END_SRC

** Lic is transformed into a LicPrg (imperative table->functional maps)

#+BEGIN_SRC text
licPrg.{ml|mli}
#+END_SRC

** Some source to source manip are performed 

#+BEGIN_SRC text
l2lAliasType.{ml|mli}
l2lCheckOutputs.{ml|mli}
l2lExpandArrays.{ml|mli}
l2lExpandNodes.{ml|mli}
l2lRmPoly.{ml|mli}
l2lSplit.{ml|mli}
#+END_SRC

** All this controlled from a main program

#+BEGIN_SRC text
main.ml
lv6MainArgs.{ml|mli}
global.ml
compile.{ml|mli}
#+END_SRC

** Some misc (eponymous) modules are used along the way.

#+BEGIN_SRC text 
verbose.{ml|mli}
filenameExtras.ml
filenameExtras.mli
lv6errors.ml
lv6util.ml
#+END_SRC

* Compiling on windows

In order to install a win32 cross compiler: 

#+BEGIN_SRC sh
aptitude install mingw32 mingw32-binutils mingw32-runtime mingw32-ocaml gcc-mingw32 
#+END_SRC