diff --git a/.github/workflows/ocaml-ci.yml b/.github/workflows/ocaml-ci.yml index bb212541..3758c01d 100644 --- a/.github/workflows/ocaml-ci.yml +++ b/.github/workflows/ocaml-ci.yml @@ -9,7 +9,7 @@ jobs: name: Ocaml tests runs-on: ubuntu-20.04 env: - package: "xapi-stdext-date xapi-stdext-encodings xapi-stdext-pervasives xapi-stdext-std xapi-stdext-threads xapi-stdext-unix xapi-stdext-zerocheck" + package: "xapi-stdext-date xapi-stdext-encodings xapi-stdext-pervasives xapi-stdext-std xapi-stdext-threads xapi-stdext-unix xapi-stdext-zerocheck xapi-fdcaps xapi-fd-test" steps: - name: Checkout code diff --git a/dune-project b/dune-project index e4ed9cfb..ff2bd62a 100644 --- a/dune-project +++ b/dune-project @@ -22,6 +22,8 @@ (xapi-stdext-threads (= :version)) (xapi-stdext-unix (= :version)) (xapi-stdext-zerocheck (= :version)) + (xapi-fdcaps (= :version)) + (xapi-fdcaps-test (and (= :version) :with-test)) ) ) @@ -115,3 +117,16 @@ fmt ) ) + +(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)) + ) +) diff --git a/lib/xapi-fd-test/dune b/lib/xapi-fd-test/dune new file mode 100644 index 00000000..b2a0d2fe --- /dev/null +++ b/lib/xapi-fd-test/dune @@ -0,0 +1,6 @@ +; 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 xapi-fdcaps unix qcheck-core logs fmt mtime mtime.clock.os) +) diff --git a/lib/xapi-fd-test/test/dune b/lib/xapi-fd-test/test/dune new file mode 100644 index 00000000..10b800a0 --- /dev/null +++ b/lib/xapi-fd-test/test/dune @@ -0,0 +1,6 @@ +; This is a test framework, but we still need to test it +(test + (package xapi-fd-test) + (name test_xapi_fd_test) + (libraries xapi_fd_test alcotest) +) diff --git a/lib/xapi-fd-test/test/test_xapi_fd_test.ml b/lib/xapi-fd-test/test/test_xapi_fd_test.ml new file mode 100644 index 00000000..e69de29b diff --git a/xapi-fd-test.opam b/xapi-fd-test.opam new file mode 100644 index 00000000..faaeee26 --- /dev/null +++ b/xapi-fd-test.opam @@ -0,0 +1,33 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "Test framework for file descriptor operations" +maintainer: ["Xapi project maintainers"] +authors: ["Jonathan Ludlam"] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" +homepage: "https://github.com/xapi-project/stdext" +bug-reports: "https://github.com/xapi-project/stdext/issues" +depends: [ + "dune" {>= "2.7"} + "alcotest" {with-test} + "base-unix" + "fmt" + "mtime" {>= "2.0.0"} + "logs" + "qcheck-core" {>= "0.21.2"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/xapi-project/stdext.git" diff --git a/xapi-stdext.opam b/xapi-stdext.opam index 40429802..04db4bb6 100644 --- a/xapi-stdext.opam +++ b/xapi-stdext.opam @@ -16,6 +16,8 @@ depends: [ "xapi-stdext-threads" {= version} "xapi-stdext-unix" {= version} "xapi-stdext-zerocheck" {= version} + "xapi-fdcaps" {= version} + "xapi-fdcaps-test" {= version & with-test} "odoc" {with-doc} ] build: [