Browse Source

Improve opam file

 + Correct name for removal
 + Threat test separately
 + Add oasis flag to build test only when necessary, faster to install
 + Run oasis setup
Leo 8 years ago
parent
commit
6fc0dc112c
4 changed files with 26 additions and 10 deletions
  1. 1 0
      CHANGELOG.md
  2. 2 0
      _oasis
  3. 10 4
      opam
  4. 13 6
      setup.ml

+ 1 - 0
CHANGELOG.md

@@ -74,6 +74,7 @@ This version introduce major changes in the tmp and rc file.
  + TODO XXX Add basic signal handling (`--signals`), to relaunch when doing
    ctrl-C. See issue #14 for known problems.
  + Adapt to OCaml compiler version 4.03 (only supported)
+ + Improve opam, installs less dependencies, with ability to run tests
 
 #### Community
 

+ 2 - 0
_oasis

@@ -36,10 +36,12 @@ Executable run_test
   Path: src
   MainIs: test/test.ml
   CompiledObject: best
+  Build$: flag(tests)
   Install: false
   BuildDepends: alcotest, oUnit, core, textutils, atdgen, threads, re2
 
 Test alcotests
+  Run$: flag(tests)
   Command: $run_test -q
   WorkingDirectory: src/test
 

+ 10 - 4
opam

@@ -7,19 +7,25 @@ homepage: "http://www.oclaunch.eu.org"
 bug-reports: "http://s.oclaunch.eu.org/bug"
 license: "CeCILL"
 dev-repo: "git@gitlab.com:WzukW/oclaunch.git"
+build-test: [
+  ["./configure" "--enable-tests" "--prefix=%{prefix}%"]
+  [make "test"]
+]
 build: [
-  ["./configure" "--prefix=%{prefix}%"]
+  ["./configure" "--disable-tests" "--prefix=%{prefix}%"]
   [make]
 ]
 install: [make "install"]
-remove: ["ocamlfind" "remove" "ocl"]
+remove: ["ocamlfind" "remove" "oclaunch"]
 depends: [
   "ocamlbuild"
-  "atdgen" {>= 1.9.1}
+  "atdgen" {>= "1.9.1"} { build }
   "base-threads"
   "core" {>= "112.35.00"}
   "textutils"
   "re2"
-  "ocamlfind" {build}
+  "ocamlfind" { build }
+  "ounit" {test}
+  "alcotest" {test}
 ]
 available: [ocaml-version >= "4.03.0"]

+ 13 - 6
setup.ml

@@ -1,7 +1,7 @@
 (* setup.ml generated for the first time by OASIS v0.4.5 *)
 
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 6004766a4c88447d02799f6b7beb56bd) *)
+(* DO NOT EDIT (digest: a8502e94ba054daf78bdc42e8717ca4f) *)
 (*
    Regenerated by OASIS v0.4.6
    Visit http://oasis.forge.ocamlcore.org for more information and
@@ -6996,7 +6996,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 = "src";
                       bs_compiled_object = Best;
@@ -7041,7 +7045,11 @@ let setup_t =
                       test_run =
                         [
                            (OASISExpr.ENot (OASISExpr.EFlag "tests"), false);
-                           (OASISExpr.EFlag "tests", true)
+                           (OASISExpr.EFlag "tests", false);
+                           (OASISExpr.EAnd
+                              (OASISExpr.EFlag "tests",
+                                OASISExpr.EFlag "tests"),
+                             true)
                         ];
                       test_tools =
                         [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"]
@@ -7058,8 +7066,7 @@ let setup_t =
        };
      oasis_fn = Some "_oasis";
      oasis_version = "0.4.6";
-     oasis_digest =
-       Some "5\186\162\238_|\031\158\144Z\019\231\180\028\139\206";
+     oasis_digest = Some "\253\178\n\133\134y\176\209\139\026\026zP\021f0";
      oasis_exec = None;
      oasis_setup_args = [];
      setup_update = false
@@ -7067,6 +7074,6 @@ let setup_t =
 
 let setup () = BaseSetup.setup setup_t;;
 
-# 7071 "setup.ml"
+# 7078 "setup.ml"
 (* OASIS_STOP *)
 let () = setup ();;