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
18033693
Commit
18033693
authored
Feb 26, 2014
by
Julien Lopez
Browse files
More OUnit tests added
parent
7a3ef961
Changes
4
Hide whitespace changes
Inline
Side-by-side
tests/ocaml/Makefile
View file @
18033693
...
...
@@ -28,7 +28,7 @@ a:
cdsdl
:
$(CAML)
-c
-I
`
ocamlfind query sdl
`
$@
.mli
$(CDUCE)
--compile
-I
`
ocamlfind query sdl
`
$@
.cd
$(CDO2ML)
$@
.cdo
>
$@
.ml
$(CDO2ML)
-I
`
ocamlfind query sdl
`
$@
.cdo
>
$@
.ml
ocamlfind
$(CAML)
-package
cduce,sdl,oUnit
-linkpkg
-o
$@
$@
.ml
$@
test.ml
./
$@
...
...
@@ -55,7 +55,7 @@ cdnum:
./
$@
clean
:
rm
-f
*
.cmo
*
.cmx
*
.o
*
.cdo
*
.cmi a.ml c.ml cdnum cdnum.ml
eval
cdsdl cdmysql a oUnit-
*
rm
-f
*
.cmo
*
.cmx
*
.o
*
.cdo
*
.cmi a.ml c.ml cdnum cdnum.ml
cdsdl.ml
eval
cdsdl cdmysql a oUnit-
*
check
:
./check.sh
tests/ocaml/cdsdl.cd
View file @
18033693
let sdl_version = string_of (Sdl.version [])
let sdl_version =
Sdl.
string_of
_version
(Sdl.version [])
let sdl_init = Sdl.init [ `true ] [ `EVERYTHING ]
...
...
@@ -8,10 +8,4 @@ let sdl_num_drives = Sdlcdrom.get_num_drives []
let sdl_cd_open = Sdlcdrom.cd_open
let [] =
print [ 'Sdl version' !sdl_version '\n' ];
Sdl.init [ `true ] [ `EVERYTHING ];
let n = string_of (Sdlcdrom.get_num_drives []) in
print [ 'Drives:' !n '\n' ];
let cd = Sdlcdrom.cd_open 0 in
Sdlcdrom.cd_eject cd
let sdl_cd_eject = Sdlcdrom.cd_eject
tests/ocaml/cdsdl.mli
0 → 100644
View file @
18033693
val
sdl_version
:
string
val
sdl_init
:
unit
val
sdl_quit
:
unit
->
unit
val
sdl_num_drives
:
int
val
sdl_cd_open
:
int
->
Sdlcdrom
.
cdrom_drive
val
sdl_cd_eject
:
Sdlcdrom
.
cdrom_drive
->
unit
tests/ocaml/cdsdltest.ml
0 → 100644
View file @
18033693
open
OUnit2
open
Big_int
let
tests
=
"Cdsdl"
>:::
[
"sdl_version"
>::
(
fun
test_ctxt
->
assert_equal
~
msg
:
"Test Cdsdl.sdl_version.1 failed"
(
Sdl
.
string_of_version
(
Sdl
.
version
()
))
(
Cdsdl
.
sdl_version
);
);
"sdl_num_drives"
>::
(
fun
test_ctxt
->
assert_equal
~
msg
:
"Test Cdsdl.sdl_num_drives.1 failed"
(
Sdlcdrom
.
get_num_drives
()
)
(
Cdsdl
.
sdl_num_drives
);
);
"sdl_complete_example"
>::
(
fun
test_ctxt
->
Cdsdl
.
sdl_init
;
let
cd
=
Cdsdl
.
sdl_cd_open
0
in
Cdsdl
.
sdl_cd_eject
cd
;
Cdsdl
.
sdl_quit
()
;
);
]
let
_
=
run_test_tt_main
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