Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ install: build doc
# ocaml/xapi
make -C scripts install
cp -f _build/install/default/bin/xapi $(DESTDIR)$(SBINDIR)/xapi
scripts/install.sh 755 ocaml/xapi/quicktest $(DESTDIR)$(OPTDIR)/debug
scripts/install.sh 755 ocaml/quicktest/quicktest $(DESTDIR)$(OPTDIR)/debug
cp -f _build/install/default/bin/quicktestbin $(DESTDIR)$(OPTDIR)/debug/quicktestbin
scripts/install.sh 644 _build/install/default/share/xapi/rbac_static.csv $(DESTDIR)$(OPTDIR)/debug
# ocaml/xsh
Expand Down
116 changes: 0 additions & 116 deletions ocaml/perftest/xmlrpcserver.ml

This file was deleted.

38 changes: 38 additions & 0 deletions ocaml/quicktest/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(* -*- tuareg -*- *)
#require "unix"

let flags = function
| [] -> ""
| pkgs ->
let cmd = "ocamlfind ocamlc -verbose" ^ (
List.fold_left (fun acc pkg -> acc ^ " -package " ^ pkg) "" pkgs
) in
let ic = Unix.open_process_in
(cmd ^ " | grep -oEe '-ppx (\"([^\"\\]|\\.)+\"|\\w+)'")
in
let rec go ic acc =
try go ic (acc ^ " " ^ input_line ic) with End_of_file -> close_in ic; acc
in
go ic ""

let rewriters = ["ppx_deriving_rpc"; "ppx_sexp_conv"]

let coverage_rewriter =
let is_coverage = try Unix.getenv "BISECT_ENABLE" = "YES" with Not_found -> false in
if is_coverage then
"(preprocess (pps (bisect_ppx -conditional)))"
else
""

let () = Printf.ksprintf Jbuild_plugin.V1.send {|

(executable
((name quicktest)
(public_name quicktestbin)
(package xapi)
(flags (:standard -bin-annot %s -warn-error +a-3-4-6-9-27-28-29-52))
(libraries (
xapi_internal
))
))
|} (flags rewriters)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
58 changes: 58 additions & 0 deletions ocaml/tests/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
(* -*- tuareg -*- *)
#require "unix"

let flags = function
| [] -> ""
| pkgs ->
let cmd = "ocamlfind ocamlc -verbose" ^ (
List.fold_left (fun acc pkg -> acc ^ " -package " ^ pkg) "" pkgs
) in
let ic = Unix.open_process_in
(cmd ^ " | grep -oEe '-ppx (\"([^\"\\]|\\.)+\"|\\w+)'")
in
let rec go ic acc =
try go ic (acc ^ " " ^ input_line ic) with End_of_file -> close_in ic; acc
in
go ic ""

let rewriters = ["ppx_deriving_rpc"; "ppx_sexp_conv"]

let coverage_rewriter =
let is_coverage = try Unix.getenv "BISECT_ENABLE" = "YES" with Not_found -> false in
if is_coverage then
"(preprocess (pps (bisect_ppx -conditional)))"
else
""

let () = Printf.ksprintf Jbuild_plugin.V1.send {|


(executables
((names (suite suite_alcotest))
(flags (:standard -bin-annot %s -warn-error +a-3-4-6-9-27-28-29-52))
(libraries (
xapi_internal
alcotest
oUnit
stdext
threads
))
%s)
)

(alias
((name runtest)
(package xapi)
(deps (suite.exe (files_recursively_in test_data)))
(action (run ${<} -runner sequential -verbose true))
)
)

(alias
((name runtest)
(package xapi)
(deps (suite_alcotest.exe (files_recursively_in test_data)))
(action (run ${<}))
)
)
|} (flags rewriters) coverage_rewriter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need to do this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only for coverage, as far as I know.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think we could remove flags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still needed until we port rpc to jbuilder. A port is ready but there are some issues with camlp4 and the way it interacts with ppx in xapi-idl, so I'd rather wait until the port is complete

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 15 additions & 20 deletions ocaml/xapi/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ let () = Printf.ksprintf Jbuild_plugin.V1.send {|
)
)

(executables
((names (xapi_main suite suite_alcotest quicktest))
(public_names (xapi - - quicktestbin))
(package xapi)
(library
((name xapi_internal)
(wrapped false)
(flags (:standard -bin-annot %s -warn-error +a-3-4-6-9-27-28-29-52))
(modules (:standard \ xapi_main))
(libraries (
alcotest
opasswd
pam
pciutil
Expand All @@ -82,7 +81,6 @@ let () = Printf.ksprintf Jbuild_plugin.V1.send {|
message-switch-unix
mtime
mtime.clock.os
oUnit
sha
tar
tar-unix
Expand Down Expand Up @@ -115,17 +113,14 @@ let () = Printf.ksprintf Jbuild_plugin.V1.send {|
%s)
)

(alias
((name runtest)
(deps (suite.exe (files_recursively_in test_data)))
(action (run ${<} -runner sequential -verbose true))
)
)

(alias
((name runtest)
(deps (suite_alcotest.exe (files_recursively_in test_data)))
(action (run ${<}))
)
)
|} (flags rewriters) coverage_rewriter
(executable
((name xapi_main)
(public_name xapi)
(package xapi)
(modules (xapi_main))
(flags (:standard -bin-annot %s -warn-error +a-3-4-6-9-27-28-29-52))
(libraries (
xapi_internal
))
))
|}(flags rewriters) coverage_rewriter (flags rewriters)
43 changes: 0 additions & 43 deletions ocaml/xapi/upload_receive.ml

This file was deleted.

34 changes: 0 additions & 34 deletions ocaml/xapi/xenstore_copy.ml

This file was deleted.

Loading