Skip to content

Commit

Permalink
Add test that packages needs to be last, or it will be rejected
Browse files Browse the repository at this point in the history
    File "dune", line 12, characters 3-10:
    12 |   (package a)
            ^^^^^^^
    Error: Unknown action or rule field.
    [1]

Signed-off-by: Marek Kubica <marek@tarides.com>
  • Loading branch information
Leonidas-from-XIV committed Mar 29, 2023
1 parent 57bc4c5 commit 3930ad5
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
Empty file.
12 changes: 12 additions & 0 deletions test/blackbox-tests/test-cases/package-rule.t/dune
Original file line number Diff line number Diff line change
@@ -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)))
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/package-rule.t/dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 2.0)
8 changes: 8 additions & 0 deletions test/blackbox-tests/test-cases/package-rule.t/run.t
Original file line number Diff line number Diff line change
@@ -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]
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/package-rule.t/test.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module _ = Test_a
module _ = Test_b
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/package-rule.t/test_temp.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = print_endline "A"

0 comments on commit 3930ad5

Please sign in to comment.