Skip to content
Snippets Groups Projects
README.org 2.81 KiB
Newer Older
 

* test

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

All  tests  are  done  via file:src/Makefile;  it  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).

** Testing Correct Lustre V6 programs

The output  of all lus2lic  invocation are redirected  to =test.res=.
This  file  is then  compared  to  =test.res.exp= (=exp=  stands  for
expected).   When  the  results  (=.res=) and  the  expected  results
(=.res.exp=) differs,  the test fails.   Note that tests do  not only
fail during a regression, but also during a progression!

In order to update the expected result, just issue a 'make utest'.

Actually, 3 kinds of lus2lic  invocation are performed:
- lic: just use lus2lic on all lustre files
- ec: ditto using the -ec option, plus calling ec2c on the generated files
- lv4: ditto using the -lv4 option, plus calling lus2ec on the generated files

** Testing Incorrect Lustre V6 programs

We check  that all progs  in file:tests/should_fail/ returns  with an
exit code > 0.  



* src

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, and put input tables

lxm.ml
lxm.mli
lexer.mll
parser.mly
parserUtils.ml
astCore.ml
astV6.ml
astPredef.ml
ident.ml
ident.mli

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

astTab.ml
astTab.mli
astTabSymbol.ml
astTabSymbol.mli
astV6Dump.ml
astV6Dump.mli

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

astInstanciateModel.ml
astInstanciateModel.mli
astRecognizePredef.ml
astRecognizePredef.mli

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

ast2lic.ml
ast2lic.mli
lic.ml
licTab.ml
licTab.mli
licDump.ml
licDump.mli
licMetaOp.ml
licMetaOp.mli
licName.ml
licName.mli
licPredef.ml
licEvalClock.ml
licEvalClock.mli
licEvalConst.ml
licEvalConst.mli
licEvalType.ml
licEvalType.mli
evalClock.ml
evalClock.mli
evalConst.ml
evalConst.mli
evalType.ml
evalType.mli
unifyClock.ml
unifyClock.mli
unifyType.ml
unifyType.mli


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

licPrg.ml
licPrg.mli

** Some source to source manip are performed 

l2lAliasType.ml
l2lAliasType.mli
l2lCheckOutputs.ml
l2lCheckOutputs.mli
l2lExpandArrays.ml
l2lExpandArrays.mli
l2lExpandNodes.ml
l2lExpandNodes.mli
l2lRmPoly.ml
l2lRmPoly.mli
l2lSplit.ml
l2lSplit.mli

** All this don from a main program

main.ml
mainArgs.ml
mainArgs.mli
global.ml
compile.ml
compile.mli
** Some misc (eponymous) modules are used along the way.
verbose.ml
verbose.mli
filenameExtras.ml
filenameExtras.mli
errors.ml
** crutch to remove
uglyStuff.ml