Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
5a341c98
Commit
5a341c98
authored
Feb 25, 2014
by
Julien Lopez
Browse files
Example of OUnit usage with cdnum done.
Minor fix for Makefile verbose mode.
parent
d10843ef
Changes
4
Hide whitespace changes
Inline
Side-by-side
Makefile.distrib
View file @
5a341c98
...
...
@@ -20,7 +20,7 @@ PACKAGES = dynlink camlp4 ulex pcre num netstring
# Call make with VERBOSE=true to get a trace of commands
VERBOSE
=
false
VERBOSE
?
=
false
ifneq
($(VERBOSE), true)
HIDE
=
@
...
...
tests/ocaml/Makefile
View file @
5a341c98
...
...
@@ -38,11 +38,16 @@ eval:
cdnum
:
$(CAML)
-c
$@
.mli
$(CDUCE)
--compile
$@
.cd
-I
`
ocamlfind query num
`
ocamlfind
$(CAML)
-o
$@
-pp
"
$(CDO2ML)
"
-impl
$@
.cdo
-package
cduce,num
-linkpkg
$(CDUCE)
--mlstub
$@
.cdo
>
$@
.ml
ocamlfind ocamlc
-package
cduce,num,oUnit
-linkpkg
-o
$@
$@
.ml
$@
test.ml
./
$@
# $(CAML) -c $@.mli
# $(CDUCE) --compile $@.cd -I `ocamlfind query num`
# ocamlfind $(CAML) -o $@ -pp "$(CDO2ML)" -impl $@.cdo -package cduce,num -linkpkg
# ./$@
clean
:
rm
-f
*
.cmo
*
.cmx
*
.o
*
.cdo
*
.cmi a.ml c.ml cdnum
eval
cdsdl cdmysql
*
~ a
rm
-f
*
.cmo
*
.cmx
*
.o
*
.cdo
*
.cmi a.ml c.ml cdnum
cdnum.ml
eval
cdsdl cdmysql
a oUnit-anon.cache
check
:
./check.sh
tests/ocaml/cdnum.mli
View file @
5a341c98
val
fact
:
Big_int
.
big_int
->
Big_int
.
big_int
tests/ocaml/cdnumtest.ml
0 → 100644
View file @
5a341c98
open
OUnit
open
Big_int
let
tests
=
"Cdnum"
>:::
[
"fact"
>::
(
fun
()
->
assert_equal
2
(
int_of_big_int
(
Cdnum
.
fact
(
big_int_of_int
2
)));
assert_equal
1
(
int_of_big_int
(
Cdnum
.
fact
(
big_int_of_int
0
)));
assert_equal
120
(
int_of_big_int
(
Cdnum
.
fact
(
big_int_of_int
5
)));
);
]
let
_
=
run_test_tt
~
verbose
:
true
tests
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment