Skip to content

Commit

Permalink
Merge pull request #5402 from edwintorok/private/edvint/merge-stdext2…
Browse files Browse the repository at this point in the history
…-tests2

CP-47001: stdext: quickcheck-style tests and select->epoll conversion
  • Loading branch information
edwintorok committed May 14, 2024
2 parents 51e3159 + 4ef091d commit e0eeb72
Show file tree
Hide file tree
Showing 93 changed files with 3,282 additions and 103 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ _build/
*.bak
*.native
.merlin
_coverage/
*.install
*.swp
compile_flags.txt
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ JOBS = $(shell getconf _NPROCESSORS_ONLN)
PROFILE=release
OPTMANDIR ?= $(OPTDIR)/man/man1/

.PHONY: build clean test doc python format install uninstall
.PHONY: build clean test doc python format install uninstall coverage

# if we have XAPI_VERSION set then set it in dune-project so we use that version number instead of the one obtained from git
# this is typically used when we're not building from a git repo
Expand All @@ -20,6 +20,11 @@ build:
check:
dune build @check -j $(JOBS)

coverage:
dune runtest --instrument-with bisect_ppx --force --profile=$(RELEASE) -j $(JOBS)
bisect-ppx-report html
bisect-ppx-report summary --per-file

clean:
dune clean

Expand Down
32 changes: 31 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
(lang dune 2.0)
(lang dune 2.7)
(formatting (enabled_for ocaml))

(cram enable)
(implicit_transitive_deps false)
(generate_opam_files true)

(source (github xapi-project/xen-api))
Expand Down Expand Up @@ -274,6 +276,7 @@
(xapi-stdext-threads (= :version))
(xapi-stdext-unix (= :version))
(xapi-stdext-zerocheck (= :version))
(xapi-fdcaps (= :version))
)
)

Expand Down Expand Up @@ -333,6 +336,8 @@
base-unix
(odoc :with-doc)
(xapi-stdext-pervasives (= :version))
(mtime :with-test)
(xapi-stdext-unix (= :version))
)
)

Expand All @@ -346,6 +351,7 @@
(odoc :with-doc)
xapi-backtrace
(xapi-stdext-pervasives (= :version))
polly
)
)

Expand All @@ -357,3 +363,27 @@
(odoc :with-doc)
)
)

(package
(name xapi-fdcaps)
(synopsis "Static capabilities for file descriptor operations")
(depends
(alcotest :with-test)
base-unix
fmt
(bisect_ppx :with-test)
)
)

(package
(name xapi-fd-test)
(synopsis "Test framework for file descriptor operations")
(depends
(alcotest :with-test)
base-unix
fmt
(mtime (>= 2.0.0))
logs
(qcheck-core (>= 0.21.2))
)
)
2 changes: 2 additions & 0 deletions ocaml/database/dune
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

(library
(name xapi_database)
(modes best)
(modules
(:standard \ database_server_main db_cache_test db_names db_exn
block_device_io string_marshall_helper string_unmarshall_helper schema
Expand All @@ -40,6 +41,7 @@
xapi-datamodel
xapi-log
(re_export xapi-schema)
xapi-idl.updates
xapi-stdext-encodings
xapi-stdext-pervasives
xapi-stdext-std
Expand Down
1 change: 1 addition & 0 deletions ocaml/forkexecd/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
fd-send-recv
rpclib.core
rpclib.json
rpclib.xml
uuid
xapi-backtrace
xapi-log
Expand Down
6 changes: 4 additions & 2 deletions ocaml/libs/ezxenstore/core/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
logs
threads
uuidm
xenstore_transport
xenstore.unix)
(re_export xenstore)
(re_export xenstore_transport)
threads.posix
(re_export xenstore.unix))
)
4 changes: 2 additions & 2 deletions ocaml/libs/ezxenstore/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(public_name ezxenstore)
(wrapped false)
(libraries
ezxenstore_core
ezxenstore_watch
(re_export ezxenstore_core)
(re_export ezxenstore_watch)
)
)
2 changes: 1 addition & 1 deletion ocaml/libs/ezxenstore/lib_test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(name main)
(package ezxenstore)
(deps main.exe)
(libraries cmdliner ezxenstore xenstore_transport)
(libraries cmdliner ezxenstore xenstore_transport xenstore xenstore.unix)
)
5 changes: 4 additions & 1 deletion ocaml/libs/ezxenstore/watch/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
(wrapped false)
(libraries
ezxenstore_core
xenctrl)
xenctrl
uuidm
threads.posix
)
)
5 changes: 5 additions & 0 deletions ocaml/libs/http-lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
(libraries
astring
base64
fmt
ipaddr
mtime
mtime.clock.os
Expand Down Expand Up @@ -35,10 +36,12 @@
(library
(name httpsvr)
(wrapped false)
(modes best)
(modules http_svr http_proxy server_io)
(libraries
astring
http_lib
ipaddr
polly
threads.posix
xapi-log
Expand All @@ -51,10 +54,12 @@
(tests
(names http_test radix_tree_test)
(package http-lib)
(modes (best exe))
(modules http_test radix_tree_test)
(libraries
alcotest
dune-build-info
fmt
http_lib
)
)
Expand Down
5 changes: 4 additions & 1 deletion ocaml/libs/tracing/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(name tracing)
(modules tracing)
(libraries re uri xapi-log xapi-stdext-threads)
(libraries re uri xapi-log xapi-stdext-threads threads.posix)
(public_name xapi-tracing))

(library
Expand All @@ -15,7 +15,10 @@
ptime.clock.os
rpclib.core
rpclib.json
result
rresult
tracing
threads.posix
uri
xapi-log
xapi-open-uri
Expand Down
2 changes: 1 addition & 1 deletion ocaml/libs/uuid/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(public_name uuid)
(modules uuidx)
(libraries
unix uuidm
unix (re_export uuidm)
)
(wrapped false)
)
Expand Down
2 changes: 1 addition & 1 deletion ocaml/libs/vhd/cli/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
(name disk_to_ocaml)
(public_name disk_to_ocaml)
(package vhd-format-lwt)
(libraries disk lwt))
(libraries disk lwt lwt.unix))
2 changes: 1 addition & 1 deletion ocaml/libs/vhd/vhd_format/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(name vhd_format)
(public_name vhd-format)
(flags :standard -w -32-34-37)
(libraries stdlib-shims cstruct io-page rresult uuidm)
(libraries stdlib-shims (re_export bigarray-compat) cstruct io-page rresult uuidm)
(preprocess (pps ppx_cstruct)))
2 changes: 1 addition & 1 deletion ocaml/libs/vhd/vhd_format_lwt/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(name vhd_format_lwt)
(public_name vhd-format-lwt)
(libraries cstruct lwt lwt.unix mirage-block vhd-format)
(libraries bigarray-compat cstruct-lwt cstruct lwt lwt.unix mirage-block vhd-format rresult)
(foreign_stubs
(language c)
(names blkgetsize64_stubs lseek64_stubs odirect_stubs)))
2 changes: 1 addition & 1 deletion ocaml/libs/xapi-inventory/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
astring
xapi-stdext-unix
xapi-stdext-threads
threads
threads.posix
)
)
1 change: 1 addition & 0 deletions ocaml/libs/xapi-rrd/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
(libraries
bigarray
rpclib.json
rpclib.core
xmlm
yojson
)
Expand Down
2 changes: 2 additions & 0 deletions ocaml/libs/xapi-rrd/lib_test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
unix
xapi-rrd
xapi-stdext-unix
rpclib.xml
xmlm
)
)

Expand Down
9 changes: 9 additions & 0 deletions ocaml/libs/xapi-stdext/lib/xapi-fd-test/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; This will be used to test stdext itself, so do not depend on stdext here
(library
(public_name xapi-fd-test)
(name xapi_fd_test)
(libraries (re_export xapi-fdcaps) unix qcheck-core logs fmt (re_export mtime) mtime.clock.os rresult threads.posix)

; off by default, enable with --instrument-with bisect_ppx
(instrumentation (backend bisect_ppx))
)

0 comments on commit e0eeb72

Please sign in to comment.