私はEliomを使用して新しいプロジェクトを構築しており、OUnitを使用した単体テストのコンパイルプロセスの設定には問題があります。私はocsigenserver
を使用せずにJs_Client_Code.eliomにユニットテストを実行できるように、私はこの方法でファイルを設定しているEliomフレームワークの単体テスト
Js_Client_Code.eliom - contains all of the client side code
Project.eliom - contains all of the server side code (including opening Js_Client_Code.eliom)
:
私は2つのファイルを持っています。
これは、テストのために私の現在のmakefileです:シェルでmake test
を実行
test: prep unit_tests
prep:
eliomc -infer Js_Client_Code.eliom
js_of_eliom -linkall -a Js_Client_Code.eliom -o file_a.cma
eliomc -a -linkall Js_Client_Code.eliom -o file_b.cma
# Code is here to move the cma files back to the parent directory, since they are written to _client/ and _server/ by default
unit_tests:
ocamlfind ocamlc -thread -syntax camlp4o -package ounit,js_of_ocaml.syntax \
-linkpkg -g -o UnitTests file_a.cma file_b.cma unit_tests.ml
は
File "unit_tests.ml", line 1:
Error: Error while linking file_a.cma(Js_Client_Code):
Reference to undefined global `Eliom_client'
私はEliom/Js_of_ocamlコンパイルプロセスを誤解、あるいは単にこのことについて間違って行くアムを生成方法?