Skip to content

Commit

Permalink
fix(test): disale mdx when libextism isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Jan 15, 2024
1 parent 4876191 commit 008970b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(mdx
(package extism)
(libraries extism-manifest extism yojson)
(enabled_if (not (= %{env:EXTISM_TEST_NO_LIB=} "1")))
(deps wasm/code.wasm))
2 changes: 1 addition & 1 deletion extism.opam
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ build: [
]
]
dev-repo: "git+https://github.com/extism/ocaml-sdk.git"
build-env: [EXTISM_TEST_NO_LIB = ""]
build-env: [EXTISM_TEST_NO_LIB = "1"]
post-messages: ["See https://extism.org/docs/install/ for information about installing libextism"]
2 changes: 1 addition & 1 deletion extism.opam.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build-env: [EXTISM_TEST_NO_LIB = ""]
build-env: [EXTISM_TEST_NO_LIB = "1"]
post-messages: ["See https://extism.org/docs/install/ for information about installing libextism"]
5 changes: 2 additions & 3 deletions src/bindings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ let locate () =
exit n
in
match Sys.getenv_opt "EXTISM_TEST_NO_LIB" with
| None -> fail 1
| Some _ -> fail 0)
| Some "1" -> fail 0
| _ -> fail 1)

let from =
let filename = locate () in
Expand Down Expand Up @@ -181,5 +181,4 @@ let extism_plugin_cancel =
fn "extism_plugin_cancel" (ptr void @-> returning bool)

let extism_plugin_id = fn "extism_plugin_id" (ptr void @-> returning (ptr char))

let extism_plugin_reset = fn "extism_plugin_reset" (ptr void @-> returning bool)
1 change: 1 addition & 0 deletions src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
(libraries extism-manifest extism yojson)
(package extism)
(deps test/code.wasm)
(enabled_if (not (= %{env:EXTISM_TEST_NO_LIB=} "1")))
(files :standard - *.mli))

0 comments on commit 008970b

Please sign in to comment.