Skip to content

Commit b09b84a

Browse files
committed
Fix dependency challenges with 4.x
1 parent a1e8a74 commit b09b84a

5 files changed

Lines changed: 37 additions & 13 deletions

File tree

.github/workflows/workflow.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,27 @@ jobs:
6363
- name: Test (${{ matrix.package }})
6464
if: startsWith(matrix.ocaml-compiler, '5')
6565
run: |
66-
opam_files="./ppx_protocol_conv.opam"
67-
if [ "${{ matrix.package }}" != "ppx_protocol_conv" ]; then
68-
opam_files="$opam_files ./${{ matrix.package }}.opam"
69-
fi
70-
opam install $opam_files --deps-only --with-test
71-
opam exec -- dune runtest -p ${{ matrix.package }}
66+
opam install ./*.opam --deps-only --with-test
67+
case "${{ matrix.package }}" in
68+
ppx_protocol_conv)
69+
opam exec -- dune runtest ppx/test test
70+
;;
71+
ppx_protocol_conv_json)
72+
opam exec -- dune runtest drivers/json drivers/json/test
73+
;;
74+
ppx_protocol_conv_jsonm)
75+
opam exec -- dune runtest drivers/jsonm/test
76+
;;
77+
ppx_protocol_conv_msgpack)
78+
opam exec -- dune runtest drivers/msgpack/test
79+
;;
80+
ppx_protocol_conv_xml_light)
81+
opam exec -- dune runtest drivers/xml_light/test
82+
;;
83+
ppx_protocol_conv_xmlm)
84+
opam exec -- dune runtest drivers/xmlm/test
85+
;;
86+
ppx_protocol_conv_yaml)
87+
opam exec -- dune runtest drivers/yaml/test
88+
;;
89+
esac

drivers/json/dune

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
(library
22
(name protocol_conv_json)
33
(public_name ppx_protocol_conv_json)
4-
(private_modules test_expect)
4+
(modules (:standard \ test_expect))
55
(libraries ppx_protocol_conv.runtime ppx_protocol_conv.driver yojson)
66
(synopsis "yojson (de)serialization driver for ppx_protocol_conv")
7+
(preprocess (pps ppx_protocol_conv))
8+
)
9+
10+
(library
11+
(name protocol_conv_json_inline_tests)
12+
(modules test_expect)
13+
(libraries protocol_conv_json ppx_protocol_conv.driver)
714
(preprocess (pps ppx_protocol_conv ppx_expect))
15+
(inline_tests)
816
)

drivers/json/test_expect.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Default_parameters = Ppx_protocol_driver.Default_parameters
2-
module Make = Json.Make
2+
module Make = Protocol_conv_json.Json.Make
33

44
(** Test parameters. *)
55
module Test = struct
@@ -182,7 +182,7 @@ module Test = struct
182182
end
183183

184184
module Yojson_test = struct
185-
module Json = Json.Yojson
185+
module Json = Protocol_conv_json.Json.Yojson
186186
type 'a v = A of int | B of { int: int; t: 'a } | C [@name "C-D"]
187187
and t = {
188188
int : int [@default 5];

dune-project

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
(ocaml (>= 4.08))
3232
(ppx_protocol_conv (= :version))
3333
(yojson (>= 1.6.0))
34-
ppx_expect
35-
ppx_inline_test
34+
(ppx_expect :with-test)
3635
(ppx_sexp_conv :with-test)
3736
(sexplib :with-test)
3837
(alcotest :with-test)))

ppx_protocol_conv_json.opam

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ depends: [
1313
"ocaml" {>= "4.08"}
1414
"ppx_protocol_conv" {= version}
1515
"yojson" {>= "1.6.0"}
16-
"ppx_expect"
17-
"ppx_inline_test"
16+
"ppx_expect" {with-test}
1817
"ppx_sexp_conv" {with-test}
1918
"sexplib" {with-test}
2019
"alcotest" {with-test}

0 commit comments

Comments
 (0)