From 2fc5fb01b30cd52008a9132c0bd521882b314d07 Mon Sep 17 00:00:00 2001 From: Corentin Leruth Date: Wed, 25 Jan 2023 07:36:25 +0100 Subject: [PATCH] add test for enabled_if with <= operator Signed-off-by: Corentin Leruth --- .../enabled_if/eif-ocaml_version_lte/dune | 3 +++ .../enabled_if/eif-ocaml_version_lte/run.t | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte/dune create mode 100644 test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte/run.t diff --git a/test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte/dune b/test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte/dune new file mode 100644 index 000000000000..9483c51081db --- /dev/null +++ b/test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte/dune @@ -0,0 +1,3 @@ +(cram + (enabled_if + (= %{ocaml_version} 4.14.1))) diff --git a/test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte/run.t b/test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte/run.t new file mode 100644 index 000000000000..6e88e745bea5 --- /dev/null +++ b/test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte/run.t @@ -0,0 +1,21 @@ + $ cat >dune-project < (lang dune 3.0) + > EOF + + $ cat >dune < (library + > (name lte414caml) + > (modules lte414caml) + > (enabled_if (<= %{ocaml_version} 4.14.1))) + > + > (rule (with-stdout-to lte414caml.ml (echo ""))) + > + > (rule (with-stdout-to main.ml (echo ""))) + > + > (executable + > (name main) + > (modules main) + > (libraries lte414caml)) + > EOF + + $ dune build