Permalink
Browse files

Fix dependency on pa_monad

* Add 2 flags to oasis setup, to build conditionally tests and service
generator (depending on pa_monad)
* Update READMEs
  • Loading branch information...
1 parent fab84b6 commit 73bcb52d742b3ff43bece906c60994528dbe346c @astrada committed Feb 12, 2012
Showing with 77 additions and 15 deletions.
  1. +4 −1 README.md
  2. +15 −0 _oasis
  3. +43 −7 setup.ml
  4. +6 −2 src/test/README.md
  5. +0 −5 src/test/_tags
  6. +9 −0 tools/README.md
View
@@ -78,8 +78,11 @@ doesn't have enough privileges)
$ ocaml setup.ml -install
-To run the tests, execute
+To build and run the tests (you will need
+[pa_monad](http://www.cas.mcmaster.ca/~carette/pa_monad/)), execute
+ $ ocaml setup.ml -configure --enable-tests
+ $ ocaml setup.ml -build
$ ocaml setup.ml -test
See [tests README](src/test/README.md) for further details regarding the tests.
View
15 _oasis
@@ -10,6 +10,16 @@ Homepage: https://github.com/astrada/gapi-ocaml
BuildTools: ocamlbuild
Plugins: META (0.2)
+# Flags
+Flag tests
+ Description: Build and run tests
+ Default: false
+
+# Flags
+Flag generator
+ Description: Build service generator
+ Default: false
+
# Libraries
Library gapi
Path: src/gapi
@@ -70,13 +80,15 @@ Document "gapi-ocaml"
Title: API reference for Google APIs client library
Type: ocamlbuild (0.2)
InstallDir: $htmldir/html
+ Install: false
DataFiles: doc/style.css
BuildTools: ocamldoc
XOCamlbuildPath: src
XOCamlbuildLibraries: gapi, gdata
# Executables
Executable serviceGenerator
+ Build$: flag(generator)
Path: tools
Install: false
MainIs: serviceGenerator.ml
@@ -103,18 +115,21 @@ Executable clientLoginFlow
# Tests
Executable refreshOAuth2Token
+ Build$: flag(tests)
Path: src/test
Install: false
MainIs: refreshOAuth2Token.ml
BuildDepends: gapi, oUnit
Executable testSuite
+ Build$: flag(tests)
Path: src/test
Install: false
MainIs: testSuite.ml
BuildDepends: gapi, gdata, oUnit
Test core
+ Run$: flag(tests)
Command: $testSuite
TestTools: testSuite
View
@@ -1,7 +1,7 @@
(* setup.ml generated for the first time by OASIS v0.2.1~alpha1 *)
(* OASIS_START *)
-(* DO NOT EDIT (digest: 7d15d468afeeb2e4890a15e9793f08bb) *)
+(* DO NOT EDIT (digest: 587c6d3542310688335996ad1916e87c) *)
(*
Regenerated by OASIS v0.2.1~alpha1
Visit http://oasis.forge.ocamlcore.org for more information and
@@ -5256,7 +5256,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/test";
bs_compiled_object = Byte;
@@ -5310,7 +5314,11 @@ let setup_t =
post_command = [(OASISExpr.EBool true, None)];
};
test_working_directory = None;
- test_run = [(OASISExpr.EBool true, true)];
+ test_run =
+ [
+ (OASISExpr.EBool true, false);
+ (OASISExpr.EFlag "tests", true)
+ ];
test_tools =
[
ExternalTool "ocamlbuild";
@@ -5359,7 +5367,7 @@ let setup_t =
post_command = [(OASISExpr.EBool true, None)];
};
doc_build = [(OASISExpr.EBool true, true)];
- doc_install = [(OASISExpr.EBool true, true)];
+ doc_install = [(OASISExpr.EBool true, false)];
doc_install_dir = "$htmldir/html";
doc_title =
"API reference for Google APIs client library";
@@ -5370,6 +5378,16 @@ let setup_t =
doc_build_tools =
[ExternalTool "ocamlbuild"; ExternalTool "ocamldoc"];
});
+ Flag
+ ({
+ cs_name = "tests";
+ cs_data = PropList.Data.create ();
+ cs_plugin_data = [];
+ },
+ {
+ flag_description = Some "Build and run tests";
+ flag_default = [(OASISExpr.EBool true, false)];
+ });
Executable
({
cs_name = "oauth2Flow";
@@ -5404,7 +5422,11 @@ let setup_t =
cs_plugin_data = [];
},
{
- bs_build = [(OASISExpr.EBool true, true)];
+ bs_build =
+ [
+ (OASISExpr.EBool true, false);
+ (OASISExpr.EFlag "generator", true)
+ ];
bs_install = [(OASISExpr.EBool true, false)];
bs_path = "tools";
bs_compiled_object = Byte;
@@ -5430,7 +5452,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/test";
bs_compiled_object = Byte;
@@ -5479,7 +5505,17 @@ let setup_t =
bs_byteopt = [(OASISExpr.EBool true, [])];
bs_nativeopt = [(OASISExpr.EBool true, [])];
},
- {exec_custom = false; exec_main_is = "oauth1Flow.ml"; })
+ {exec_custom = false; exec_main_is = "oauth1Flow.ml"; });
+ Flag
+ ({
+ cs_name = "generator";
+ cs_data = PropList.Data.create ();
+ cs_plugin_data = [];
+ },
+ {
+ flag_description = Some "Build service generator";
+ flag_default = [(OASISExpr.EBool true, false)];
+ })
];
plugins = [(`Extra, "META", Some "0.2")];
schema_data = PropList.Data.create ();
View
@@ -111,9 +111,13 @@ Additional parameters:
Running the tests
-----------------
-By default, the test suite will run the tests that don't connect to Google
-services (and don't need the authorization configuration)
+To build the tests you will need to install
+[pa_monad](http://www.cas.mcmaster.ca/~carette/pa_monad/)). By default, the
+test suite will run the tests that don't connect to Google services (and don't
+need the authorization configuration)
+ $ ocaml setup.ml -configure --enable-tests
+ $ ocaml setup.ml -build
$ ocaml setup.ml -test
To test the interaction with the remote services, you can use the `-service`
View
@@ -1,8 +1,3 @@
# Packages deps
-<testHelper.*> : pkg_extlib, pkg_json-wheel
<testMonadic.*> : pkg_monad, syntax_camlp4o
-<testDate.*> : pkg_netstring
-<test*Model.*> : pkg_extlib, pkg_json-wheel
-<test*Service.*> : pkg_extlib, pkg_json-wheel
-<test*.*> : pkg_oUnit
View
@@ -19,6 +19,15 @@ files:
These files should be linked with the `gapi` library that provides the basic
functionalities to query the Google RESTful services.
+### Compiling
+
+To build the generator you will need
+[pa_monad](http://www.cas.mcmaster.ca/~carette/pa_monad/)). After installing
+it, execute
+
+ $ ocaml setup.ml -configure --enable-generator
+ $ ocaml setup.ml -build
+
### Example
This command will generate the source code of the client for the URL shortener

0 comments on commit 73bcb52

Please sign in to comment.