Skip to content

Commit

Permalink
Git rid of the OUnit dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
samoht committed Jun 22, 2015
1 parent 2a295a5 commit 570a8b8
Show file tree
Hide file tree
Showing 8 changed files with 251 additions and 187 deletions.
6 changes: 3 additions & 3 deletions _oasis
Expand Up @@ -11,7 +11,7 @@ Library alcotest
Path: lib
Findlibname: alcotest
Modules: Alcotest_version, Alcotest
BuildDepends: oUnit, re.str, cmdliner, bytes
BuildDepends: re.str, cmdliner, bytes, unix

Document alcotest
Title: Alcotest docs
Expand All @@ -25,12 +25,12 @@ Executable "simple"
Path: examples
MainIs: simple.ml
Install: false
BuildDepends: alcotest, oUnit
BuildDepends: alcotest
CompiledObject: best

Executable "bad"
Path: examples
MainIs: bad.ml
Install: false
BuildDepends: alcotest, oUnit
BuildDepends: alcotest
CompiledObject: best
10 changes: 5 additions & 5 deletions _tags
@@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: 1fe08b99b371a3bf89836ea3eda0cc3d)
# DO NOT EDIT (digest: 65537aefedb61b4f9a674a6f0f0c3ced)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
Expand All @@ -18,23 +18,23 @@ true: annot, bin_annot
"lib/alcotest.cmxs": use_alcotest
<lib/*.ml{,i,y}>: pkg_bytes
<lib/*.ml{,i,y}>: pkg_cmdliner
<lib/*.ml{,i,y}>: pkg_oUnit
<lib/*.ml{,i,y}>: pkg_re.str
<lib/*.ml{,i,y}>: pkg_unix
# Executable simple
<examples/simple.{native,byte}>: pkg_bytes
<examples/simple.{native,byte}>: pkg_cmdliner
<examples/simple.{native,byte}>: pkg_oUnit
<examples/simple.{native,byte}>: pkg_re.str
<examples/simple.{native,byte}>: pkg_unix
<examples/simple.{native,byte}>: use_alcotest
# Executable bad
<examples/bad.{native,byte}>: pkg_bytes
<examples/bad.{native,byte}>: pkg_cmdliner
<examples/bad.{native,byte}>: pkg_oUnit
<examples/bad.{native,byte}>: pkg_re.str
<examples/bad.{native,byte}>: pkg_unix
<examples/bad.{native,byte}>: use_alcotest
<examples/*.ml{,i,y}>: pkg_bytes
<examples/*.ml{,i,y}>: pkg_cmdliner
<examples/*.ml{,i,y}>: pkg_oUnit
<examples/*.ml{,i,y}>: pkg_re.str
<examples/*.ml{,i,y}>: pkg_unix
<examples/*.ml{,i,y}>: use_alcotest
# OASIS_STOP
8 changes: 4 additions & 4 deletions examples/bad.ml
Expand Up @@ -30,16 +30,16 @@ For more information, please refer to <http://unlicense.org/>

(* A module with functions to test *)
module To_test = struct
let capit letter = Char.uppercase letter
let plus int_list = List.fold_left (fun a b -> a + b) 0 int_list
let capit letter = String.uppercase letter
let plus int_list = List.map (fun a -> a + a) int_list
end

(* The tests *)
let capit () =
OUnit.assert_equal 'A' (To_test.capit 'b')
Alcotest.(check string) "strings" "A" (To_test.capit "b")

let plus () =
OUnit.assert_equal 9 (To_test.plus [1;1;2;3])
Alcotest.(check (list int)) "int lists" [1] (To_test.plus [1;1;2;3])

let test_one = [
"Capitalize" , `Quick, capit;
Expand Down
4 changes: 2 additions & 2 deletions examples/simple.ml
Expand Up @@ -36,10 +36,10 @@ end

(* The tests *)
let capit () =
OUnit.assert_equal 'A' (To_test.capit 'a')
Alcotest.(check char) "Check A" 'A' (To_test.capit 'a')

let plus () =
OUnit.assert_equal 7 (To_test.plus [1;1;2;3])
Alcotest.(check int) "Sum equals to 7" 7 (To_test.plus [1;1;2;3])

let test_set = [
"Capitalize" , `Quick, capit;
Expand Down
4 changes: 2 additions & 2 deletions lib/META
@@ -1,8 +1,8 @@
# OASIS_START
# DO NOT EDIT (digest: b7e3d72424d76281e480f10752a56913)
# DO NOT EDIT (digest: 6f16f1ec61baecfa38e183f8e682c502)
version = "0.3.3"
description = "A lightweight and colourful test framework"
requires = "oUnit re.str cmdliner bytes"
requires = "re.str cmdliner bytes unix"
archive(byte) = "alcotest.cma"
archive(byte, plugin) = "alcotest.cma"
archive(native) = "alcotest.cmxa"
Expand Down

0 comments on commit 570a8b8

Please sign in to comment.