From 3930ad5b22f626520b0c2abaedcabd998fe748cc Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Wed, 29 Mar 2023 19:15:56 +0200 Subject: [PATCH] Add test that `packages` needs to be last, or it will be rejected File "dune", line 12, characters 3-10: 12 | (package a) ^^^^^^^ Error: Unknown action or rule field. [1] Signed-off-by: Marek Kubica --- test/blackbox-tests/test-cases/package-rule.t/a.opam | 0 test/blackbox-tests/test-cases/package-rule.t/dune | 12 ++++++++++++ .../test-cases/package-rule.t/dune-project | 1 + test/blackbox-tests/test-cases/package-rule.t/run.t | 8 ++++++++ .../blackbox-tests/test-cases/package-rule.t/test.ml | 2 ++ .../test-cases/package-rule.t/test_temp.ml | 1 + 6 files changed, 24 insertions(+) create mode 100644 test/blackbox-tests/test-cases/package-rule.t/a.opam create mode 100644 test/blackbox-tests/test-cases/package-rule.t/dune create mode 100644 test/blackbox-tests/test-cases/package-rule.t/dune-project create mode 100644 test/blackbox-tests/test-cases/package-rule.t/run.t create mode 100644 test/blackbox-tests/test-cases/package-rule.t/test.ml create mode 100644 test/blackbox-tests/test-cases/package-rule.t/test_temp.ml diff --git a/test/blackbox-tests/test-cases/package-rule.t/a.opam b/test/blackbox-tests/test-cases/package-rule.t/a.opam new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/blackbox-tests/test-cases/package-rule.t/dune b/test/blackbox-tests/test-cases/package-rule.t/dune new file mode 100644 index 00000000000..7fb4c837630 --- /dev/null +++ b/test/blackbox-tests/test-cases/package-rule.t/dune @@ -0,0 +1,12 @@ +(test + (name test) + (modules test test_a test_b) + (package a)) + +(rule + (action (copy test_temp.ml test_a.ml)) + (package a)) + +(rule + (package a) + (action (copy test_temp.ml test_b.ml))) diff --git a/test/blackbox-tests/test-cases/package-rule.t/dune-project b/test/blackbox-tests/test-cases/package-rule.t/dune-project new file mode 100644 index 00000000000..929c696e561 --- /dev/null +++ b/test/blackbox-tests/test-cases/package-rule.t/dune-project @@ -0,0 +1 @@ +(lang dune 2.0) diff --git a/test/blackbox-tests/test-cases/package-rule.t/run.t b/test/blackbox-tests/test-cases/package-rule.t/run.t new file mode 100644 index 00000000000..f04524d7b1a --- /dev/null +++ b/test/blackbox-tests/test-cases/package-rule.t/run.t @@ -0,0 +1,8 @@ +When --only-packages is passed, it runs + + $ dune build --only-packages a @runtest + File "dune", line 12, characters 3-10: + 12 | (package a) + ^^^^^^^ + Error: Unknown action or rule field. + [1] diff --git a/test/blackbox-tests/test-cases/package-rule.t/test.ml b/test/blackbox-tests/test-cases/package-rule.t/test.ml new file mode 100644 index 00000000000..75ac96eddc2 --- /dev/null +++ b/test/blackbox-tests/test-cases/package-rule.t/test.ml @@ -0,0 +1,2 @@ +module _ = Test_a +module _ = Test_b diff --git a/test/blackbox-tests/test-cases/package-rule.t/test_temp.ml b/test/blackbox-tests/test-cases/package-rule.t/test_temp.ml new file mode 100644 index 00000000000..5c90cb66203 --- /dev/null +++ b/test/blackbox-tests/test-cases/package-rule.t/test_temp.ml @@ -0,0 +1 @@ +let () = print_endline "A"