Skip to content

Commit

Permalink
Conditional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ermine committed Aug 29, 2013
1 parent 55d91d0 commit 9b2fd94
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 7 deletions.
11 changes: 11 additions & 0 deletions _oasis
Expand Up @@ -35,6 +35,7 @@ Library erm_xmpp

Executable test
Path: tests
Build$: flag(tests)
Install: false
Custom: true
CompiledObject: best
Expand All @@ -43,18 +44,28 @@ Executable test

Executable lwt_test
Path: tests
Build$: flag(tests)
Install: false
CompiledObject: best
MainIs: lwt_test.ml
BuildDepends: erm_xmpp, lwt, lwt.ssl, erm_treap

Executable test_ie
Path: tests
Build$: flag(tests)
Install: false
CompiledObject: best
MainIs: test_ie.ml
BuildDepends: erm_xmpp, erm_treap

Executable punycode_test
Path: tests
Build$: flag(tests)
Install: false
CompiledObject: best
MainIs: punycode_test.ml
BuildDepends: erm_xmpp, erm_treap

# Document api
# Title: API reference
# InstallDir: $docdir
Expand Down
7 changes: 6 additions & 1 deletion _tags
@@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: a12f4a2de6900edda9520ef8275462f0)
# DO NOT EDIT (digest: aa9c28a0037dedb822caa9b112086b79)
# 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 Down Expand Up @@ -37,6 +37,11 @@
<tests/test_ie.{native,byte}>: pkg_erm_treap
<tests/test_ie.{native,byte}>: pkg_erm_xml
<tests/test_ie.{native,byte}>: pkg_cryptokit
# Executable punycode_test
<tests/punycode_test.{native,byte}>: use_erm_xmpp
<tests/punycode_test.{native,byte}>: pkg_erm_treap
<tests/punycode_test.{native,byte}>: pkg_erm_xml
<tests/punycode_test.{native,byte}>: pkg_cryptokit
<tests/*.ml{,i}>: use_erm_xmpp
<tests/*.ml{,i}>: pkg_erm_treap
<tests/*.ml{,i}>: pkg_erm_xml
Expand Down
55 changes: 49 additions & 6 deletions setup.ml
@@ -1,7 +1,7 @@
(* setup.ml generated for the first time by OASIS v0.2.0 *)

(* OASIS_START *)
(* DO NOT EDIT (digest: c3ea038a837e77901e2126eb9b1b576a) *)
(* DO NOT EDIT (digest: 55989323a96ff6013f8110f11ecf3d55) *)
(*
Regenerated by OASIS v0.3.1
Visit http://oasis.forge.ocamlcore.org for more information and
Expand Down Expand Up @@ -5946,7 +5946,11 @@ let setup_t =
cs_plugin_data = [];
},
{
bs_build = [(OASISExpr.EBool true, true)];
bs_build =
[
(OASISExpr.EBool true, false);
(OASISExpr.EFlag "tests", true)
];
bs_install = [(OASISExpr.EBool true, false)];
bs_path = "tests";
bs_compiled_object = Best;
Expand All @@ -5973,7 +5977,11 @@ let setup_t =
cs_plugin_data = [];
},
{
bs_build = [(OASISExpr.EBool true, true)];
bs_build =
[
(OASISExpr.EBool true, false);
(OASISExpr.EFlag "tests", true)
];
bs_install = [(OASISExpr.EBool true, false)];
bs_path = "tests";
bs_compiled_object = Best;
Expand Down Expand Up @@ -6002,7 +6010,11 @@ let setup_t =
cs_plugin_data = [];
},
{
bs_build = [(OASISExpr.EBool true, true)];
bs_build =
[
(OASISExpr.EBool true, false);
(OASISExpr.EFlag "tests", true)
];
bs_install = [(OASISExpr.EBool true, false)];
bs_path = "tests";
bs_compiled_object = Best;
Expand All @@ -6022,6 +6034,37 @@ let setup_t =
bs_nativeopt = [(OASISExpr.EBool true, [])];
},
{exec_custom = false; exec_main_is = "test_ie.ml"; });
Executable
({
cs_name = "punycode_test";
cs_data = PropList.Data.create ();
cs_plugin_data = [];
},
{
bs_build =
[
(OASISExpr.EBool true, false);
(OASISExpr.EFlag "tests", true)
];
bs_install = [(OASISExpr.EBool true, false)];
bs_path = "tests";
bs_compiled_object = Best;
bs_build_depends =
[
InternalLibrary "erm_xmpp";
FindlibPackage ("erm_treap", None)
];
bs_build_tools = [ExternalTool "ocamlbuild"];
bs_c_sources = [];
bs_data_files = [];
bs_ccopt = [(OASISExpr.EBool true, [])];
bs_cclib = [(OASISExpr.EBool true, [])];
bs_dlllib = [(OASISExpr.EBool true, [])];
bs_dllpath = [(OASISExpr.EBool true, [])];
bs_byteopt = [(OASISExpr.EBool true, [])];
bs_nativeopt = [(OASISExpr.EBool true, [])];
},
{exec_custom = false; exec_main_is = "punycode_test.ml"; });
SrcRepo
({
cs_name = "github";
Expand All @@ -6046,14 +6089,14 @@ let setup_t =
};
oasis_fn = Some "_oasis";
oasis_version = "0.3.1";
oasis_digest = Some "øDäÄ[×°\004Îl¢^z_[ì";
oasis_digest = Some "×\012Ì3á\027¾m¨²œ€yYò\t";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false;
};;

let setup () = BaseSetup.setup setup_t;;

# 6058 "setup.ml"
# 6101 "setup.ml"
(* OASIS_STOP *)
let () = setup ();;
12 changes: 12 additions & 0 deletions tests/punycode_test.ml
@@ -0,0 +1,12 @@
open Printf

let _ =
let str = Sys.argv.(1) in
printf "original: [%s]\n" str;
let decoded = Punycode.decode str in
printf "decoded: [%s]\n" (UTF8.encode decoded);
let encoded = Punycode.encode (Array.of_list decoded) in
printf "encoded: [%s]\n" encoded;
if str <> encoded then
failwith("FAIL")

0 comments on commit 9b2fd94

Please sign in to comment.